Search found 6 matches

by deltarho
Thu Nov 03, 2016 10:32 am
Forum: Coding Questions
Topic: Reading a PowerBASIC dll
Replies: 10
Views: 3639

Re: Reading a PowerBASIC dll

In practice we probably wouldn't use MessageRequester but something like this

s3$ = PeekS( RemoveAny( s1$, s2$ )

However, we now have a memory leak.

If we go back to 'Export as String', in the PowerBASIC code then we could do this

ptr.l = RemoveAny( s1$, s2$ )
s3$ = PeekS( ptr.l, -1, #PB ...
by deltarho
Thu Nov 03, 2016 3:20 am
Forum: Coding Questions
Topic: Reading a PowerBASIC dll
Replies: 10
Views: 3639

Re: Reading a PowerBASIC dll

There is no need, Israel, we had the same issue - not realising that PureBasic's default string format clashed with using bstr in PowerBASIC.

Thanks.
by deltarho
Thu Nov 03, 2016 1:28 am
Forum: Coding Questions
Topic: Reading a PowerBASIC dll
Replies: 10
Views: 3639

Re: Reading a PowerBASIC dll

I saw that during my search after Shardik's tip but your link, ivega718, to the PowerBASIC dll is broken so I couldn't see the problem you needed solving.

Shardik's tip solved the PowerBASIC's string parameters and exporting a Wstring solved the problem with exporting a PowerBASIC String. PeekS ...
by deltarho
Thu Nov 03, 2016 12:13 am
Forum: Coding Questions
Topic: Reading a PowerBASIC dll
Replies: 10
Views: 3639

Re: Reading a PowerBASIC dll

I have managed it. :D

PowerBASIC code

#Compile DLL "PB_String_Crunches.dll"
#Dim All

Function RemoveAny( ByVal MainString As String, ByVal MatchString As String ) Export As WString
Local sText As WString

sText = Remove$( MainString, Any MatchString )
Function = sText

End Function ...
by deltarho
Wed Nov 02, 2016 10:54 pm
Forum: Coding Questions
Topic: Reading a PowerBASIC dll
Replies: 10
Views: 3639

Re: Reading a PowerBASIC dll

Thanks, Shardik - I am with you.

The problem I now have is that the PowerBASIC dll is exporting a string and I cannot use 'Prototype.p-bstr'.

I need to do some more reading - it was good to see off the access violation. :)
by deltarho
Wed Nov 02, 2016 9:46 pm
Forum: Coding Questions
Topic: Reading a PowerBASIC dll
Replies: 10
Views: 3639

Reading a PowerBASIC dll

I am experimenting with writing a dll in PowerBASIC and reading it from PureBasic.

Here is the PowerBASIC code

#Compile DLL "PB_String_Crunches.dll"
#Dim All

Function RemoveAny( ByVal MainString As String, ByVal MatchString As String ) Export As String

Function = Remove$( MainString, Any ...