Yes, I am now thanks, I just tried Getmem for the Pdouble parameters, and it works now. Still having some problems with the "LPSTR psGridFile" parameter, this may not be being passed correctly as the function fails with an error relating to the psGridFile not being right.
Ta, Dave. -----Original Message----- From: Corey Murtagh [mailto:[EMAIL PROTECTED] Sent: Monday, 5 April 2004 9:17 a.m. To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] Problem using a dll. David O'Brien wrote: > Haven't done much of this before. I am trying to use a dll with a > function definition of: > > Long _stdcall TransGeogPt(LPSTR psGridFile, long lDirection, double > dLatitude, double dLongitude, double* pdLatNew, double* pdLongNew, > double* pdLatAcc, double* pdLongAcc) > > I have translated this as: > > function(psGridFile: PChar; lDirection: Integer; dLatitude, > dLongitude: Double; pdLatNew, pdLongNew, pdLatAcc, pdLongAcc: > PDouble): Integer; > > However trying to use this function I get: > > Access violation at address 77C43B4C in module 'MSVCRT.DLL'. Read of > address 00000000'. > > Any ideas? Have I translated wrong? The interface translation looks right, so long as a Double is an 8-byte floating point. Are you sure you're supplying all the right values for the pointers you're sending in to that? Allocating the buffers and so on? -- Corey Murtagh The Electric Monk "Quidquid latine dictum sit, altum viditur!" _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
