Author | Topic: Problem accessing external C Dll | |
---|---|---|
Philip G Jackson | Problem accessing external C Dll on Mon, 17 Mar 2014 17:46:50 +1300 A customer has given me a Dll for me to use so he can control the barcode for printed labels. He has given me a sample program that works with this DLL and I can recompile the sample program and it still works but when I try running it from my main application I get the following error; Internal Data Structures Corrupted dllExecuteCall My code for calling it is as follows; nDll := DllLoad("S3ConceptPatterns.dll") cTemplate1 := DllPrepareCall(nDll, DLL_STDCALL, "TestMethod") nRet := DllExecuteCall(cTemplate1) I also tried the other method nRet := DllCall(nDll, DLL_STDCALL, "TestMethod") with identical results (DllCall). I don't see how the application should make a difference although I also can have 1-2 additional threads working. Does anyone have any suggestions as to what I can do next? Regards Phil Jackson | |
James Loughner | Re: Problem accessing external C Dll on Mon, 17 Mar 2014 14:56:51 -0400 What is passed to the function? Is it really just a call without Parameters?? Jim On 03/17/2014 12:46 AM, Philip G Jackson wrote: > A customer has given me a Dll for me to use so he can control the > barcode for printed labels. He has given me a sample program that works > with this DLL and I can recompile the sample program and it still works > but when I try running it from my main application I get the following > error; > > Internal Data Structures Corrupted > > dllExecuteCall > > > My code for calling it is as follows; > > nDll := DllLoad("S3ConceptPatterns.dll") > cTemplate1 := DllPrepareCall(nDll, DLL_STDCALL, "TestMethod") > nRet := DllExecuteCall(cTemplate1) > > I also tried the other method > > nRet := DllCall(nDll, DLL_STDCALL, "TestMethod") > > with identical results (DllCall). > > I don't see how the application should make a difference although I also > can have 1-2 additional threads working. > > Does anyone have any suggestions as to what I can do next? > > Regards > > Phil Jackson > > > | |
Philip G Jackson | Re: Problem accessing external C Dll on Tue, 18 Mar 2014 08:24:54 +1300 Hi James The testmethod has no parameters and is just a test to check that the method can be called. There is another method that does have parameters and if I pass them, it also fails. Cheers Phil Jackson On 18/03/2014 7:56 a.m., James Loughner wrote: > What is passed to the function? Is it really just a call without > Parameters?? > > Jim > > On 03/17/2014 12:46 AM, Philip G Jackson wrote: >> A customer has given me a Dll for me to use so he can control the >> barcode for printed labels. He has given me a sample program that works >> with this DLL and I can recompile the sample program and it still works >> but when I try running it from my main application I get the following >> error; >> >> Internal Data Structures Corrupted >> >> dllExecuteCall >> >> >> My code for calling it is as follows; >> >> nDll := DllLoad("S3ConceptPatterns.dll") >> cTemplate1 := DllPrepareCall(nDll, DLL_STDCALL, "TestMethod") >> nRet := DllExecuteCall(cTemplate1) >> >> I also tried the other method >> >> nRet := DllCall(nDll, DLL_STDCALL, "TestMethod") >> >> with identical results (DllCall). >> >> I don't see how the application should make a difference although I also >> can have 1-2 additional threads working. >> >> Does anyone have any suggestions as to what I can do next? >> >> Regards >> >> Phil Jackson >> >> >> > | |
Edgar Borger | Re: Problem accessing external C Dll on Mon, 17 Mar 2014 17:11:07 -0300 did you try DLL_CDECL instead of DLL_STDCALL ? Regards, Edgar Em 17/03/2014 16:24, Philip G Jackson escreveu: > Hi James > > The testmethod has no parameters and is just a test to check that the method can be called. There is another method that does have parameters and if I > pass them, it also fails. > > Cheers > > Phil Jackson > > > > > On 18/03/2014 7:56 a.m., James Loughner wrote: >> What is passed to the function? Is it really just a call without >> Parameters?? >> >> Jim >> >> On 03/17/2014 12:46 AM, Philip G Jackson wrote: >>> A customer has given me a Dll for me to use so he can control the >>> barcode for printed labels. He has given me a sample program that works >>> with this DLL and I can recompile the sample program and it still works >>> but when I try running it from my main application I get the following >>> error; >>> >>> Internal Data Structures Corrupted >>> >>> dllExecuteCall >>> >>> >>> My code for calling it is as follows; >>> >>> nDll := DllLoad("S3ConceptPatterns.dll") >>> cTemplate1 := DllPrepareCall(nDll, DLL_STDCALL, "TestMethod") >>> nRet := DllExecuteCall(cTemplate1) >>> >>> I also tried the other method >>> >>> nRet := DllCall(nDll, DLL_STDCALL, "TestMethod") >>> >>> with identical results (DllCall). >>> >>> I don't see how the application should make a difference although I also >>> can have 1-2 additional threads working. >>> >>> Does anyone have any suggestions as to what I can do next? >>> >>> Regards >>> >>> Phil Jackson >>> >>> >>> >> > -- Edgar Borger Softsupply Informatica Ltda. Rua Alagoas, 48 Sao Paulo, SP 01242-000 Tel : (5511) 3159-1997 Fax : (5511) 3255-5224 --- Este email está limpo de vírus e malwares porque a proteção do avast! Antivírus está ativa. http://www.avast.com | |
Philip G Jackson | Re: Problem accessing external C Dll on Wed, 19 Mar 2014 08:02:27 +1300 Hi Edgar I will try this - the sample program does use DLL_STDCALL though. Cheers Phil Jackson On 18/03/2014 9:11 a.m., Edgar Borger wrote: > > did you try DLL_CDECL instead of DLL_STDCALL ? > > Regards, > Edgar > > Em 17/03/2014 16:24, Philip G Jackson escreveu: >> Hi James >> >> The testmethod has no parameters and is just a test to check that the >> method can be called. There is another method that does have >> parameters and if I >> pass them, it also fails. >> >> Cheers >> >> Phil Jackson >> >> >> >> >> On 18/03/2014 7:56 a.m., James Loughner wrote: >>> What is passed to the function? Is it really just a call without >>> Parameters?? >>> >>> Jim >>> >>> On 03/17/2014 12:46 AM, Philip G Jackson wrote: >>>> A customer has given me a Dll for me to use so he can control the >>>> barcode for printed labels. He has given me a sample program that works >>>> with this DLL and I can recompile the sample program and it still works >>>> but when I try running it from my main application I get the following >>>> error; >>>> >>>> Internal Data Structures Corrupted >>>> >>>> dllExecuteCall >>>> >>>> >>>> My code for calling it is as follows; >>>> >>>> nDll := DllLoad("S3ConceptPatterns.dll") >>>> cTemplate1 := DllPrepareCall(nDll, DLL_STDCALL, "TestMethod") >>>> nRet := DllExecuteCall(cTemplate1) >>>> >>>> I also tried the other method >>>> >>>> nRet := DllCall(nDll, DLL_STDCALL, "TestMethod") >>>> >>>> with identical results (DllCall). >>>> >>>> I don't see how the application should make a difference although I >>>> also >>>> can have 1-2 additional threads working. >>>> >>>> Does anyone have any suggestions as to what I can do next? >>>> >>>> Regards >>>> >>>> Phil Jackson >>>> >>>> >>>> >>> >> > > | |
Hector Pezoa | Re: Problem accessing external C Dll on Tue, 18 Mar 2014 17:32:14 -0300 Hi Phillip Use the library Pablo Botella ot4xb can download it from this link http://www.xbwin.com/ use -> @S3ConceptPatterns:TestMethod( ...Parameters...) Best Regard Hector <Philip G Jackson> escribi en el mensaje news:19ccd63b$3b773262$39257@news.alaska-software.com... > Hi Edgar > > I will try this - the sample program does use DLL_STDCALL though. > > Cheers > > Phil Jackson > > On 18/03/2014 9:11 a.m., Edgar Borger wrote: >> >> did you try DLL_CDECL instead of DLL_STDCALL ? >> >> Regards, >> Edgar >> >> Em 17/03/2014 16:24, Philip G Jackson escreveu: >>> Hi James >>> >>> The testmethod has no parameters and is just a test to check that the >>> method can be called. There is another method that does have >>> parameters and if I >>> pass them, it also fails. >>> >>> Cheers >>> >>> Phil Jackson >>> >>> >>> >>> >>> On 18/03/2014 7:56 a.m., James Loughner wrote: >>>> What is passed to the function? Is it really just a call without >>>> Parameters?? >>>> >>>> Jim >>>> >>>> On 03/17/2014 12:46 AM, Philip G Jackson wrote: >>>>> A customer has given me a Dll for me to use so he can control the >>>>> barcode for printed labels. He has given me a sample program that >>>>> works >>>>> with this DLL and I can recompile the sample program and it still >>>>> works >>>>> but when I try running it from my main application I get the following >>>>> error; >>>>> >>>>> Internal Data Structures Corrupted >>>>> >>>>> dllExecuteCall >>>>> >>>>> >>>>> My code for calling it is as follows; >>>>> >>>>> nDll := DllLoad("S3ConceptPatterns.dll") >>>>> cTemplate1 := DllPrepareCall(nDll, DLL_STDCALL, "TestMethod") >>>>> nRet := DllExecuteCall(cTemplate1) >>>>> >>>>> I also tried the other method >>>>> >>>>> nRet := DllCall(nDll, DLL_STDCALL, "TestMethod") >>>>> >>>>> with identical results (DllCall). >>>>> >>>>> I don't see how the application should make a difference although I >>>>> also >>>>> can have 1-2 additional threads working. >>>>> >>>>> Does anyone have any suggestions as to what I can do next? >>>>> >>>>> Regards >>>>> >>>>> Phil Jackson >>>>> >>>>> >>>>> >>>> >>> >> >> > | |
Itai Ben-Artzi | Re: Problem accessing external C Dll on Sun, 23 Mar 2014 10:44:59 -0700 Phil, From my experience, this error has nothing to do with the specific function generating the error, and the “Internal Data Structures Corrupted” error is derived from the compiler/linker. Try to create another XPJ that does not include all PRGs, and then pbuild the incomplete one followed by the complete project (e.g. pbuild partial; pbuild). The first run would likely result in linker error, but the next run will fix it. Remember to delete all OBJs and then recompile as outlined above. -Itai | |
Pablo Botella | Re: Problem accessing external C Dll on Tue, 25 Mar 2014 09:30:28 +0100 Can you paste the function prototype? probably you will have in a .h file Talk about how to call a DLL function without the prototype is like try to drive with the eyes closed, crash is very probable Regards, Pablo |