Need Help on .dll 
Author Message
 Need Help on .dll

I am writing a DLL function GetUserInfo() for my VB program.  This function
uses the UserID to search our Directory Service and get the user's name

Problem: I could get the user's name and display it from function
GetUserInfo(), but I couldn't pass it back to the VB program.

Can anybody tell me what was wrong?

Thanks for help.


The following is my code:

In .cpp:
_declspec (dllexport) int GetUserInfo(char *USERID, char *NAME)
    /* perform search and get the Name for USERID*/

    MessageBox(NULL, NAME, "Info", MB_OK);
        // I can display the NAME here
    return 0;


In .def

In VB:

Declare Function GetUserInfo Lib "MyDll" (ByVal UserID As String, _
                     ByRef Name As  String) As Integer

Private Sub Command1_Click()
    Dim Name As String
    Dim rc  As Integer

    rc = GetUserInfo("user001", Name)
    MsgBox Name
    ' I can NOT display the name from here
End Sub

Wed, 23 May 2001 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. HELP: Need help identifying DLLs with version,date,size etc

2. Need help debugging DLL Error

3. I need Help with Dlls

4. Need Help creating DLLs and VBXs

5. Need help accessing DLL from VB

6. Need help with DLL in VB4

7. I need help with dll use.

8. beginner needs help with DLLs

9. I need help on DLL's for a newbie

10. Need help with DLL

11. Desperately need help, Activex DLL

12. Desperately need help, Activex DLL


Powered by phpBB® Forum Software