描述:
我写了个ATL的ASP组件。成功编译了,但在注册的时候不显示成功信息。在ASP中也无法调用。
注册不存在权限问题,因为我能成功注册自己编写的其他组件。
我的ASP COM组件代码中调用了数据库库函数和一个C语言写的库。编译成功,但在98和2000里都不显示注册成功信息。
相同代码写成一个EXE文件却能成功运行。但变成ATL ASP组件就是无法注册成功。
在注册时出现下面错误提示:
File : afxwin1.inl
Line : 19
我的输出函数中已经有了 AFX_MANAGE_STATE(AfxGetStaticModuleState())
====================
By default, MFC uses the resource handle of the main application to load the resource template. If you have an exported function in a DLL, such as one that launches a dialog box in the DLL, this template is actually stored in the DLL module. You need to switch the module state for the correct handle to be used. You can do this by adding the following code to the beginning of the function:
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
====================
按照MSDN的解释不应该引起第19行的错误了,为何还存在呢?
请高手帮助解决!!!!!!!!!!!
解决方案1:
缺ATL.dll或者是mfcxxxx.dll,最好使用最小依赖编译, 用Depends看看你的DLL还需要那些DLL
解决方案2:不成功也应该提示错误信息!你用vc6还是vc7写的呢?如果vc7那你就要代一些库用Depends看看