<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>C++</title>
        <link>http://geekswithblogs.net/technetbytes/category/9076.aspx</link>
        <description>C++</description>
        <language>ur-PK</language>
        <copyright>Saqib Ullah</copyright>
        <managingEditor>saqibullah@msn.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>How to use .Net Netmodule in C++</title>
            <link>http://geekswithblogs.net/technetbytes/archive/2008/11/11/126970.aspx</link>
            <description>&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 8.5pt"&gt;&lt;font face="Verdana"&gt;In my &lt;a href="http://geekswithblogs.net/technetbytes/archive/2008/11/06/126836.aspx"&gt;last blog&lt;/a&gt; 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.&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;table style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: #eaeaea; MARGIN: auto auto auto 5.4pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse" cellspacing="0" cellpadding="0" border="1"&gt;
    &lt;tbody&gt;
        &lt;tr style="HEIGHT: 7.15pt"&gt;
            &lt;td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 6in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 7.15pt; BACKGROUND-COLOR: transparent" valign="top" width="576"&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green"&gt;&lt;font face="Courier New"&gt;// HelloWorld.h&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;font face="Courier New"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;#using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; &amp;lt;mscorlib.dll&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;font face="Courier New"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;#using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; "CSharpHelloWorld.netmodule"&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;font face="Courier New"&gt; &lt;/font&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;font face="Courier New"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; &lt;span style="COLOR: blue"&gt;namespace&lt;/span&gt; &lt;span style="COLOR: black"&gt;System&lt;/span&gt;;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;font face="Courier New"&gt; &lt;/font&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green"&gt;&lt;font face="Courier New"&gt;// This code wraps the C# class using Managed C++&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;font face="Courier New"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; &lt;span style="COLOR: blue"&gt;__gc&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: black"&gt;HelloWorldC&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Courier New"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;font face="Courier New"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;:&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Courier New"&gt;      &lt;span style="COLOR: black"&gt;CSharpHelloWorld&lt;/span&gt; &lt;span style="COLOR: blue"&gt;__gc&lt;/span&gt; *&lt;span style="COLOR: black"&gt;t&lt;/span&gt;; &lt;span style="COLOR: green"&gt;// Provide .NET interop and garbage collecting to the pointer.&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;font face="Courier New"&gt; &lt;/font&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Courier New"&gt;      &lt;span style="COLOR: black"&gt;HelloWorldC&lt;/span&gt;() {&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Courier New"&gt;            &lt;span style="COLOR: black"&gt;t&lt;/span&gt; = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: black"&gt;CSharpHelloWorld&lt;/span&gt;(); &lt;span style="COLOR: green"&gt;// Assign the reference a new instance of the constructor.&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Courier New"&gt;      }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;font face="Courier New"&gt; &lt;/font&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Courier New"&gt;      &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; &lt;span style="COLOR: black"&gt;callCSharpHelloWorld&lt;/span&gt;() {&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Courier New"&gt;            &lt;span style="COLOR: black"&gt;t&lt;/span&gt;-&amp;gt;&lt;span style="COLOR: black"&gt;displayHelloWorld&lt;/span&gt;(); &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Courier New"&gt;      }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Courier New"&gt;};&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="FONT-SIZE: 8.5pt"&gt;&lt;font face="Verdana"&gt;Note:- &lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;font face="Verdana"&gt;            &lt;span style="FONT-SIZE: 8.5pt"&gt;You get the CSharpHelloWorld class code from my &lt;a href="http://geekswithblogs.net/technetbytes/archive/2008/11/06/126836.aspx"&gt;last blog&lt;/a&gt; post. Where you also find the command how to create netmodule. For successfully run the above code you need to place the &lt;/span&gt;&lt;/font&gt;&lt;span style="FONT-SIZE: 8.5pt"&gt;&lt;font face="Verdana"&gt;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.&lt;/font&gt; &lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126970"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126970" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/technetbytes/aggbug/126970.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Saqib Ullah</dc:creator>
            <guid>http://geekswithblogs.net/technetbytes/archive/2008/11/11/126970.aspx</guid>
            <pubDate>Wed, 12 Nov 2008 00:38:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/technetbytes/comments/126970.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/technetbytes/archive/2008/11/11/126970.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/technetbytes/comments/commentRss/126970.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/technetbytes/services/trackbacks/126970.aspx</trackback:ping>
        </item>
    </channel>
</rss>