This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Can open() from console app, not from dll
- From: Massimiliano Mirra <mmirra at libero dot it>
- To: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- Cc: cygwin at cygwin dot com
- Date: Wed, 02 Apr 2003 01:55:16 +0200
- Subject: Re: Can open() from console app, not from dll
- References: <20030401233049.66728.qmail@web21408.mail.yahoo.com>
Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz> writes:
>> I am able to open a file and write into it from a console application,
>> but the same fails when done from within a function that is stored in
>> a DLL and called from a Visual Basic application.
>
> VB expects stdcall convention.
> Try adding WINAPI to OpenSomething
Hmmm. If I understand correctly, and it's to be written ``int WINAPI
OpenSomething'', it seems that it becomes unable to even call the
function:
``Can't find DLL entry point OpenSomething in foo.dll''
Maybe I should have made it clearer that simply calling DLL functions
is working; it's when they contain an open() that they just crash.
> You will also need to either munge your declaration in VB to match the
> exported name
The name in foo.c is OpenSomething, the name in foo.def if
OpenSomething, the name in the VB source is OpenSomething. Is this
what you mean?
(Sorry if that's a dumb question. I'm totally oblivious of the VB
side here, luckily it's not me working on that.)
Thank you!
Massimiliano
--
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/