Results 1 to 14 of 14

Thread: using a DLL

  1. #1

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919

    using a DLL

    i have a DLL i wanna use, i think i remember seeing a way of adding the DLL sorta like a header file..do you guys know (u prolly do )

    i wanna use "icmp.dll" in the windows dir..i dont wanna go through and have to use MFC to use the ping stuff

    thanks
    -nabeel
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  2. #2
    Member
    Join Date
    Feb 2001
    Posts
    57
    This is a sample from MSDN and may be what you're looking for...

    Note that the code is not complete and will not run, but you can adapt it into your program. Look at the documentation for LoadLibrary for more info.

    PHP Code:

    typedef UINT 
    (CALLBACKLPFNDLLFUNC1)(DWORD,UINT);
    .
    .
    .
    HINSTANCE hDLL;               // Handle to DLL
    LPFNDLLFUNC1 lpfnDllFunc1;    // Function pointer
    DWORD dwParam1;
    UINT  uParam2uReturnVal;

    hDLL LoadLibrary("MyDLL");
    if (
    hDLL != NULL)
    {
       
    lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,
                                               
    "DLLFunc1");
       if (!
    lpfnDllFunc1)
       {
          
    // handle the error
          
    FreeLibrary(hDLL);       
          return 
    SOME_ERROR_CODE;
       }
       else
       {
          
    // call the function
          
    uReturnVal lpfnDllFunc1(dwParam1uParam2);
       }


  3. #3

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    thanks...ill play around with it and see if i can get it to work
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Try this
    Attached Files Attached Files
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    amac
    Guest
    What can be exported from a DLL?

  6. #6
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    Originally posted by chilibean
    PHP Code:
    typedef UINT (CALLBACKLPFNDLLFUNC1)(DWORD,UINT); 
    What does this line do?
    Alcohol & calculus don't mix.
    Never drink & derive.

  7. #7
    amac
    Guest
    It is defining the type of LPFNDLLFUNC1... which happens to be a pointer to a function which returns an UINT and recieves a DWORD, and a UINT... which also uses the calling convention CALLBACK ( not sure what this macro is defined as )

  8. #8

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    thanks parksie


    but i get these errors:

    c:\program files\microsoft visual studio\vc98\include\icmpapi.h(148) : error C2061: syntax error : identifier 'IPAddr'
    c:\program files\microsoft visual studio\vc98\include\icmpapi.h(237) : error C2061: syntax error : identifier 'IPAddr'
    any ideas? i added "icmp.lib"

    i get it at
    PHP Code:
    DWORD
    WINAPI
    IcmpSendEcho
    (
        
    HANDLE                   IcmpHandle,
        
    IPAddr                   DestinationAddress,
        
    LPVOID                   RequestData,
        
    WORD                     RequestSize,
        
    PIP_OPTION_INFORMATION   RequestOptions,
        
    LPVOID                   ReplyBuffer,
        
    DWORD                    ReplySize,
        
    DWORD                    Timeout
        
    ); 
    Last edited by nabeels786; Jan 31st, 2002 at 08:08 AM.
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  9. #9
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Try this - you'll need windows.h as well.
    Attached Files Attached Files
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  10. #10

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    still no luck

    still says
    c:\program files\microsoft visual studio\vc98\include\icmpapi.h(150) : error C2061: syntax error : identifier 'IPAddr'
    windows.h, the header you gave me is also added.

    i downloaded the platform sdk also to see if that maybe had it, no luck

    any other ideas?

    thanks
    -nabeel
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  11. #11
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Do a full-text search in your PSDK include folder to find where it is - it's definitely defined somewhere because I found it.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  12. #12

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    nope, couldn't find it
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  13. #13

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    ahh nevermind, found it..

    all that trouble for
    PHP Code:
    typedef ULONG IPAddr;       // An IP address. 
    pfft
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  14. #14
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Somebody kick MS
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width