Click here to Skip to main content
15,508,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, everyone.
I have some trouble while registering my ActiveX control.
When I build it in VS2008, it stop at "Registering output..." and will never be back until I press "Cancel" .Then I try to register the file by regsvr32.exe. The command return directly with no error or any other information, but I can find the process "regsvr32.exe" in Windows Task Manager, and I have to kill it by myself.
I have no idea what happened,is there anyone can give me help? :((
Posted

1 solution

Try to empty the function DllRegisterServer(..)
and then add line to line (slowly) to find the "catch".

You could also use the ::MessageBox(..) function after each line there
to "control" the execution :)
 
Share this answer
 
v2
Comments
Zheng PF 17-Aug-10 4:43am    
Thank you for your answer.I empty DllRegisterServer() ,but the problem still exist. Is it possible that the error happened before DllRegisterServer() ?How can I locate it?

The function DllRegisterServer() is below,it is generated by VS2008, I didn't change it.
STDAPI DllRegisterServer(void)
{
AFX_MANAGE_STATE(_afxModuleAddrThis);

if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
return ResultFromScode(SELFREG_E_TYPELIB);

if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
return ResultFromScode(SELFREG_E_CLASS);

return NOERROR;
}
Eugen Podsypalnikov 17-Aug-10 4:47am    
OK... :) Have you any global/static class/structure instances with provided constructors in your code ?(1) Have you changed the DllMain code ?(2)
Zheng PF 17-Aug-10 4:56am    
I didn't change the DLLMain code,but there are several global structure instances in the program.Do you mean these instances initialize in the regester process, and some of them conflict with regsvr32.exe?
Eugen Podsypalnikov 17-Aug-10 5:04am    
Any constructors (for example with endless loops) of the global things will be processed at the loading of their DLL (earlier as its registration could be called)... :)
Zheng PF 17-Aug-10 5:16am    
Thank you, I try to find the source of evil~~`(*n_n*)'

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900