C++ .def (definition file) equivilant in VB.net??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,
I've created a COM dll for a number-crunching program. However when I tell
the program what function to use from the DLL, it claims that it cant find
the function.

I have the original .dll code in C++, however I'm not a C++ guy :-(. It
appears that all the functions are declaired in the .def (definition file).
When I compile it, the program reconizes the functions without a problem.

My question is, what is the .def equivilant in VB.net? How do I get my
number-cruncher program to reconize whats available in the .dll??

Thanks in advance,
Jeff
 
My question is, what is the .def equivilant in VB.net?

There is none, you can't export function entry points in VB.NET the
way you can in C++.

How do I get my
number-cruncher program to reconize whats available in the .dll??

You probably need to write a wrapper in C++ for example.


Mattias
 
Thanks for the answer Mattias. A clear-cut Yes/No answer is exactly what I
was looking for!

Do you happen to know the reason for the difference? Are VB Dlls not "real"
dlls comapred with C++?

Again, Thanks

Jeff
 
Jeff,
Do you happen to know the reason for the difference? Are VB Dlls not "real"
dlls comapred with C++?

Yes they are (both use the PE/COFF format), it's just that VB (and
most other languages compiling to managed code) doesn't support this
feature. The only languages I know that do support it are C++ and IL
Assembler.

The reason to support it is mostly to interoperate with existing
native code. In managed code you instead export functionality as
methods in public classes.


Mattias
 
Mattias said:
Yes they are (both use the PE/COFF format), it's just that VB (and
most other languages compiling to managed code) doesn't support this
feature. The only languages I know that do support it are C++ and IL
Assembler.

Just to add to this. There is a serious bug in v1.0 and v1.1 that can
cause the assembly loading to hang if you call a function exported in
such a way this is the mixed mode bug:

http://msdn.microsoft.com/library/d...stechart/html/vcconMixedDLLLoadingProblem.asp

There is a workaround, but it is cumbersome.

http://msdn.microsoft.com/library/d...tsfrompureintermediatelanguagetomixedmode.asp

(this must be the longest named page on that site!)

It is best to avoid doing it altogether.

Richard
 
Back
Top