Results 1 to 7 of 7

Thread: Loadlibrary / Declaring dll function at runtime

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301

    Loadlibrary / Declaring dll function at runtime

    My software uses a Can serial card. I need to support three different types of card (PCMCIA, PCI, USB) each of these have there own dll. The dll's all contain the same function / function names.

    At the moment I have to get all the users to rename their dll file to 'cancard.dll' then I am using:

    VB Code:
    1. Declare Function CANPC_reset_board Lib "cancard.dll" Alias "_CANPC_reset_board@0" () As Long

    to delcare the function(s).

    I want to get away from forcing the user to rename their DLL's and automatically detect their dll and delcare it at runtime.

    I briefly looked at LoadLibrary, but it appears you need to use CallWindowProc to call the function. I still want to use the same syntax as before e.g

    VB Code:
    1. dim err_code as long
    2.  
    3. err_code = CANPC_reset_board

    Any ideas?

    Cheers
    Last edited by Rick H; Jun 26th, 2003 at 07:41 AM.

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