This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: AW: DLL function with string result?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]