Forums

VB Application Interface for C33

Started by josemvarona April 11, 2005

All,

After getting my FIR to work, I am now trying to develop a VB
interface using the dsk3dll provide with the DSK software tools. I
have created the application, but cannot get the functions within the
dll to run. I keep getting a "entry not found for function_name in
dll". Do I need to create a VB resource file with all the dll function
definitions? Any help would be appreciated. Thanks.

Jose


Hello Jose

You will need to extract the function prototypes and convert them to be
VB compatible.

I googled around and found the following sites interesting. It appears
there are two methods for calling functions in C, __stdcall and
__cdecl. Basically one method has the calling function performing stack
cleanup, while the other is assuming the function will do the cleanup
before returning. The bottom line is that __cdecl is important for
variable length argument passing like in printf()... so guess which one
is the default! To change this, go to project window, and right click
the project. In settings, look for the C/C++ tab, then 'Code
Generation'. If you go into TYPEDEFS.H you will also see where DLLEXTEND
has been defined. However, a problem occurs for some functions because
of how micosoft defined __declspec(). If you override here, you will
need to hand modify a number of functions that return pointers.

http://www.codeproject.com/dll/dll_calling.asp
http://www.codeproject.com/dll/XDllPt3.asp

Note: I tried changing the __stdcall switch mentioned, but got an error
with the 'signal()' math error catcher. I did not investigte further,
but I (and maybe some others) would be interested in hearing what you find.

Something else to watch for will be name mangling. Basically the
compiler modifies the name of a function to include information about
the calling and return values. This in turn allows the linker to
quickly check prototypes since the name itself now conveys information
about the prototype (a simple string compare and the linker is done). I
dont know what the switch is, but Im certain there is one.

Hope this helps
Keith
josemvarona wrote:

>
> All,
>
> After getting my FIR to work, I am now trying to develop a VB
> interface using the dsk3dll provide with the DSK software tools. I
> have created the application, but cannot get the functions within the
> dll to run. I keep getting a "entry not found for function_name in
> dll". Do I need to create a VB resource file with all the dll function
> definitions? Any help would be appreciated. Thanks.
>
> Jose