ActiveX registration
-
Hello, my MFC dialog based app uses a freeware activex I found on the net. To use it, the relative ocx file must be registered in the system. Is there a way to make the app do itself without the user having to run regsvr32 c:\..... ? I added the lines
STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); ZeroMemory( &pi, sizeof(pi) ); CreateProcess(NULL, // No module name (use command line). "regsvr32 MyOcx.ocx",// Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ); // Pointer to PROCESS_INFORMATION structure.*/
inside InitInstance(). It seems to partially work: with the ocx unregistered, the first time I execute the app it brings out the information message box saying "DllRegisterServer MyOcx..." From now on each time I execute the app first I see the box and finall the app. I'd love to skip the first dummy execution and to close automatically the system info box without having to hit OK. Any suggestion about this? Thanks for the precious help. Marco. -
Hello, my MFC dialog based app uses a freeware activex I found on the net. To use it, the relative ocx file must be registered in the system. Is there a way to make the app do itself without the user having to run regsvr32 c:\..... ? I added the lines
STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); ZeroMemory( &pi, sizeof(pi) ); CreateProcess(NULL, // No module name (use command line). "regsvr32 MyOcx.ocx",// Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ); // Pointer to PROCESS_INFORMATION structure.*/
inside InitInstance(). It seems to partially work: with the ocx unregistered, the first time I execute the app it brings out the information message box saying "DllRegisterServer MyOcx..." From now on each time I execute the app first I see the box and finall the app. I'd love to skip the first dummy execution and to close automatically the system info box without having to hit OK. Any suggestion about this? Thanks for the precious help. Marco.use
"regsvr32 myocx.ocx /s"
NOTE: /s parameter this makes it register silently! :D Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fuity and sweet.
I'm jelly, what am I? - David Williams (Little Britain)