473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
4 2792
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: CoolPint | last post by:
I read that there has to be only one definition of classes, functions, etc. in a project. I just realized I might have broken the rule by defining the exception classes in the header file. But...
63
by: Nick Palmer | last post by:
Hi all, Is there a DB2 equivilant to Oracle's DB Link functionality ? I have two DB2 databases and I need to get access to the tables in one from the other. In Oracle I would just create a DB...
2
by: Jim | last post by:
Is there a way to access a mdb file remotly via MS access? I have a application that I'll need to us access for reporting. and local updating I'd like to keep the mdb file (data file) on a...
19
by: J. J. Farrell | last post by:
After many years of dealing with definition and linkage issues in ways that I know to be safe, I've decided it's time to try to understand this area properly. Consider a header file with the file...
2
by: John E. | last post by:
Some of our developers are using .NET 2005 already and other are using 2003. Since they are not backwards compatible, we were trying to devise a system where we have 2 different project files that...
6
by: Trint Smith | last post by:
This is how I did this sql server 2000 string in vb.net: "FROM TBL_TravelMain WHERE TravelMain_Mlv = '" & MLVTrimString & "'" In C# you can't use the & something &. How do I put this in C#,...
2
by: Paolo | last post by:
I imported a VC++6.0 project into VC++7.1. The conversion operation makes a mess with Preprocessor Definitions, adding a "$(NoInherit)" for each file. For example: I had a DLL project in VC++6.0...
11
by: F. Michael Miller | last post by:
I'd like to copy the listing of a directory (& sub directories) to a text file in vb.net. I'm looking for teh equivilant of the DOS command dir /s > TargetFile.txt. Thanks!
4
by: Jeff | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.