Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
To: Christian Lescher <christian@lescher.de>
Cc: cygwin@cygwin.com
Subject: Re: AW: DLL function with string result?
References: <4.3.1.2.20010420103953.022a2700@pop.ma.ultranet.com>
	<4.3.1.2.20010420122559.0224b5f0@pop.ma.ultranet.com>
	<3AE07C0B.928C7680@lescher.de>
From: Andrew Markebo <flognat@flognat.myip.org>
Date: 20 Apr 2001 22:36:26 +0200
In-Reply-To: <3AE07C0B.928C7680@lescher.de>
Message-ID: <m3g0f3qpf9.fsf@master.athome>
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 <christian@lescher.de> 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

