Acessing C++ methods from VB .net

P

Philip

Hi, first of all I'm new to this whole .net thing so please forgive my
ignorance. Now I have a C++ object with me, and I want to be able to
call its methods from VB.net.

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

[vb code]
Dim myStringInstance As New Foo() ''Foo is the C++ object
myStringInstance.Display_Message() ''Display_Message prints out "hello
world"

Now what would be the easiest way I can make the above code work? Do
I have to make 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
 
A

Alexandre Moura

I'd say that the easiest way would be to either make your code into Managed C++ or create a C++ Wrapper - creating a COM wrapper might work, but I
wouldn't call it simple :)

Good luck

--------------------
From: (e-mail address removed) (Philip)
Newsgroups: microsoft.public.dotnet.languages.vb
Subject: Acessing C++ methods from VB .net
Date: 15 Nov 2004 14:32:08 -0800
Organization: http://groups.google.com
Lines: 31
Message-ID: <[email protected]>
NNTP-Posting-Host: 206.135.61.179
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1100557929 20872 127.0.0.1 (15 Nov 2004 22:32:09 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Mon, 15 Nov 2004 22:32:09 +0000 (UTC)
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!newsfeed1.ip.tiscali.net!news.glorb.com!postnews.google.com!not-for- mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vb:242734
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi, first of all I'm new to this whole .net thing so please forgive my
ignorance. Now I have a C++ object with me, and I want to be able to
call its methods from VB.net.

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

[vb code]
Dim myStringInstance As New Foo() ''Foo is the C++ object
myStringInstance.Display_Message() ''Display_Message prints out "hello
world"

Now what would be the easiest way I can make the above code work? Do
I have to make 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

Sorry I don't take feature request for WinRes: it belongs to the .NET Framework SDK. I'm a consumer of WinRes, just like you...
--------------------
From: Thomas Adams <[email protected]>
Newsgroups: microsoft.public.dotnet.internationalization
Subject: RE: How to launch WinRes in full screen mode by another program?
Date: 29 Sep 2004 19:31:46 GMT
Organization: DFN.CIS Senior Customer
Lines: 17
Message-ID: <[email protected]>
References: <[email protected]> <[email protected]>
X-Trace: news.uni-berlin.de cGk7xWd2iWxkO9HVbF7isQODBzMeOPRUidb0ZHc/H3nGY=
User-Agent: Xnews/06.08.25
X-Converter: MorVer Version 1.0.305
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu- berlin.de!uni-berlin.de!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.internationalization:947
X-Tomcat-NG: microsoft.public.dotnet.internationalization

Hi

Your assumption is correct. I did not want to call out its long name
since I didn't know if that could be regarded as breach of NDA. :)

Thanks for the explanation. Do you take feature requests for WinRes?
I'd like to see a "remember last size and location" some day...

~T.

(e-mail address removed) (Xu Yang[MSFT]) wrote:

I'm afraid that LocStudio (when you say LS, I assume you are using LocStudio) does not have the option, and WinRes does not remember its size and
location when it was shut down.
If you are trying to call it in your own application, you can always use ProcessWindowStyle.Maximized when you start the process.

--------------------
From: Thomas Adams <[email protected]>
Newsgroups: microsoft.public.dotnet.internationalization
Subject: How to launch WinRes in full screen mode by another program?
Date: 11 Sep 2004 21:26:17 GMT
Organization: DFN.CIS Senior Customer
Lines: 9
Message-ID: <[email protected]>
X-Trace: news.uni-berlin.de 9sj2ViefNkwlw4tmA89WfA6mie8fmrCfbXqlIJqRehUb0=
User-Agent: Xnews/06.08.25
X-Face: #Rk@TOQ|^!ZG|&z6lA@-CY>/xB[Ei1mG*&S.+A5z;Ng?3OxX[#DVZw!"o!c`S|p:(zsX-EkdZZ(IVnFRTX%!:Sv^L&Gk~s]vJ@Z~%Rm@G]fr*r2P}u5 *&k/-_2+&Qowj6hiJ1b$^JQf:uy9456HIdKq*B`NC##kyO,>7"Ztnav+=71b*"E+DIme;{i&)ii{#6e?i8P,1Xpc[q0}i:Tm];B1
X-Converter: MorVer Version 1.0.305
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu- berlin.de!uni-berlin.de!not-for-mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.internationalization:902
X-Tomcat-NG: microsoft.public.dotnet.internationalization

Hi

Let's imagine you're using a translation environment (LS) that's
launching WinRes every now and then. Is it possible to open WinRes in
full screen mode in this case? It's quite annoying that it doesn't
remember if I switch it to full screen mode the next time it is invoked.

thanks,
Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top