Announcement

Collapse
No announcement yet.

DLL for VB6 problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cliff Nichols
    replied
    You DOOOoooo need uppercase unless aliased (as seen in my other post), but that is also up to the compiler that is accessing a DLL (whether your own, or a 3rd party, or a API)

    What matters is making the rosetta stone between the DLL and how you use it

    Leave a comment:


  • Mike Doty
    replied
    I disagree. You do need it on the VB6 side unless he plans to use all upper case.

    Leave a comment:


  • Michael Mattias
    replied
    No, you don't "NEED" the ALIAS clause, but I would suggest it is a good practice.

    You also don't "NEED" #DIM ALL or #DEBUG ERROR ON, but I would suggest these are good practice as well.

    Leave a comment:


  • Mike Doty
    replied
    Also, you do not need ALIAS on the PB side if ALIAS "UPPER CASE" on the VB side as the function is exported all upper case by default. That is in the help somewhere, but I didn't find it.

    Leave a comment:


  • Mike Doty
    replied
    Sounds like a upper/lower case problem finding exported function.
    Did you use ALIAS in both PB and VB using all upper case?

    PB:
    Code:
    DECLARE SUB Hello LIB "connect.dll" ALIAS "HELLO" (s AS STRING)
    VB: (placed into MODULE1.BAS in this example)
    Code:
    PUBLIC Declare Sub Hello "connect.dll" Alias "HELLO" (s As String)

    Leave a comment:


  • Michael Mattias
    replied
    Also may be useful for VB+PB developers......

    Show Loaded Modules Source and Executable package for PB and VB
    Visual Basic include files/demo code by Balthasar Indermuehle. (PB code by YT.)

    Leave a comment:


  • Kev Peel
    replied
    VB uses dynamic loading of DLLs (LoadLibrary), in the IDE, so a simple CHDIR APP.PATH in the main Form_Load will help it find a DLL located in the project folder. This is an old trick I used to use.

    Leave a comment:


  • Michael Mattias
    replied
    Today's hint: When creating PB DLLs for use with VB6, do NOT use "BYVAL AS STRING" parameters in your functions:

    http://www.powerbasic.com/support/pb...ad.php?t=38894

    Leave a comment:


  • Paul Squires
    replied
    People use PB DLLs with VB all the time so, yes, it can be done.

    Read the section in the PB manual called "Creating Dynamic Link Libraries". You need to EXPORT functions from your DLL and then craft the correct DECLARES to use in your VB program in order to call those functions in the DLL. You do not "register" the DLLs. RegSvr is used with ActiveX DLLs.

    Leave a comment:


  • Gerbert Houska
    started a topic DLL for VB6 problems

    DLL for VB6 problems

    According to all info available, it should be possible to write a DLL for the use by VB6.
    HA!
    I tried it, but if I don't register it, VB6 won't find it (even if it is in the same directory). If I try to register it, I get an error msg, "can not find regserver entry point" ( and I used the Export declaration). If I just try to use it from the IDE (Project - References etc) it says VB cannot use it.
    It seems I am doing something wrong, but what ?
Working...
X