problem with displaying lastError

Joined
Dec 14, 2006
Messages
3
Reaction score
0
I am trying to get the lastwin32Error and display the details of that error in compact framework.
this is the code I am using


int lastError = Marshal.GetLastWin32Error();
Win32Exception myEx=new Win32Exception(lastError);
MessageBox.Show(myEx.Message);


But always it gives the Message as "Win32Exception". it doesn't give the real message
corresponding to the nativeError code
for example if I use 5(""Access is Denied") instead of lastError then it is given the "Win32Exception" not the "Access is denied" as the Message.
Always it gives "Win32Exception" as the Message


This code is working fine in .NET framework. But it is not working in .Net compact framework


How I get the real error message in compact framework?

Thanks in Advance
Mahesh Kumara
 
Back
Top