Board index » delphi » Maybe I am stupid!
Ross Dawson
![]() Delphi Developer |
Sat, 19 Jun 1999 03:00:00 GMT
Maybe I am stupid!QuoteJoshua Cannon Butcher wrote: If I remember my Windows memory management correctly you have got it in one. In order for windows to pass information between DLL's and other applications/DLL's I suspect Windows will do either one of the following a) use registers to pass data or b) if the registers can't contain the data the DLL will establish a Shared memory pool to pass the information back and forth. Soooo in you DLL you are trying to return a TStringList object which in reality is a pointer to a TStringList object which is allocated on the heap which is ...... you guessed it in a data segment accessable only to the DLL. So you application gets the returned pointer to the TStringList and tries to access it and lo and behold a GPF. The upshot of all of this is that without significantly changing Delphi's memory model (very yukky) you cannot pass objects to and from DLL's (I'm sure there are some work arounds but what a kludge). You would be better off to do one of the following. Either go back to the old array method (easy.... :-) ) Hope this helps P.S. and no your not stoopid if ya wanna see stoopid go to a VB news Ross Dawson |