Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3AE05CFF.9D92E32F@lescher.de> Date: Fri, 20 Apr 2001 18:00:00 +0200 From: Christian Lescher X-Mailer: Mozilla 4.7 [de] (Win95; I) X-Accept-Language: de MIME-Version: 1.0 To: "Larry Hall (RFK Partners, Inc)" CC: Lescher Christian , "'Andrew Markebo'" , Troy Noble , cygwin AT cygwin DOT com Subject: Re: AW: DLL function with string result? References: <4 DOT 3 DOT 1 DOT 2 DOT 20010420103953 DOT 022a2700 AT pop DOT ma DOT ultranet DOT com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit > Yes, there is a general problem when you want to allocate in one DLL made > by one compiler and de-allocate in another built be another compiler. In > this case, the heaps are different. This is not a Cygwin-specific issue. I see. Would it be possible then to define a second function within the DLL, let's say freeStr(const char* resStr) which releases the memory again? And should Troy Noble's code then work for strings > 64 KB, too? (Currently, I get an access violation, even when not freeing the allocated memory outside the DLL.) char* mallocAndStrCpy (const char* srcStr) { if (srcStr == NULL) return NULL; return strdup(srcStr); } -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple