From: "C. J." <dusk47@hotmail.com>
To: cygwin@cygwin.com
Subject: cygwin_dll_init() crash help?
Date: Wed, 29 May 2002 01:20:00 -0000 [thread overview]
Message-ID: <F196JorwBpP6m6PUqC50000bc3d@hotmail.com> (raw)
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/
reply other threads:[~2002-05-28 22:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F196JorwBpP6m6PUqC50000bc3d@hotmail.com \
--to=dusk47@hotmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).