Announcement

Collapse
No announcement yet.

Linking PB with Vb5

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

  • Guest's Avatar
    Guest replied
    I do .. but, there is a link that may be helpful for examples of how
    to write type libraries and links to MSDN documentation:
    http://www.vbaccelerator.com/typelib.htm

    I'll wrap up a more complete example for anyone who wants to be mailed
    a copy.


    Leave a comment:


  • Dave Navarro
    replied
    Jason,

    Do you have an example of a Type Library resource?

    --Dave


    -------------
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Guest's Avatar
    Guest replied
    I found that including a Type Library into the DLL as a resource really helps the whole linking issue with VB.

    The number of complaints(and GPFs) I've gotten from my VB users has dropped
    to almost 0.

    Jason

    Leave a comment:


  • Tyrone W. Lee
    replied
    Man you guys are good.. I need to hang around here more often.

    T

    -------------
    Explorations v3.0 RPG Development System
    http://www.explore-rpg.com

    Leave a comment:


  • Lance Edmonds
    replied
    DIRECT32.DLL is included with PB/DLL for this type of purpose. It allows a 32-bit app to call a 16-bit DLL by providing the thunking mechanism. It does not work under Windows NT, and some (recent) versions of VB (ie: VB6) may cause problems with it in some circumstances.

    Check out the PBDLL\SAMPLES directory for DIRECT32.DLL and some example files.


    -------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Knuth Konrad
    replied
    Tyrone,

    suppose this is your PB function which should be exported:

    Code:
    Function pbParseCount Alias "pbParseCount" (sMain As STRING, ByVal iAny As INTEGER, _
       sPattern As STRING) Export As LONG
    
    If IsFalse(iAny) Then
       pbParseCount = ParseCount(sMain, sPattern)
    Else
       pbParseCount = ParseCount(sMain, Any sPattern)
    End If
    
    End Function
    Then your Declare in VB should look like
    Code:
    Declare Function pbParseCount Lib "SNSFUN32.DLL" (sMain As STRING, ByVal iAny As INTEGER, sPattern As STRING) As LONG
    Be warned though that if you run your App from within the VB-IDE VB sometimes doesn't find your DLL. Copy the compiled either to a directory in the PATH, or change the VB Declare to include the full pathname to the DLL, i.e.
    Code:
    Declare Function pbParseCount Lib "C:\PBDLL60\SNSFUN32.DLL" (sMain As STRING, ByVal iAny As INTEGER, sPattern As STRING) As LONG
    Someone else might be able to answer your 16bit DLL question.

    Knuth

    Leave a comment:


  • Tyrone W. Lee
    started a topic Linking PB with Vb5

    Linking PB with Vb5

    I have been having trouble linking PowerBasic DLL's with VB5. Could someone give me the brief version of creating 32bit DLL's and linking them.

    Also, is it possible to link a 16bit DLL in Vb5?

    T

    -------------
    Explorations v3.0 RPG Development System
    http://www.explore-rpg.com
Working...
X