By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,670 Members | 1,554 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,670 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Oct 2 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Oct 3 '05 #2

P: n/a
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

"Mattias Sjögren" wrote:
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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Oct 4 '05 #3

P: n/a
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 Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Oct 7 '05 #4

P: n/a
Mattias Sjögren wrote:
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/de...ingProblem.asp

There is a workaround, but it is cumbersome.

http://msdn.microsoft.com/library/de...omixedmode.asp

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

It is best to avoid doing it altogether.

Richard
--
http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm
Oct 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.