Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <002701c4d88f$3e12d100$0200a8c0@mindcooler> From: =?iso-8859-1?Q?Mikael_=C5sberg?= To: References: <000a01c4d883$eb5024f0$0200a8c0 AT mindcooler> <20041202153745 DOT GA29883 AT trixie DOT casa DOT cgf DOT cx> <001901c4d887$c873bfb0$0200a8c0 AT mindcooler> Subject: Re: MSVC-dll under cygwin Date: Thu, 2 Dec 2004 17:51:59 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit > > > >> On Thu, Dec 02, 2004 at 04:30:56PM +0100, Mikael ?sberg wrote: >>>Hello, I was under the impression that using a Cygwin-compiled DLL >>>under MSVC was extremely difficult, if not impossible, but using a >>>MSVC-compiled DLL with programs compiled under Cygwin is possible? I >>>have test program that first calls LoadLibrary() and then for each >>>function in the DLL it wants to call I call GetProcAddress(). However, >>>when I try to call any function the program segfaults (the function >>>pointers are not NULL). The same test program works if compiled using >>>MSVC. Am I mistaken that this should work or is there an error >>>somewhere? >> >> Since cygwin itself uses all sorts of non-cygwin dlls, it is a safe >> assumption that it must be able to use non-cygwin dlls. >> >> However, if you are using stdio from msvcrt, you may run into problems. >> >> cgf >> > > Thanks for the quick reply. I may have found the problem (will test > later). In one of the functions, a parameter was declared to be const > but it was declared as non-const in the definition. Seems like a mistake > that can cause all sorts of weird problems. > > / Mikael > > Okay, now I have tested the code and something is still not right. The DLL contains functions for working with the Windows registry and my problem is that if I call, for example, the function create_registry_key(), the string parameter denoting the name of the key is garbled if called from a program compiled under Cygwin. The exact signature of that DLL-function is: HKEY create_registry_key(const HKEY parent_key, const std::string& name); This doesn't happen if I test the DLL with a program compiled under MSVC. Any idea what might be wrong? / Mikael -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/