471,122 Members | 859 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Importing a VC++ class into a C# program

Hi

I had a couple of questions:

1.)I am trying to invoke member functions of a class which is coded in
VC++ from a UI that is coded in C#. Firstly, if I am not mistaken I
think this can be done only if the exposed classes are managed. I am
totally new to this. So can someone give some pointers or maybe some
URLs to links on how this can be done - that is how to firstly be
able to export the classes and also how to make them managed/write
managed wrappers for the class.

2.)Once the VC++ coding is done, how do I invoke the member functions?
How do I instantiate an object of the VC++ classes in the C# code. It
would be great if someone could post some links to good articles that
deal with this.

Thank you.
Nov 16 '05 #1
1 1340
1) You can't directly expose a native interface to managed code, your only
option is to use "Managed Extentions C++" or VS2005's C++/CLI to wrap a
managed reference class around your native class and populate it with stub
methods that invoke the associated native methods.
2) Invoking the methods is done by simply invoking the stubs.

Willy.
"Rookie" <do***********@rediffmail.com> wrote in message
news:cf**************************@posting.google.c om...
Hi

I had a couple of questions:

1.)I am trying to invoke member functions of a class which is coded in
VC++ from a UI that is coded in C#. Firstly, if I am not mistaken I
think this can be done only if the exposed classes are managed. I am
totally new to this. So can someone give some pointers or maybe some
URLs to links on how this can be done - that is how to firstly be
able to export the classes and also how to make them managed/write
managed wrappers for the class.

2.)Once the VC++ coding is done, how do I invoke the member functions?
How do I instantiate an object of the VC++ classes in the C# code. It
would be great if someone could post some links to good articles that
deal with this.

Thank you.

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Geoff Turner | last post: by
2 posts views Thread by Serengeti | last post: by
reply views Thread by Rookie | last post: by
reply views Thread by Ivan Lam | last post: by
14 posts views Thread by Jeffrey Baker | last post: by
4 posts views Thread by kurt.kurtsmith | last post: by

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.