Author Topic: How to write c++ to call a PB dll  (Read 212 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris Chancellor

  • Full Member
  • ***
  • Posts: 126
How to write c++ to call a PB dll
« on: August 21, 2018, 07:32:58 PM »
Hello all

i'm looking for a c++ code that can call a PB dll and retrive a string from that PB dll.

how to write this c++ code ?

all help appreciated and thanxx in advance

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1996
    • www.zapsolution.com
Re: How to write c++ to call a PB dll
« Reply #1 on: August 22, 2018, 03:28:03 PM »
The easiest way is to export your strings as ASCIIZ.

But if you link with a PB DLL, then you are limiting yourself to 32-bit only.
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Chris Chancellor

  • Full Member
  • ***
  • Posts: 126
Re: How to write c++ to call a PB dll
« Reply #2 on: August 22, 2018, 03:54:48 PM »
Thanxx Patrice

i'm doing the conversion to C++ stage by stage, something like testing the water first
before leaping into it.  The main thing is to shed the PB codes or modules whenever i find a better
replacement for it.

so do you have any codes in C++ and PB that i can test out ?

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1996
    • www.zapsolution.com
Re: How to write c++ to call a PB dll
« Reply #3 on: August 22, 2018, 06:25:09 PM »
Exported ASCIIZ return a pointer.

So you can use movememory to copy it into you own buffer.

See also
https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-for-windows/56114-conversion-c-c-pb
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com