| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| X-Originating-IP: | [206.16.11.200] |
| From: | "C. J." <dusk47 AT hotmail DOT com> |
| To: | cygwin AT cygwin DOT com |
| Subject: | cygwin_dll_init() crash help? |
| Date: | Tue, 28 May 2002 15:16:48 -0700 |
| Mime-Version: | 1.0 |
| Message-ID: | <F196JorwBpP6m6PUqC50000bc3d@hotmail.com> |
| X-OriginalArrivalTime: | 28 May 2002 22:16:48.0492 (UTC) FILETIME=[5C1A5AC0:01C20695] |
Could someone post some code that loads cygwin1.dll dynamically
successfully? I've checked the mailing archives and people claim to have
done this using cygwin_dll_init(), but all I get is a seg fault.
My goal is just to call cygwin_conv_to_win32_path() from my VC-built
program. Here is what I tried:
--------------
HMODULE hCygwin = LoadLibrary("cygwin1.dll");
if(!hCygwin) {
cerr << "Error: couldn't find cygwin1.dll!\n";
exit(1);
}
CYGWIN_CONV2WIN32PATHFN cygwin_conv_to_win32_path =
(CYGWIN_CONV2WIN32PATHFN)
GetProcAddress(hCygwin,"cygwin_conv_to_win32_path");
if(!cygwin_conv_to_win32_path) {
cerr << "GetProcAddr for cygwin failed!\n";
exit(1);
}
// typedef void (__stdcall *CYGWIN_DLLINITFN)(void);
typedef void (*CYGWIN_DLLINITFN)(void);
CYGWIN_DLLINITFN cygwin_dll_init;
cygwin_dll_init = (CYGWIN_DLLINITFN)
GetProcAddress(hCygwin,"cygwin_dll_init");
if(!cygwin_dll_init) {
cerr << "GetProcAddr for cygwin failed!\n";
exit(1);
}
cygwin_dll_init(); // seg fault
------
Thanks.
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |