Returning strings to VB from a DLL

Just starting out? Need help? Post your questions and find answers here.
twobits
User
User
Posts: 11
Joined: Thu May 22, 2003 6:53 pm

Returning strings to VB from a DLL

Post by twobits »

Hi im trying to return s string from PB to VB without success, here is my code:

PB code:

Code: Select all

  ProcedureDLL.s GetName()
  
    ProcedureReturn "Test"
  EndProcedure
VB decleration:

Code: Select all

Public Declare Function GetString Lib "purebasic.dll" () As String
VB use:

Code: Select all

Private Sub Command1_Click()

    Command1.Caption = GetString
End Sub
The command buttons caption is "" after the function is called, any help appreciated.
2_bits
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

search the Resourcesite for 'VB_CALL_PBDLL' , there is a working example from me
SPAMINATOR NR.1
twobits
User
User
Posts: 11
Joined: Thu May 22, 2003 6:53 pm

Post by twobits »

OK, thank you very much :)
Post Reply