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 To: Christian Lescher Cc: 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> <4 DOT 3 DOT 1 DOT 2 DOT 20010420122559 DOT 0224b5f0 AT pop DOT ma DOT ultranet DOT com> <3AE07C0B DOT 928C7680 AT lescher DOT de> From: Andrew Markebo Date: 20 Apr 2001 22:36:26 +0200 In-Reply-To: <3AE07C0B.928C7680@lescher.de> Message-ID: Lines: 30 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I would vote for something like you have a function 'dealloc' exported from the dll that has a function that returns the char* in the first place. Have you tried copying the string by hand?? Sort of.. I mean, could it be that the implementation of strdup can't handle strings that are longer than 64k. Which compiler-platform is it on?? What code does what?? Please answer that question first! /Andy / Christian Lescher wrote: | I found that in windowsx.h of cygwin/gcc there are the following functions defined: | | #define GlobalAllocPtr(flags,cb) (GlobalLock(GlobalAlloc((flags),(cb)))) | #define GlobalFreePtr(lp) (GlobalUnlockPtr(lp),(BOOL)GlobalFree(GlobalPtrHandle(lp))) | | May these functions also be used for copying a string? How must they be used? (Maybe this works also for string > 64 KB?!) | Is this also a way for interworking of Borland and Visual? | | Christian | | | 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