nicolaus wrote:
I have a dll where functions need some parameter a value as unsigned char.
Sample:
Code:
Dll_Function(struct zint_symbol *symbol, unsigned char *input, int length)
How i must call the dll function to send a unsigned char as parameter?
With prototypes you should use p-ascii if the parameter is only [out], means you give
the buffer to the chars, but you don't receive something from it (p-ascii does not
translate back the return buffer after the function call).
Code:
Prototype proto_Dll_Function(*symbol.zint_symbol, input.p-ascii, length.l)
Without using prototype with p-ascii:
In ASCII mode you can just give the address to a string: @"my string"
In Unicode mode you have to convert the string to ASCII first and give the address to that buffer.
If you get something returned in the buffer, you give the address of a (string)buffer. buffer.s = Space(length) -> give @buffer to the function.
In Unicode mode you do buffer.s = PeekS(@buffer,-1,#PB_Ascii) to get the ASCII string after the function returned.