Ver Mensaje Individual
  #3  
Antiguo 16-10-2007
mauqu mauqu is offline
Miembro
 
Registrado: may 2007
Posts: 28
Reputación: 0
mauqu Va por buen camino
El tema es este, quiero crear una dll que despues la pueda usar con cualquier lenguaje o programa que trabaje con dll.

Probe con c++ de la siguiente manera

Código Delphi [-]
 
#include  
#include  
 
typedef int (__pascal *MYPROC)(int); 
 
int main(VOID) 
{ 
    int i;
    HINSTANCE hinstLib; 
    MYPROC ProcAdd; 
    BOOL fFreeResult, fRunTimeLinkSuccess = FALSE; 
 
    // handle de la DLL.
 
    hinstLib = LoadLibrary(TEXT("InterfazVisualLab.dll")); 
 
    
    if (hinstLib != NULL) 
    { 
        ProcAdd = (MYPROC) GetProcAddress(hinstLib, "Testear"); 
 
        
        if (NULL != ProcAdd) 
        {
            fRunTimeLinkSuccess = TRUE;
            i=(ProcAdd) (0); 
        }
 
        
        fFreeResult = FreeLibrary(hinstLib); 
    } 
 
    
    if (! fRunTimeLinkSuccess) 
        printf("Message printed from executable\n"); 
    return 0;
}

probe con visual basic de la siguiente manera:

Código Delphi [-]
 
Private Declare Function Testear Lib "InterfazVisualLab.dll" (ByVal a As Integer) As Integer
 
Private Sub Command1_Click()
    Testear (0)
End Sub

En los dos casos me da error :S
Responder Con Cita