VB DLL einbinden



  • Folgendes:

    Ich habe ein C++ Programm (bzw. eine .Lib) in der ich einem ADODB Command (myCmd) eine Connection aus einer mit VB erstellten DLL zuweisen möchte.

    Mein C++ Code (Funktioniert natürlich nicht) bei dem die Verbindung übergeben werden soll:

    HMODULE hDLL =  LoadLibrary("DBConnect.dll");
    
    FARPROC  GetDBCon= GetProcAddress(hDLL,"DBConn");
    
    myCmd->ActiveConnection= GetDBCon;
    

    Mein dazugehöriger VB Code sieht so aus:

    Public Property Get DBConn() As Object
      Set DBConn = mCon
    End Property
    

    wobei mcon die ADODB.Connection ist.

    So, was mache ich falsch?

    Bekomme folgende Fehlermeldungen:
    f:\sw\corecomponents\src\ams\ams_rti.cpp(205) : error C2664: 'PutRefActiveConnection' : cannot convert parameter 1 from 'int (__stdcall *)(void)' to 'struct ADODB::_Connection *'
    There is no context in which this conversion is possible

    Wäre schön wenn mir jemand helfen könnte!
    DANKE!


Anmelden zum Antworten