Convert C-DLL to PureBasic-DLL
Posted: Sat May 28, 2016 8:42 am
Hello community,
I have this C-DLL:
and I want to convert it to a PureBasic-DLL, e.g. like this:
but it doesn't work. What is my error?
I have already tested several variants but without success.
Thanks for tips and hints.
Cheers
Stefan
I have this C-DLL:
Code: Select all
//-Begin----------------------------------------------------------------
//-Includes-----------------------------------------------------------
#include <windows.h>
//-Structures---------------------------------------------------------
struct TestStruct3 {
wchar_t *str;
};
//-strucTest22--------------------------------------------------------
__declspec(dllexport) void strucTest22(struct TestStruct3 **astruc,
int n) {
for (int i = 0; i < n; i++) {
wchar_t *str = astruc[i]->str;
OutputDebugStringW(str);
}
}
//-End------------------------------------------------------------------
Code: Select all
; Begin-----------------------------------------------------------------
; Structures----------------------------------------------------------
Structure TestStruct3
*x
EndStructure
; strucTest22---------------------------------------------------------
ProcedureDLL strucTest22(*astruc.TestStruct3, cnt.i)
Protected i.i
For i = 0 To cnt - 1
*astruc = *astruc + i * 4
OutputDebugString_(PeekS(*astruc\x))
Next
EndProcedure
; End-------------------------------------------------------------------
I have already tested several variants but without success.
Thanks for tips and hints.
Cheers
Stefan