Danny Smith <[EMAIL PROTECTED]> 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/