I didin't check fully your code because I'm on hurry and didn't try to compile so take my reply as suggestion.
You seems to have taken code from an old example. Can it be?
Check your PowerBasic help. It is very detailed.
Anyway, PowerBasic LIBMAIN function is described at http://www.powerbasic.com/support/he...N_function.htm
In your code there are also other problems like:
[code=thinbasic]LIBMAIN = 1[/code]
is not a PB code. To return a parameter function you have to to use
[code=thinbasic]FUNCTION = ...[/code]
and not the name of the function.
[code=thinbasic]...
DEFAULT AS ASCIIZ PTR) EXPORT AS INTEGER[/code]
Is wrong. PTR parameters are always passed BYVAL so change to something
[code=thinbasic]...
BYVAL DEFAULT AS ASCIIZ PTR) EXPORT AS INTEGER[/code]
The same for all other parameters PTR passed. All PTR must be declared as BYVAL ...
Bookmarks