Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Long Beach, California, USA
    Posts
    1,912
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Obtaining Functions from a .DLL?? (VB6)

    OK, another silly question from the newbie. I have no idea if this is possible in VB, but I have seen it done in C++.

    On your computer is a file named "pstorec.dll". In this library are several "functions" (and "methods"??) that can be called -- stuff like "Create Type", "Create SubType", "Delete Type", "Get SubType Info", "Enum Types", etc. These allow a user to access and manipulate the Protected Storage System Provider data.

    In C++, one can Load the DLL {LoadLibrary("pstorec.dll")}, call a function, and manipulate the Pstores data.

    Can VB6 do the same type of thing??? How? Thanks.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Obtaining Functions from a .DLL?? (VB6)

    Well, based on experience with VBA, sure, why not? When you use a Declare statement to educate the VB/VBA environment about the parameters for an external function, you will have to use variable types that are legal in VB. This can be rather impenetrable without a lot of guidance. However, once you have it down, you can simply invoke the function and the VB runtime or VBA host will attend to the loading of the DLL into memory.

    Now... hopefully you will get some pointers about where you can crib those Declare statements.

  3. #3
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Obtaining Functions from a .DLL?? (VB6)

    An alternative to try would be to set a reference to it in your VB project: Project > References, and scroll though the displayed list to see if the .dll is there (if it's registered on the machine, then it should appear in the list). Put a checkmark to set the reference, and you should then have access to the functions in the .dll - at that point you should be able to examine them in the Object Brower (F2, then select the appropriate library in the libraries dropdown).

    Gary

Posting Permissions

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