This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin dll from C# Application
- From: Brian Dessent <brian at dessent dot net>
- To: Stefano Facchetti <s dot facchetti at kline dot it>
- Cc: cygwin at cygwin dot com
- Date: Wed, 23 Jul 2008 10:54:16 -0700
- Subject: Re: Cygwin dll from C# Application
- References: <18616035.post@talk.nabble.com>
- Reply-to: cygwin at cygwin dot com
Stefano Facchetti wrote:
> int MySum(int a, int b)
> {
> HMODULE h = LoadLibrary("cygwin1.dll");
> void (*init)() = (void(*)()) GetProcAddress(h,"cygwin_dll_init");
> init();
>
> return a+b;
> }
That is not sufficient to dynamically load the library. You need to
re-read the part of the FAQ that explains about the scratch area at the
bottom of the stack.
Brian
--
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/