I can get this code to compile OK, and register OK, but when
I try to set a reference to the dll in VB6 I get an error:
"Error in loading dll"
Also, trying to use CreateObject in VB6 results in the
"Can't create ActiveX..."
Any thoughts?
I try to set a reference to the dll in VB6 I get an error:
"Error in loading dll"
Also, trying to use CreateObject in VB6 results in the
"Can't create ActiveX..."
Any thoughts?
Code:
#COMPILE DLL #DIM ALL #COM NAME "MyAX", 1.0 'copied from the help files $MyClassGuid = GUID$("{00000099-0000-0000-0000-000000000008}") $MyIfaceGuid = GUID$("{00000099-0000-0000-0000-000000000009}") #INCLUDE "Win32API.inc" GLOBAL ghInstance AS DWORD FUNCTION LIBMAIN (BYVAL hInstance AS LONG, _ BYVAL fwdReason AS LONG, _ BYVAL lpvReserved AS LONG) AS LONG SELECT CASE fwdReason CASE %DLL_PROCESS_ATTACH ghInstance = hInstance FUNCTION = 1 'success! CASE %DLL_PROCESS_DETACH FUNCTION = 1 'success! CASE %DLL_THREAD_ATTACH FUNCTION = 1 'success! CASE %DLL_THREAD_DETACH FUNCTION = 1 'success! END SELECT END FUNCTION CLASS MyClass $MyClassGuid AS COM INTERFACE MyInterface $MyIfaceGuid INHERIT IUNKNOWN METHOD Method1() AS LONG 'very simple method for testing METHOD=10 END METHOD END INTERFACE END CLASS
Comment