<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Avalon with C++/CLI &#8211; what are your options?</title>
	<atom:link href="http://blog.voidnish.com/?feed=rss2&#038;p=121" rel="self" type="application/rss+xml" />
	<link>http://blog.voidnish.com/?p=121</link>
	<description>Nish's thoughts on MFC, C++/CLI and .NET</description>
	<lastBuildDate>Fri, 03 Sep 2010 12:27:45 -0600</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Sabeesh C.S</title>
		<link>http://blog.voidnish.com/?p=121&#038;cpage=1#comment-85575</link>
		<dc:creator>Sabeesh C.S</dc:creator>
		<pubDate>Fri, 11 Apr 2008 08:29:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.voidnish.com/?p=121#comment-85575</guid>
		<description>Hi Nish
I am trying to create a simple application in C++/CLI using WPF,  using Deriving from a class in a C# DLL in VS-2008.  Fro that I create a project in C# and compile it and the output is a .dll file.
The step is like this
File-&gt;new-&gt;Project-&gt;C#-&gt;WPF Custom Control Library
Delete the default .xaml file and add a new one and code is like this,

Window x:Class=&quot;wpflib.basewindow&quot;
    xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
    xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
    Title=&quot;basewindow&quot; Height=&quot;400&quot; Width=&quot;400&quot; ResizeMode=&quot;NoResize&quot;&gt;
    
        
            
            
            Add

        

    


And build the project, and it create a .dll file.

I want to create a new C++/CLI project and give a referance to the first project.  How can I do it?

My second project is like this

Open CLR Empty project
Set SubSystem to /SUBSYSTEM:WINDOWS
Set the entry point to main
Add these referance
	System
PresentationCore
PresentationFramework
WindowsBase
And create a class “AppMainWindow”
Code :

AppMainWindow.h
--------------
#pragma once
using namespace System;
using namespace System::Windows;
using namespace System::Windows::Controls;

ref class AppMainWindow : wpflib::basewindow
{

public:
	AppMainWindow(void);
//	void onAddButtonClick(Object^ sender, RoutedEventArgs^ e);

	void onAddButtonClick(Object^ sender, RoutedEventArgs^ e)
	{
		listbox-&gt;Items-&gt;Add(textbox-&gt;Text);
		textbox-&gt;Text=&quot;&quot;;
		textbox-&gt;Focus();
	}

};

AppMainWindow.cpp
--------------

#include &quot;AppMainWindow.h&quot;

AppMainWindow::AppMainWindow(void)
{
	addbutton-&gt;Click += gcnew RoutedEventHandler( this, &amp;AppMainWindow::onAddButtonClick);
	
}



AppMainWindow.h
---------------
ref class FirstAppDerived : Application
{
//public:
	//FirstAppDerived(void);
protected:
	virtual void OnStartup(StartupEventArgs^ e) override
	{
		Application::OnStartup(e);
		AppMainWindow^ mainwnd = gcnew AppMainWindow();
		mainwnd-&gt;Show();
	}
};

App.cpp
---------
#include &quot;FirstAppDerived.h&quot;

using namespace System;
using namespace System::Windows;
[STAThread]

int main( array^ args)
{
	return ( gcnew FirstAppDerived())-&gt;Run();


}

And successfully build the project. But at runtime it display an error like this

An unhandled exception of type &#039;System.NullReferenceException&#039; occurred in PresentationCore.dll

Additional information: Object reference not set to an instance of an object.


How can I find this error.  Please help me.

Thankyou
Sabeesh</description>
		<content:encoded><![CDATA[<p>Hi Nish<br />
I am trying to create a simple application in C++/CLI using WPF,  using Deriving from a class in a C# DLL in VS-2008.  Fro that I create a project in C# and compile it and the output is a .dll file.<br />
The step is like this<br />
File-&gt;new-&gt;Project-&gt;C#-&gt;WPF Custom Control Library<br />
Delete the default .xaml file and add a new one and code is like this,</p>
<p>Window x:Class=&#8221;wpflib.basewindow&#8221;<br />
    xmlns=&#8221;http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;<br />
    xmlns:x=&#8221;http://schemas.microsoft.com/winfx/2006/xaml&#8221;<br />
    Title=&#8221;basewindow&#8221; Height=&#8221;400&#8243; Width=&#8221;400&#8243; ResizeMode=&#8221;NoResize&#8221;&gt;</p>
<p>            Add</p>
<p>And build the project, and it create a .dll file.</p>
<p>I want to create a new C++/CLI project and give a referance to the first project.  How can I do it?</p>
<p>My second project is like this</p>
<p>Open CLR Empty project<br />
Set SubSystem to /SUBSYSTEM:WINDOWS<br />
Set the entry point to main<br />
Add these referance<br />
	System<br />
PresentationCore<br />
PresentationFramework<br />
WindowsBase<br />
And create a class “AppMainWindow”<br />
Code :</p>
<p>AppMainWindow.h<br />
&#8212;&#8212;&#8212;&#8212;&#8211;<br />
#pragma once<br />
using namespace System;<br />
using namespace System::Windows;<br />
using namespace System::Windows::Controls;</p>
<p>ref class AppMainWindow : wpflib::basewindow<br />
{</p>
<p>public:<br />
	AppMainWindow(void);<br />
//	void onAddButtonClick(Object^ sender, RoutedEventArgs^ e);</p>
<p>	void onAddButtonClick(Object^ sender, RoutedEventArgs^ e)<br />
	{<br />
		listbox-&gt;Items-&gt;Add(textbox-&gt;Text);<br />
		textbox-&gt;Text=&#8221;";<br />
		textbox-&gt;Focus();<br />
	}</p>
<p>};</p>
<p>AppMainWindow.cpp<br />
&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>#include &#8220;AppMainWindow.h&#8221;</p>
<p>AppMainWindow::AppMainWindow(void)<br />
{<br />
	addbutton-&gt;Click += gcnew RoutedEventHandler( this, &amp;AppMainWindow::onAddButtonClick);</p>
<p>}</p>
<p>AppMainWindow.h<br />
&#8212;&#8212;&#8212;&#8212;&#8212;<br />
ref class FirstAppDerived : Application<br />
{<br />
//public:<br />
	//FirstAppDerived(void);<br />
protected:<br />
	virtual void OnStartup(StartupEventArgs^ e) override<br />
	{<br />
		Application::OnStartup(e);<br />
		AppMainWindow^ mainwnd = gcnew AppMainWindow();<br />
		mainwnd-&gt;Show();<br />
	}<br />
};</p>
<p>App.cpp<br />
&#8212;&#8212;&#8212;<br />
#include &#8220;FirstAppDerived.h&#8221;</p>
<p>using namespace System;<br />
using namespace System::Windows;<br />
[STAThread]</p>
<p>int main( array^ args)<br />
{<br />
	return ( gcnew FirstAppDerived())-&gt;Run();</p>
<p>}</p>
<p>And successfully build the project. But at runtime it display an error like this</p>
<p>An unhandled exception of type &#8216;System.NullReferenceException&#8217; occurred in PresentationCore.dll</p>
<p>Additional information: Object reference not set to an instance of an object.</p>
<p>How can I find this error.  Please help me.</p>
<p>Thankyou<br />
Sabeesh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nish</title>
		<link>http://blog.voidnish.com/?p=121&#038;cpage=1#comment-33228</link>
		<dc:creator>Nish</dc:creator>
		<pubDate>Wed, 09 May 2007 12:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.voidnish.com/?p=121#comment-33228</guid>
		<description>Hey John,

Yes, you are right. That stopped working starting with the the RC release :-(</description>
		<content:encoded><![CDATA[<p>Hey John,</p>
<p>Yes, you are right. That stopped working starting with the the RC release <img src='http://blog.voidnish.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john schroedl</title>
		<link>http://blog.voidnish.com/?p=121&#038;cpage=1#comment-33037</link>
		<dc:creator>john schroedl</dc:creator>
		<pubDate>Tue, 08 May 2007 20:02:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.voidnish.com/?p=121#comment-33037</guid>
		<description>Re: my earlier question.  See this post: http://www.bokebb.com/dev/en/2048/posts/204821720.shtml which leads me to ask.  Doesn&#039;t look like it&#039;s supported.

John</description>
		<content:encoded><![CDATA[<p>Re: my earlier question.  See this post: <a href="http://www.bokebb.com/dev/en/2048/posts/204821720.shtml" rel="nofollow">http://www.bokebb.com/dev/en/2048/posts/204821720.shtml</a> which leads me to ask.  Doesn&#8217;t look like it&#8217;s supported.</p>
<p>John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john schroedl</title>
		<link>http://blog.voidnish.com/?p=121&#038;cpage=1#comment-33036</link>
		<dc:creator>john schroedl</dc:creator>
		<pubDate>Tue, 08 May 2007 20:01:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.voidnish.com/?p=121#comment-33036</guid>
		<description>&quot;Put the XAML in C#, derive a class in C++/CLI&quot; does not seem to be an option with production WPF.  Does anyone have a sample doing this?

John</description>
		<content:encoded><![CDATA[<p>&#8220;Put the XAML in C#, derive a class in C++/CLI&#8221; does not seem to be an option with production WPF.  Does anyone have a sample doing this?</p>
<p>John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Judah</title>
		<link>http://blog.voidnish.com/?p=121&#038;cpage=1#comment-12770</link>
		<dc:creator>Judah</dc:creator>
		<pubDate>Thu, 06 Apr 2006 22:55:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.voidnish.com/?p=121#comment-12770</guid>
		<description>I will comment on one thing. C++/CLI is gaining ground at MS. Look at the Phoenix compiler research project (which will be used as the basis for all future compiler technologies at MS). The samples are all in C# and C++/CLI! No VB.NET, ha!</description>
		<content:encoded><![CDATA[<p>I will comment on one thing. C++/CLI is gaining ground at MS. Look at the Phoenix compiler research project (which will be used as the basis for all future compiler technologies at MS). The samples are all in C# and C++/CLI! No VB.NET, ha!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Judah</title>
		<link>http://blog.voidnish.com/?p=121&#038;cpage=1#comment-12769</link>
		<dc:creator>Judah</dc:creator>
		<pubDate>Thu, 06 Apr 2006 22:53:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.voidnish.com/?p=121#comment-12769</guid>
		<description>I don&#039;t think VB.NET takes priority over C#, honestly. Look at the LINQ preview: C# first. Look at Microsoft Research: C# first.

MS developer priorities are, in my utterly foolish opinion:

1. .NET (in specific, C#, then VB.NET, then C++/CLI)
2. native code (in specific, MFC, ATL, then Win32)</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think VB.NET takes priority over C#, honestly. Look at the LINQ preview: C# first. Look at Microsoft Research: C# first.</p>
<p>MS developer priorities are, in my utterly foolish opinion:</p>
<p>1. .NET (in specific, C#, then VB.NET, then C++/CLI)<br />
2. native code (in specific, MFC, ATL, then Win32)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Warren Stevens</title>
		<link>http://blog.voidnish.com/?p=121&#038;cpage=1#comment-12514</link>
		<dc:creator>Warren Stevens</dc:creator>
		<pubDate>Fri, 31 Mar 2006 21:24:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.voidnish.com/?p=121#comment-12514</guid>
		<description>you forgot the last two...

The priorities for MS seem to be as follows:
4: Release first service pack for Visual Studio 2003 (3+ years layer), if time and resources allow it.
5: Put out press release saying Vista will be delayed. Again.  ;-)</description>
		<content:encoded><![CDATA[<p>you forgot the last two&#8230;</p>
<p>The priorities for MS seem to be as follows:<br />
4: Release first service pack for Visual Studio 2003 (3+ years layer), if time and resources allow it.<br />
5: Put out press release saying Vista will be delayed. Again.  <img src='http://blog.voidnish.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Bohring</title>
		<link>http://blog.voidnish.com/?p=121&#038;cpage=1#comment-12509</link>
		<dc:creator>Martin Bohring</dc:creator>
		<pubDate>Fri, 31 Mar 2006 12:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.voidnish.com/?p=121#comment-12509</guid>
		<description>Hello Nish,
for me it shows an ongoing trend at Microsoft. The cool wizzbang stuff gets added and
is supported for C# and VB.NET from the beginning and added to MC++ as an afterthought.

The priorities for MS seem to be as follows:
1: VB.NET
2: c#
3: MC++ if time and resources allow it</description>
		<content:encoded><![CDATA[<p>Hello Nish,<br />
for me it shows an ongoing trend at Microsoft. The cool wizzbang stuff gets added and<br />
is supported for C# and VB.NET from the beginning and added to MC++ as an afterthought.</p>
<p>The priorities for MS seem to be as follows:<br />
1: VB.NET<br />
2: c#<br />
3: MC++ if time and resources allow it</p>
]]></content:encoded>
	</item>
</channel>
</rss>
