>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