Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create a dll
Message
 
 
À
10/01/2001 13:51:34
Information générale
Forum:
Visual C++
Catégorie:
Autre
Divers
Thread ID:
00461798
Message ID:
00462007
Vues:
18
>Can sombody tell me how to create a dll using visual-C that can be used by visual basic.
>
>When I use the new-workspace wizard to create a "Win32 Dynamic-Link Library" or a "MFC AppWizard (dll)" the dll's are not accepted by Visual Basic. I get the error: "Can't add a reference to the specified file".

If you're trying to use it as a COM DLL (which I assume you're trying, since you are attempting to reference it in the project), this approach will not work. You'll need to either:

a. Write a COM server, which would take way too much explanation for this forum.

b. Use VB's Declare statement to call the exported functions in the DLL.

Assuming b., export the functions as you normally would, then call it from VB with something like the following:
Private Declare Function GetTempPath Lib "kernel32" _
         Alias "GetTempPathA" (ByVal nBufferLength As Long, _
         ByVal lpBuffer As String) As Long
Mike Stewart
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform