[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-dcom
Subject:    Re: Help Needed
From:       Andrew Schetinin <Aschetinin () ENTOPIA ! COM>
Date:       2004-05-05 15:55:37
Message-ID: 06DC40326E25F44682B5FDD89184230392C060 () uranium ! il ! kangaroo ! net
[Download RAW message or body]

 
I do not know if it is true or not, but may be, if both EXE and DLL are
compiled to use the same msvcrt.dll library, they will work with the
same allocation tables. I do not want to try it :-)
 
But both theory and practice discourage allocating memory in one module
and freeing it in another module. It is possible to allocate memory in
DLL and free it using some exported function from this DLL. I'd suggest
getting a pre-allocated buffer from EXE and write the data to it. Or,
for strings, BSTRs with SysAllocString() work not bad.
 
Best Regards,
 
Andrew 

-----Original Message-----
From: Seshu Madabushi [mailto:SMadabushi@ISOFT.COM] 
Sent: Wednesday, May 05, 2004 6:44 PM
To: DCOM@DISCUSS.MICROSOFT.COM
Subject: Re: Help Needed


Another question on the same terms - Exe using a Dll.

I am malloc'ing in the Dll some variables which are passed back to the
exe. My question is can I free the memory allocated in the Dll, in the
exe. At this point, the only solution looks like I have to get the
length of the variable expected from the Dll, malloc it in the exe, then
pass the pointer and copy the values into that pointer.

Is there a better way to do this.

Thanks
Seshu

----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.html
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html . To unsubscribe,
mailto:DCOM-signoff-request@DISCUSS.MICROSOFT.COM

----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.html
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request@DISCUSS.MICROSOFT.COM

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic