-
I'm trying to do this:
Code:
Private Declare Function DllRegisterServer Lib app.path & "dimava.ocx" () As Long
Private Declare Function DllUnregisterServer Lib "MyDll.Dll" () As Long
Const ERROR_SUCCESS = &H0
so it comes up to a synax error, why?
(P.S. this is the declerations part of the Registaring an OCX/DLL code)
-
Put dimava.ocx in the C:\Windows\System directory and use this:
Code:
Private Declare Function DllRegisterServer Lib "dimava.ocx" () As Long
Private Declare Function DllUnregisterServer Lib "dimava.ocx" () As Long
Const ERROR_SUCCESS = &H0
-
that will work, but for many reasons I want ymy ocx's kept in the same folder with my programs, so I was thinking mabye something like:
Code:
Dim strOCX as string
Private Declare Function DllRegisterServer Lib strOCX () As Long
Private Declare Function DllUnregisterServer Lib strOCX () As Long
Const ERROR_SUCCESS = &H0
but that doesn't work either
-
Instead of using App.Path, simply specify the path manually.
Code:
Private Declare Function DllRegisterServer Lib "C:\MyPath\dimava.ocx" () As Long
-
If you don't want to do that, than I suggest you move it to the Windows\System directory. It is best to be located there. So no matter where you exe file has been moved, it will always work. Whereas, if your exe file was moved to a different folder, but the ocx stayed in the same place, it would probably create an error.
-
I want it to be in the same folder as the program, and megatron, the user selects the folder where they want all of the files to be installed to
-
dimava:
RegSvr32.exe is only about 30kb..
it won't make your apps that much bigger...
not that you could actually make something good enough to distribute.... but thats just IMO.....