473,569 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mixing c++ and vb.net

I have a C++ object with me, and I want to be able to
call its methods from VB.net. I don't know if this is going to make a
difference but I'm using VS .NET 2002.

e.g.
[c++ code]
Foo::Foo
{
}
void Foo::Display_Me ssage()
{
printf("Hello World");
}

[vb code]
Dim myStringInstanc e As New Foo() ''Foo is the C++ object
myStringInstanc e.Display_Messa ge() ''Display_Messa ge prints out "hello
world"

Now what would be the easiest way I can make the above code work? Do
I have to create a COM object? Someone also told me to create a
netmodule, but I don't know how to create a C++ netmodule. And even
if I did know how to create a netmodule, I wouldn't know what to do
afterwards.

I'd really appreciate the help!
Sincerely,

Philip
Jul 21 '05 #1
1 1564
Philip wrote:
I have a C++ object with me, and I want to be able to
call its methods from VB.net. I don't know if this is going to make a
difference but I'm using VS .NET 2002.

e.g.
[c++ code]
Foo::Foo
{
}
void Foo::Display_Me ssage()
{
printf("Hello World");
}

[vb code]
Dim myStringInstanc e As New Foo() ''Foo is the C++ object
myStringInstanc e.Display_Messa ge() ''Display_Messa ge prints out "hello
world"

Now what would be the easiest way I can make the above code work? Do
I have to create a COM object? Someone also told me to create a
netmodule, but I don't know how to create a C++ netmodule. And even
if I did know how to create a netmodule, I wouldn't know what to do
afterwards.

I'd really appreciate the help!
Sincerely,

Philip

You should use Managed C++ class library.

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

--
Jacky Kwok
jacky@alumni_DO T_cuhk_DOT_edu_ DOT_hk
jacky@compose_D OT_com_DOT_hk
Jul 21 '05 #2

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

Similar topics

3
3319
by: bergel | last post by:
Hello, Does anyone already have some experience in mixing AWT and Swing? Is it conceptually doable? Does the design of Swing prevent interaction between an AWT and a Swing widget? Regards, Alexandre
6
4899
by: Russell E. Owen | last post by:
At one time, mixing for x in file and readline was dangerous. For example: for line in file: # read some lines from a file, then break nextline = readline() # bad would not do what a naive user might expect because the file iterator buffered data and readline did not read from that buffer. Hence the call to readline might unexpectedly...
0
1812
by: Erik Max Francis | last post by:
Is there any prohibition against mixing different protocols within the same pickle? I don't see anything about this in the Python Library Reference and, after all, the pickle.dump function takes a protocol argument for each time it's called. (This is in Python 2.3.3.) I have a pickle containing two objects: a tag string and a (large)...
4
23637
by: Rudolf | last post by:
Is it possible to add a vb.net source code module to a c# project and if so how? Thanks Rudolf
1
3404
by: Marc Cromme | last post by:
I would like to ask a question about (good ?) style and possibilities in mixing C FILE* and C++ file streams. The background is that I want to use the C libpng library from within C++, but I would like to open C++ file streams due to easier exception handeling and safe closure of file ressources. Question 1: I open a standard file...
4
1921
by: Cristian Tota | last post by:
Hi, I'd appreciate any thoughts on mixing C++ and C code. I have a project that uses a given C interface, the rest of the project can be either in C or C++. What would be the recomended design pattern in this case? C++ allows for a better design, but integrating the code with the C code isn't straight forward, it becomes rather messy. Code...
2
2415
by: Dan | last post by:
Hi What are the dangers of mixing asp and asp.net? For the .net part of the site i will need to use the global.asax file but for the asp parts it will be using the other global. file, is there anyway to get to both use the same one? For example i want to convert my homepage to aspx first, but in doing so my session var that needs to be...
0
1257
by: dhruba.bandopadhyay | last post by:
I know that it's possible to mix ASP & ASP.NET 1.1 in the same website/application so long as they are in separate frames (iframes). This also holds for mixing ASP & ASP.NET 2.0 pages. But what I haven't tried is mixing ASP.NET 1.1 & ASP.NET 2.0 pages in the same website/application but each page in different iframes. I don't think it's...
28
3055
by: ziman137 | last post by:
Hello all, I have a question and am seeking for some advice. I am currently working to implement an algorithmic library. Because the performance is the most important factor in later applications, I decide to write it in C instead of C++. However, I thought it might be convenient to use some C++ code at some misc places. I'm aware...
3
2090
by: jason | last post by:
I've been working with C# for over a year now without touching vb.net code. I had a few light years of vb.net before that. No real vb6 or windows form experience. Suddenly, I have an assignment where I've been asked to create a few new pages on an exsisting website. The website is written in vb.net with vb.net codebehind and classes. My...
0
7926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
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 project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.