Article View: comp.os.ms-windows.programmer.misc
Article #1831Re: Problems calling a DLL function from a VB app. PLEASE HELP!
From: John Grant
Date: Tue, 15 Dec 1992 17:41
Date: Tue, 15 Dec 1992 17:41
33 lines
2013 bytes
2013 bytes
In article <1992Dec15.135809.5339@u.washington.edu> tvp@gibdo.engr.washington.edu writes: > >Okay, I posted a few days ago about not wanting the screen to blank >for the few seconds it took me Shell() out to DOS to run an .exe >utility (written in C) that I was calling from inside my VB app. > >I rewrote the inside of my C source to compile it into a .dll file. >Then I followed the instructions in the VB manuals to declare and call >the function inside the DLL that was replacing the standalone C app I >used to use under DOS. But when I hit F5 to test the VB app, and get >to the part where I push the command button that will cause the DLL >function to be called, it fails and tells me: > > "Function or sub undefined" > >It also highlights the line where the function is called in the >source. This is pretty maddening because the function IS defined >right there in the Declarations section of the form. And it's defined >correctly as far as I can tell too, it's of the proper type, with no >mispellings in the Function name or the Lib path. Does anyone know >what's up and how I can fix it? I'M STUCK! > >Thanks in advance to anyone who can help me. There are 2 possibilities that I can think of: 1. you forgot to 'export' the function 2. you compiled in C++ mode without the "extern C" declaration and C++ mangled the function name Both of these concepts should be well documented in your C++ docs. -- John A. Grant jagrant@emr1.emr.ca Airborne Geophysics Geological Survey of Canada, Ottawa
Technical Details
Message-ID:
<1992Dec15.174101.14343@emr1.emr.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!emr1!jagrantReferences:
<1992Dec15.135809.5339@u.washington.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!emr1!jagrant From: jagrant@emr1.emr.ca (John Grant) Subject: Re: Problems calling a DLL function from a VB app. PLEASE HELP! Message-ID: <1992Dec15.174101.14343@emr1.emr.ca> Organization: Energy, Mines, and Resources, Ottawa References: <1992Dec15.135809.5339@u.washington.edu> Date: Tue, 15 Dec 1992 17:41:01 GMT Lines: 33