I've done a bit of work with COM before to drive Excel - no problems, all worked following the examples on here. I've now got a small project to link to a third party VB6 DLL that has been supplied with a TLB file, should be no problem I thought but I cannot get the COM object to initialise. Here's what I've done:
1. Registered the VB6 DLL using regsvr32.
2. Used the PB object browser to create an include file.
3. Run the code below:
The include file is as follows:
Any clues at to what I'm not doing or doing wrong that could be causing the object not to load? Or the best way to start trying to debug this.
Nick
1. Registered the VB6 DLL using regsvr32.
2. Used the PB object browser to create an include file.
3. Run the code below:
Code:
#COMPILE EXE #INCLUDE "teCPPClient.INC" FUNCTION PBMAIN () AS LONG DIM oCPPClient AS teCPPClientclsConnect : LET oCPPClient = NEW teCPPClientclsConnect IN $PROGID_teCPPClientclsConnect IF ISFALSE ISOBJECT(oCPPClient) OR ERR THEN MSGBOX "Error linking to CPP Client "+STR$(ERR) END IF END FUNCTION
Code:
' ------------------------------------------------------------ ' Library Name: teCPPClient 2.0 ' Library File: C:\IMPRINT\teCPPClient.DLL ' ------------------------------------------------------------ ' Version Info: ' ------------- ' File Version: 2.02 ' Internal Name: teCPPClient ' Original Filename: teCPPClient.dll ' Product Name: teCPPClient ' Product Version: 2.02 ' ------------------------------------------------------------ ' ProgID: teCPPClient.clsConnect ' Interface Name: teCPPClientclsConnect ' ' Interface Prefix: teCPPClient ' ------------------------------------------------------------ $PROGID_teCPPClientclsConnect = "teCPPClient.clsConnect" 'Enumeration eSecurityLevel MACRO enumteCPPClienteSecurityLevel = LONG %High = &H00000000 %Low = &H00000001 INTERFACE DISPATCH teCPPClientclsConnect MEMBER LET UseHTTP<&H68030015>() 'Parameter Type As Long MEMBER GET UseHTTP<&H68030015>() AS LONG MEMBER LET STATUS<&H68030014>() 'Parameter Type As String MEMBER GET STATUS<&H68030014>() AS STRING MEMBER CALL SEND<&H60030016>(OPTIONAL IN Request AS STRING<&H00000000>) MEMBER LET SecurityLevel<&H68030013>() 'Parameter Type As enumteCPPClienteSecurityLevel MEMBER GET SecurityLevel<&H68030013>() AS enumteCPPClienteSecurityLevel MEMBER LET ProxyPassword<&H68030012>() 'Parameter Type As String MEMBER GET ProxyPassword<&H68030012>() AS STRING MEMBER LET ProxyUsername<&H68030011>() 'Parameter Type As String MEMBER GET ProxyUsername<&H68030011>() AS STRING MEMBER GET Response<&H68030010>() AS VARIANT MEMBER GET ContentType<&H6803000F>() AS STRING MEMBER LET Request<&H6803000E>() 'Parameter Type As String MEMBER GET Request<&H6803000E>() AS STRING MEMBER LET ProxyPort<&H6803000D>() 'Parameter Type As Integer MEMBER GET ProxyPort<&H6803000D>() AS INTEGER MEMBER LET Proxy<&H6803000C>() 'Parameter Type As String MEMBER GET Proxy<&H6803000C>() AS STRING MEMBER LET URL<&H6803000B>() 'Parameter Type As String MEMBER GET URL<&H6803000B>() AS STRING END INTERFACE
Nick
Comment