Geeks With Blogs
Saqib Ullah BootStrapper Know How
In my last blog we saw how to create netmodule any code in .net. Today we well see that how we can use it in an application. So for the implementation of the netmodule in my code I would like to show you a little Managed C++ application that easily consumed it.
 
// HelloWorld.h
#using <mscorlib.dll>
#using "CSharpHelloWorld.netmodule"
 
using namespace System;
 
// This code wraps the C# class using Managed C++
public __gc class HelloWorldC
{
public:
      CSharpHelloWorld __gc *t; // Provide .NET interop and garbage collecting to the pointer.
 
      HelloWorldC() {
            t = new CSharpHelloWorld(); // Assign the reference a new instance of the constructor.
      }
 
      void callCSharpHelloWorld() {
            t->displayHelloWorld();
      }
};
 
Note:-
            You get the CSharpHelloWorld class code from my last blog post. Where you also find the command how to create netmodule. For successfully run the above code you need to place the CSharpHelloWorld.netmodule and CSharpHelloWorld.dll in the same folder of Managed C++ application output folder because netmodule always required its respective .dll file for running.
Posted on Tuesday, November 11, 2008 6:38 PM .Net , C++ | Back to top


Comments on this post: How to use .Net Netmodule in C++

# re: How to use .Net Netmodule in C++
Requesting Gravatar...
thank you.
Left by müzik on Jan 02, 2009 7:52 PM

# re: How to use .Net Netmodule in C++
Requesting Gravatar...
Nice stuff
Left by jaaydaad.com on Dec 24, 2010 1:23 AM

# re: How to use .Net Netmodule in C++
Requesting Gravatar...
thanks for sharing.
Left by mermaid bridal gowns on Apr 15, 2011 2:07 AM

# re: How to use .Net Netmodule in C++
Requesting Gravatar...
I don't really know too how to use this .Net Netmodule in C++. But not anymore because I learned it from here. kitchen cabinets in columbus ohio Custom Bathroom Cabinets in Columbus Ohio
Left by andy on Oct 28, 2011 3:23 AM

Your comment:
 (will show your gravatar)


Copyright © Saqib Ullah | Powered by: GeeksWithBlogs.net