how can i register dll and ocx in vc++
Printable View
how can i register dll and ocx in vc++
Use the Tools->Register Control option
i mean at run time !(sorry)
You need to use the LoadLibrary function. Code similar to this should be used: (warning...this will probably not compile):
I'm not too sure about the function pointer definition, though. Does anyone else have the exact details?Code:HMODULE hDLL = LoadLibrary("file.ocx")
*(STDAPI)(void) hDLLProc = GetProcAddress(hDLL, "DllRegisterServer");
if(hDLLProc)
(*hDLLProc)();
FreeLibrary(hDLL);