一个关于注册dll的问题?

qihuanfengyun 2009-02-25 11:35:28
我想用VC编写一个像windows系统中regsvr32的,注册dll的小程序。如果这个东西相当庞大那么只要有注册与反注册就行了。但是小弟刚接触VC不知怎么个情况!望各位大哥指点一二。这个东西好编吗?
...全文
137 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
qihuanfengyun 2009-03-07
  • 打赏
  • 举报
回复
我弄了半天,原来在VC++ 6.0 所附带的工具中就有注册DLL的东西,直接点击就可以了!半天白忙活了!
qihuanfengyun 2009-03-07
  • 打赏
  • 举报
回复
我弄了半天,原来在VC++ 6.0 所附带的工具中就有注册DLL的东西,直接点击就可以了!半天白忙活了!
firsthym 2009-03-05
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 lwx300 的回复:]
DLL Registration / Unregistration using a Shell Extension
http://www.codeproject.com/KB/shell/dllregshex.aspx
[/Quote]

感谢分享网站!
qihuanfengyun 2009-03-05
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 hemiya 的回复:]
BatchFile code
regsvr32 /i my.dll // 注册
regsvr32 /u my.dll // 注销




C/C++ code
//---------------------------------------------------------------------------
// 注册com组件,reg为true注册,false注销
//---------------------------------------------------------------------------
bool __fastcall DllRegServer(const String &dllName, bool reg)
{
HINSTANCE module;
int __stdcall (…
[/Quote]
我怎么看不懂啊!代码的什么地方指示了我要注册的dll了?
chrys2000 2009-03-05
  • 打赏
  • 举报
回复
我顶先
野男孩 2009-03-05
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 qihuanfengyun 的回复:]
引用 10 楼 hemiya 的回复:
BatchFile code
regsvr32 /i my.dll // 注册
regsvr32 /u my.dll // 注销


C/C++ code
//---------------------------------------------------------------------------
// 注册com组件,reg为true注册,false注销
//---------------------------------------------------------------------------
bool __fastcall DllRegServer(const String &dllName, bool reg)
{
HINSTA…
[/Quote]

dllName里面就是要注册的dll
KHacker_001 2009-03-03
  • 打赏
  • 举报
回复
学习中
hemiya 2009-03-03
  • 打赏
  • 举报
回复
[code=BatchFile]
regsvr32 /i my.dll // 注册
regsvr32 /u my.dll // 注销
[/code]

//---------------------------------------------------------------------------
// 注册com组件,reg为true注册,false注销
//---------------------------------------------------------------------------
bool __fastcall DllRegServer(const String &dllName, bool reg)
{
HINSTANCE module;
int __stdcall (*fun)(void);
module = LoadLibrary(dllName.c_str());

if (reg)
fun = GetProcAddress(module, "DllRegisterServer");
else
fun = GetProcAddress(module, "DllUnregisterServer");

if (fun == NULL)
{
FreeLibrary(module);
return false;
}
else
{
fun();
FreeLibrary(module);
return true;
}
}
zhangwuji156 2009-02-26
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 lwx300 的回复:]
DLL Registration / Unregistration using a Shell Extension
http://www.codeproject.com/KB/shell/dllregshex.aspx
[/Quote]
前段时间我就看这个写的呀
lwx300 2009-02-26
  • 打赏
  • 举报
回复
DLL Registration / Unregistration using a Shell Extension
http://www.codeproject.com/KB/shell/dllregshex.aspx
lwx300 2009-02-26
  • 打赏
  • 举报
回复
qihuanfengyun 2009-02-26
  • 打赏
  • 举报
回复
能不能给举个例子啊!比如注册netman.dll具体怎么变成。最好把情绪源码贴出来!
jackzhhuang 2009-02-26
  • 打赏
  • 举报
回复
好像写一个脚本就可以注册啊,不记得了,com原理与应用有说到。
qihuanfengyun 2009-02-26
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 zhangwuji156 的回复:]
引用 6 楼 lwx300 的回复:
DLL Registration / Unregistration using a Shell Extension
http://www.codeproject.com/KB/shell/dllregshex.aspx

前段时间我就看这个写的呀
[/Quote]
可是那是英文而且分了好几部分,我不知道具体怎么写啊!
oyljerry 2009-02-25
  • 打赏
  • 举报
回复
DllRegisterServer , DllUnregisterServer 作为com 组件类型dll的缺省导出接口

你加载dll后,调用DllRegisterServer 来regsvr 注册
DllUnregisterServer 来regsvr /u 反注册
cnzdgs 2009-02-25
  • 打赏
  • 举报
回复
用LoadLibrary加载DLL。注册时用GetProcAddress获取DllRegisterServer函数地址,然后调用这个函数;反注册用GetProcAddress获取DllUnregisterServer函数地址,然后调用这个函数。最后FreeLibrary。
dxk01 2009-02-25
  • 打赏
  • 举报
回复
同意楼上两位的

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧