From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20582 invoked by alias); 14 Feb 2011 04:03:49 -0000 Received: (qmail 20571 invoked by uid 22791); 14 Feb 2011 04:03:47 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MSGID_FROM_MTA_HEADER X-Spam-Check-By: sourceware.org Received: from omx11.ms.so-net.ne.jp (HELO omx11.ms.so-net.ne.jp) (202.238.83.191) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Feb 2011 04:03:41 +0000 Received: from inspiron.cuvie.serveftp.com (pa8c956.szoknt01.ap.so-net.ne.jp [182.168.201.86]) by omx11.ms.so-net.ne.jp with ESMTP id p1E43cc8002240 for ; Mon, 14 Feb 2011 13:03:38 +0900 (JST) Message-Id: <201102140403.p1E43cc8002240@omx11.ms.so-net.ne.jp> Received: from jp.sony.com (gatekeeper52.sony.co.jp [211.125.138.167]) by inspiron.cuvie.serveftp.com (Postfix) with ESMTP id B120E121436 for ; Mon, 14 Feb 2011 13:03:37 +0900 (JST) X-DKIM: Sendmail DKIM Filter v2.8.3 inspiron.cuvie.serveftp.com B120E121436 Date: Mon, 14 Feb 2011 04:03:00 -0000 From: "Y.Hosoi" To: cygwin@cygwin.com Subject: Re[2]: I want to use DLL compiled with Cygwin with VC(VS2008). In-Reply-To: <20110212025813.GA20293@ednor.casa.cgf.cx> References: <201102120245.p1C2juUX029959@omx12.ms.so-net.ne.jp> <20110212025813.GA20293@ednor.casa.cgf.cx> X-bkComposeTime: 00:07:28 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-02/txt/msg00344.txt.bz2 Thank you. However, it did not move well. If test.dll is done in LoadLibrary, Access Violation is generated. Are you still amused something? [main source code] #include "stdafx.h" #include "windows.h" #ifdef __cplusplus extern "C"{ #endif typedef int (*TFUNC)(void); typedef void (*Tinit)(void); int _tmain(int argc, _TCHAR* argv[]) { int i; HINSTANCE h; HINSTANCE hInstDLL; Tinit init; TFUNC DllFunction; DWORD ErrNo; h = LoadLibrary( TEXT( "cygwin1.dll" ) ); init = (Tinit)GetProcAddress( h, "cygwin_dll_init" ); init(); hInstDLL = LoadLibrary( TEXT( "test.dll" ) ); /* !Access Violation! */ if( hInstDLL == NULL ) { ErrNo = GetLastError(); return 0; } DllFunction = (TFUNC)GetProcAddress( hInstDLL, "hello" ); i = DllFunction(); FreeLibrary( hInstDLL ); FreeLibrary( h ); return 0; } #ifdef __cplusplus } #endif -- Y.Hosoi -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple