<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>27 Feb 2018 05:39:00 Z</lastBuildDate><pubDate>26 Feb 2018 10:49:00 Z</pubDate><description>I am trying to call a 3rd party DLL from WinDev22, but whenever the function returns data I get either a GPF error or "WDTst.exe has stopped working".&#13;
&#13;
I believe the issue related to the structure that I pass in and is loaded with the return data, it's described in the DLL documentation as ;&#13;
&#13;
typedef struct {&#13;
unsigned char aucEPoSNumber[2+1];&#13;
unsigned char ucResponseCode;&#13;
unsigned char aucAmount[8+1];&#13;
unsigned char ucReturnREP;&#13;
unsigned char ucPaymentMode;&#13;
unsigned char aucResponseData; //optional&#13;
unsigned char aucCurrency[3+1];&#13;
unsigned char aucPrivateData[10+1];&#13;
unsigned char aucOption[(26*99)+1]; //optional (RFU)&#13;
unsigned char aucNonConcertData[50000]; //optional&#13;
}CDC__S_DATA_RECEIVE;&#13;
&#13;
I've read through the WinDev documentation on DLL calls (API(), CallDLL32() and API Description) and I can see that there can be issues with C strings. So I have tried the methods described in CallDLL32, with defining strings and assigning them so my code looks like this;&#13;
&#13;
s_aucEPoSNumber is string on 2 // unsigned char aucEPoSNumber[2+1] s_ucResponseCode is string on 1 // unsigned char ucResponseCode s_aucAmount is string on 8 // unsigned char aucAmount[8+1] s_ucReturnREP is string on 1 // unsigned char ucReturnREP s_ucPaymentMode is string on 1 // unsigned char ucPaymentMode s_aucResponseData is string on 1 // unsigned char aucResponseData s_aucCurrency is string on 3 // unsigned char aucCurrency[3+1] s_aucPrivateData is string on 10 // unsigned char aucPrivateData[10+1] s_aucOption is string on (26*99) // unsigned char aucOption[(26*99)+1] s_aucNonConcertData is string on 50000 //unsigned char aucNonConcertData[50000] strDataToReceive is Structure aucEPoSNumber is int ucResponseCode is int aucAmount is int ucReturnREP is int ucPaymentMode is int aucResponseData is int aucCurrency is int aucPrivateData is int aucOption is int aucNonConcertData is int END dataReturn is StrDataToReceive WITH dataReturn :aucEPoSNumber=&amp;s_aucEPoSNumber :ucResponseCode=&amp;s_ucResponseCode :aucAmount=&amp;s_aucAmount :ucReturnREP=&amp;s_ucReturnREP :ucPaymentMode=&amp;s_ucPaymentMode :aucResponseData=&amp;s_aucResponseData :aucCurrency=&amp;s_aucCurrency :aucPrivateData=&amp;s_aucPrivateData :aucOption=&amp;s_aucOption :aucNonConcertData=&amp;s_aucNonConcertData END iReturn is int = -99 iTimeOut is int = 1*6000 cString is string = DataToSend() ConcertTransaction(cString,&amp;dataReturn,iTimeOut)&#13;
I've also tried&#13;
iReturn=CallDLL32("ComConcert","ConcertTransaction",cString,&amp;dataReturn,iTimeOut)&#13;
I've also tried the string length being with the +1, which indicates null terminated values, so for example the aucEPoSNumber as 3 instead of 2. I've also tried all the strings as simple strings and different CallingCOnvention settings.&#13;
&#13;
I've run out of thing to try or read in WinDev help.&#13;
&#13;
Anyone any suggestion or idea on how I could get this to work?</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure/read.awp</link><title>GPF when calling DLL with Structure</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64730/read.awp</comments><pubDate>27 Feb 2018 05:39:00 Z</pubDate><description>Hi&#13;
&#13;
Pls also see below sample that I did in 2006 for wav to mp3 conversion from lame dll.&#13;
&#13;
// 21:32:19 Mon.Feb.26 2018 now d…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64730/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64730/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure/read.awp">GPF when calling DLL with Structure</source><title>Re: GPF when calling DLL with Structure</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64729/read.awp</comments><pubDate>26 Feb 2018 20:51:00 Z</pubDate><description>Gary&#13;
&#13;
Try out as below:&#13;
&#13;
strDataToReceive is Structure&#13;
s_aucEPoSNumber is fixed string on 2 // unsigned char aucEPoSNumber[…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64729/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64729/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure/read.awp">GPF when calling DLL with Structure</source><title>Re: GPF when calling DLL with Structure</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64720/read.awp</comments><pubDate>26 Feb 2018 17:41:00 Z</pubDate><description>Two points:&#13;
1) Character &amp; String on 1 is not the same thing&#13;
You define characters as string ASCIIZ on 1...&#13;
You should define…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64720/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64720/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure/read.awp">GPF when calling DLL with Structure</source><title>Re: GPF when calling DLL with Structure</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64728/read.awp</comments><pubDate>26 Feb 2018 16:15:00 Z</pubDate><description>Gary,&#13;
&#13;
you use pointers now in the structure itself, is that the correct way?&#13;
&#13;
Maybe you can try this&#13;
&#13;
strDataToReceive is…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64728/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64728/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure/read.awp">GPF when calling DLL with Structure</source><title>Re: GPF when calling DLL with Structure</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64715/read.awp</comments><pubDate>26 Feb 2018 15:05:00 Z</pubDate><description>Hi Peter,&#13;
&#13;
I have tried that and also tried giving them initial values ;&#13;
s_aucEPoSNumber is string ASCIIZ on 3 = " "+Charact(…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64715/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64715/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure/read.awp">GPF when calling DLL with Structure</source><title>Re: GPF when calling DLL with Structure</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64711/read.awp</comments><pubDate>26 Feb 2018 13:57:00 Z</pubDate><description>Hi Gary,&#13;
&#13;
Your strings need to be declared as ASCII strings for API usage. It won't work with WL strings.&#13;
s_aucEPoSNumber is …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64711/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64711/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure/read.awp">GPF when calling DLL with Structure</source><title>Re: GPF when calling DLL with Structure</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64710/read.awp</comments><pubDate>26 Feb 2018 13:22:00 Z</pubDate><description>Hi Fabrice,&#13;
&#13;
WDAPI was not much help, it turned the structure into ;&#13;
// This structure was automatically generated // some ty…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64710/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64710/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure/read.awp">GPF when calling DLL with Structure</source><title>Re: GPF when calling DLL with Structure</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64708/read.awp</comments><pubDate>26 Feb 2018 12:07:00 Z</pubDate><description>Hi Gary,&#13;
&#13;
try using the C structure converter in WDAPI. While this tool is far from perfect, it should give you a good idea of…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64708/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure-64708/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64706-gpf-when-calling-dll-with-structure/read.awp">GPF when calling DLL with Structure</source><title>Re: GPF when calling DLL with Structure</title></item></channel></rss>
