CDLL question.

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
djwaddoups
Posts: 2
Joined: Tue Oct 10, 2017 12:44 pm

CDLL question.

Post by djwaddoups » Tue Jul 20, 2004 10:56 pm

I am trying to use the CDLL function to access a dll developed in Delphi 6 in an R&R report (version9 Xbase) on a Windows XP notebook.____There is a calculated field that has the following expression;__CDLL("BORRetLib","GetCombinedCategory",NEWEELE3->EESYSID+NEWEELE3->PLANCODE+EEELECT->PLYRCODE)__The verify button says it is a valid expression.____The function definition in the dll looks like this:__function GetCombinedCategory(strParms: string): string; StdCall;____The dll works correctly with no errors from a Delphi test program, but when the report runs in the designer it selects records sucessfully but when it goes to export the data it blows up with an error which drops you out of the designer.__(R&R Report Designer, Xbase Edition has encountered a problem and needs to close. We are sorry for the inconvenience.) Then if you click the "Don^t send to Microsoft" button the following message appears.__(report name.RRW - R&R Xbase: rrw.exe - Application Error The instruction at "0x73dd1351" referenced memory at "0x00000004". The memory could not be "read". Click OK to terminate the program.)____Does Anyone have an idea what could cause this?____Also, in the manual "Developing Applications, Xbase Edition" on pg 199 it says;__CDLL() takes three string arguments and returns a string value.__However down a couple of paragraphs on the same page it says; CDLL() expects a boolean return value from the called DLL. These seem contradictory? Do I need to define the function in the called dll differently than shown above?

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: CDLL question.

Post by kfleming » Wed Jul 21, 2004 11:26 am

CDLL() does return a string and does expect the called DLL to return a boolean value. My guess is that your DLL does not have an appropriate exported function and that is why the crash is occuring. We must be getting back something that we do not like.____I do not have any experience in writing DLL^s so I am afraid that I cannot give you any good advice on how to code the DLL so that R&R will be able to access the functions within it.____Maybe some other user might be able to help out here.____Kathleen__R&R Support

djwaddoups
Posts: 2
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: CDLL question.

Post by djwaddoups » Wed Jul 21, 2004 11:36 am

Is there some kind of structure that it^s expecting back that contains both the boolean and the string return values?

Post Reply