AFAIR I read about this in Delphi help: you shouldn't use strings as arguments in functions communicating with dll, unless [something I do not recall]. Try to browse Delphi help on DLLs and strings (Sure hope you still have D7 help files...). The truth is out there.
Cheers Mike Dnia poniedziałek, 14 marca 2005 11:19, Wim Sterns napisał: > Hi, > > In my application I am using a function in an external > DLL > It copies data from a mainframe application screen to > the string buffer > > WD_CopyPSToString : function (Id : Hwnd; Position : > word; var Buffer : shortstring; L: WORD):word; > stdcall; > > It works ok when I use shorstring as type for the > buffer variable. > When I use string as type for the buffer variable I > get an acces violation error. > > I need to copy more then 255 characters so I cannot > use shortstring. > pchar does not work either > when I create a new type : packed array[1..5000] of > char it works ok > > Any other suggestions or explanations ? > > Thanks Wim > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > _______________________________________________ > Delphi mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

