Click here to Skip to main content

VS 2012/2013 & .NET 4.5.1

 
GeneralRe: WInRT component and event grief PinmemberSuper Lloyd12-Dec-12 23:45 
GeneralRe: WInRT component and event grief PinmemberSuper Lloyd14-Dec-12 20:09 
GeneralRe: WInRT component and event grief PinprotectorPete O'Hanlon14-Dec-12 22:50 
GeneralRe: WInRT component and event grief PinmemberSuper Lloyd15-Dec-12 1:57 
GeneralRe: WInRT component and event grief PinprotectorPete O'Hanlon15-Dec-12 10:34 
GeneralRe: WInRT component and event grief PinmemberSuper Lloyd15-Dec-12 18:26 
GeneralRe: WInRT component and event grief PinmemberSuper Lloyd15-Dec-12 18:30 
QuestionWinRT: C++ C# interop grief PinmemberSuper Lloyd5-Dec-12 4:37 
I created a simple WinRT C++ class to help having meaningful exception, it looks like that
 
	public enum class ErrorCodes
	{
		CodeStart = 0x0200, CodeEnd = CodeStart + 100, NotErrorCode = CodeEnd - 1,
		StupideError1 = CodeStart + 1,
		StupideError2 = CodeStart + 2,
	};
 
	public ref class Class1 sealed
	{
	private:
		Class1() {}
 
	public:
		static void Throw(ErrorCodes c);
		static ErrorCodes GetCode(Platform::Exception^ ex);
	};
However, when I try to use it in C#, with code like that
 
			try
			{
				Class1.Throw(ErrorCodes.StupideError1);
			}
			catch (Exception ex)
			{
				var c = Class1.GetCode(ex);
			}
 
I got the following compiler error in my C# project:
 
2>C:\Dev\W8\App1\App1\App.xaml.cs(42,5,42,8): error CS0012: The type 'Platform.Exception' is defined in an assembly that is not referenced. You must add a reference to assembly 'platform, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.
2>C:\Dev\W8\App1\App1\App.xaml.cs(42,13,42,31): error CS1502: The best overloaded method match for 'CppComp.Class1.GetCode(Platform.Exception)' has some invalid arguments
2>C:\Dev\W8\App1\App1\App.xaml.cs(42,28,42,30): error CS1503: Argument 1: cannot convert from 'System.Exception' to 'Platform.Exception'
 

How could I fix that?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.

AnswerRe: WinRT: C++ C# interop grief PinmemberSuper Lloyd5-Dec-12 5:20 
GeneralRe: WinRT: C++ C# interop grief PinmemberFrankLavigne3-Jan-13 5:14 
QuestionHow to throw a usable error from a WinRT C++ component to a C# code PinmemberSuper Lloyd5-Dec-12 3:59 
AnswerRe: How to throw a usable error from a WinRT C++ component to a C# code PinmemberSuper Lloyd5-Dec-12 4:22 
Questionstill no lambdas debugging ? :( Pinmemberpip01021-Nov-12 22:16 
QuestionIntelliTrace only in Ultimate edition for VS11? Pinmemberdevvvy5-Nov-12 22:41 
AnswerRe: IntelliTrace only in Ultimate edition for VS11? PinprotectorPete O'Hanlon5-Nov-12 23:00 
GeneralRe: IntelliTrace only in Ultimate edition for VS11? Pinmemberdevvvy6-Nov-12 16:52 
GeneralRe: IntelliTrace only in Ultimate edition for VS11? PinprotectorPete O'Hanlon6-Nov-12 20:25 
GeneralRe: IntelliTrace only in Ultimate edition for VS11? Pinmemberdevvvy6-Nov-12 20:43 
NewsWindows XP & Framework 4.5 [modified] PinmemberClifford Nelson26-Oct-12 15:19 
GeneralRe: Windows XP & Framework 4.5 PinmemberRichard Deeming29-Oct-12 2:13 
GeneralRe: Windows XP & Framework 4.5 PinmemberClifford Nelson29-Oct-12 5:16 
GeneralRe: Windows XP & Framework 4.5 Pinmemberpip01021-Nov-12 22:17 
GeneralRe: Windows XP & Framework 4.5 PinmemberClifford Nelson22-Nov-12 9:49 
GeneralRe: Windows XP & Framework 4.5 PinprotectorPete O'Hanlon22-Nov-12 10:38 
GeneralRe: Windows XP & Framework 4.5 PinmemberClifford Nelson22-Nov-12 11:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.141022.2 | Last Updated 24 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid