>How can I register my DLL or OCX programmatically in VFP?
>
>run regsvr32.exe mydll.dll
>
>A Messagebox will promptfor success or failure from the dos prompt. I need to capture the result in VFP so that I know if the registration succeced.
>
>
>DO I need to use API call to register DLL in order to accomplish above task?
>
>Thanks
ActiveX and COM servers have an internal function that does the registration named DllRegisterServer() and another, DllUnregisterServer() that handle registration and unregistration. The following function takes the fully qualified filename of the server and attempts to register it.
FUNCTION RegisterServer
LPARAMETER tcFileName
LOCAL lnresult
DECLARE INTEGER DllRegisterServer IN (tcFileName)
lnresult = DllRegisterServer()
RETURN lnresult
ENDFUNC
If the function succeeds, it will return zero. Otherwise, an error occurred and the return value represents the error number. Note that the above does no checking for the actual existence of the file.
George
Ubi caritas et amor, deus ibi est