473,395 Members | 1,870 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,395 software developers and data experts.

C++/Java function calls from VB.Net

Hi
I have dll from C++ & code in C++. I want to call this functionality from VB. What is the best way

Does .Net has any language/new thing, that can allow to call C++ functions from VB

I also have same code in Java. If I want call functionality from VB, which is better? C++ library(dll) or Java library(jar)

Thank you
Avin Patel
Nov 20 '05 #1
5 2751
* "=?Utf-8?B?QXZpbiBQYXRlbA==?=" <an*******@discussions.microsoft.com> scripsit:
I have dll from C++ & code in C++. I want to call this functionality from VB. What is the best way?

Does .Net has any language/new thing, that can allow to call C++ functions from VB?
You can export the functions from your C DLL and use them with
'DllImportAttribute' or 'Declare' in VB.NET. If it's a C++ class
library, you can use the classes/methods by making it a COM DLL.
I also have same code in Java. If I want call functionality from VB, which is better? C++ library(dll) or Java library(jar).


C++.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Hi
This solution was exist before .Net. But doesn't .Net add any better way of doing this

I have searched & found Mixing Language as .Net solution of this problem? Is it correct
Just add _gc in front of C++ code & I would be able to use this class & member variable in VB, Is it correct

I was thinking VB calls from Java code would be better soultion? As both works without memory problem & standard in build types? Isn't it true

Thank you
Avin Patel
Nov 20 '05 #3
Just interop the assembly ...

add a Reference to it in your project (by browsing for COM components) and
it will automagically wrap it for you. You will be able to call methods from
the code like that.

-- Alex Papadimoulis

"Avin Patel" <an*******@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
Hi,
I have dll from C++ & code in C++. I want to call this functionality from VB. What is the best way?
Does .Net has any language/new thing, that can allow to call C++ functions from VB?
I also have same code in Java. If I want call functionality from VB, which is better? C++ library(dll) or Java library(jar).
Thank you,
Avin Patel

Nov 20 '05 #4
Hi
If I have class defined C++, Can I be able to use it in VB, by COM components, you have mentioned

I have one C++ class, which handles all memory management & I need to pass this class to all function calls. When I am calling any function in VB, still I will have to pass this class. So Will I be able to use C++ class in VB

Also function calls populated complex data structure, which is present in C++ code. Will I be able to get in VB

Thank you
Avin patel
Nov 20 '05 #5
Avin,

Yes -- just look up Com Interop. You will compile your C++ classes, and they
will appear as regular classes in your VB code.

-- Alex Papadimoulis

"Avin Patel" <an*******@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
Hi,
If I have class defined C++, Can I be able to use it in VB, by COM components, you have mentioned.
I have one C++ class, which handles all memory management & I need to pass this class to all function calls. When I am calling any function in VB,
still I will have to pass this class. So Will I be able to use C++ class in
VB.
Also function calls populated complex data structure, which is present in C++ code. Will I be able to get in VB?
Thank you,
Avin patel

Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

73
by: RobertMaas | last post by:
After many years of using LISP, I'm taking a class in Java and finding the two roughly comparable in some ways and very different in other ways. Each has a decent size library of useful utilities...
10
by: Alex Gerdemann | last post by:
Hello, I have spent a bunch of time converting a Java program I wrote to C++ in order to improve performance, and have found that it is not necessarily faster. Specifically, I'm writing a...
6
by: Rhino | last post by:
I'm trying to debug a simple Java UDF written in the DB2General style within Eclipse. I'm getting a java.lang.UnsatisfiedLinkError when I execute the set() method in the UDF. I know that the...
458
by: wellstone9912 | last post by:
Java programmers seem to always be whining about how confusing and overly complex C++ appears to them. I would like to introduce an explanation for this. Is it possible that Java programmers...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
2
by: ramasubramanian.rahul | last post by:
hi i am trying to call some java APIs from c . i use the standatd JNI calls to load the JVM from a c program and call all java functions by using a pointer to the jvm which was returned by the JNI...
0
by: Nova | last post by:
Hi, I created a Java UDF (PARAMETER STYLE JAVA) for DB2 9 Express-C. I finally does what I want it to do. However, after a few hundred calls to the UDF, it fails and raises an SQL error,...
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs....
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

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.