|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to convert error code to text??For WinSpool.SetPrinter a zero return indicates an error.
SetLastError defaults to True in VB so I can get the errorcode as follows: ErrorCode = Marshal.GetLastWin32Error() The value is 6 but that tells me very little. Where can I find some text to better describe the error?? Thanks >Where can I find some text to better describe the error?? Manually, run "net helpmsg 6" in a console window, or run the VisualC++ error lookup utility (can be installed with VS). Programatically: Dim e As New Win32Exception errmsg = e.Message Mattias -- Mattias Sjögren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. Maybe I'm not doing it correctly
I pasted net helpmsg 6 after the prompt> in the Command Window and hit CR and got: Command "net" is not valid. Thanks Show quoteHide quote "Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message news:Oc%23bicjfFHA.3656@TK2MSFTNGP09.phx.gbl... > >Where can I find some text to better describe the error?? > > Manually, run "net helpmsg 6" in a console window, or run the Visual > C++ error lookup utility (can be installed with VS). > > Programatically: > > Dim e As New Win32Exception > errmsg = e.Message > > > > Mattias > > -- > Mattias Sjögren [MVP] mattias @ mvps.org > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com > Please reply only to the newsgroup. " **Developer**" <REMOVEdevelo***@a-znet.com> schrieb: On my Windows XP Professional SP2 machine:> I pasted net helpmsg 6 after the prompt> in the Command Window and > hit CR and got: > Command "net" is not valid. --- Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\...>net helpmsg 6 Das Handle ist ungültig. C:\...> --- Translated: The handle is invalid. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> I'm probably doing something wrong.
>> I pasted net helpmsg 6 after the prompt> in the Command Window and Is that realy the way to do it?>> hit CR Do I need to install something special? Do I need to find the directory Net is in an give the full path? Thanks Show quoteHide quote > --- > Microsoft Windows XP [Version 5.1.2600] > (C) Copyright 1985-2001 Microsoft Corp. > > C:\...>net helpmsg 6 > > Das Handle ist ungültig. > > > C:\...> > --- > > Translated: The handle is invalid. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> " **Developer**" <REMOVEdevelo***@a-znet.com> schrieb: Mhm... I simply started "cmd" and entered the command. The directory >>> I pasted net helpmsg 6 after the prompt> in the Command Window >>> and hit CR > > Is that realy the way to do it? > Do I need to install something special? > Do I need to find the directory Net is in an give the full path? doesn't matter. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Well I couldn't get it to work so I tried Help and that worked. Got as far
as using immed and >cmd and will probably get net to work eventually - but not yet. No big deal - I used your \\\ Dim s As String = _ (New Win32Exception(Marshal.GetLastWin32Error())).Message /// works great Thanks PS After the > prompt I type net helpmsg 6 and get Command "net" is not valid Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:eMG8E%23ufFHA.2372@TK2MSFTNGP14.phx.gbl... >" **Developer**" <REMOVEdevelo***@a-znet.com> schrieb: >>>> I pasted net helpmsg 6 after the prompt> in the Command Window >>>> and hit CR >> >> Is that realy the way to do it? >> Do I need to install something special? >> Do I need to find the directory Net is in an give the full path? > > Mhm... I simply started "cmd" and entered the command. The directory > doesn't matter. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> " **Developer**" <REMOVEdevelo***@a-znet.com> schrieb: \\\> For WinSpool.SetPrinter a zero return indicates an error. > > SetLastError defaults to True in VB so I can get the errorcode as follows: > > ErrorCode = Marshal.GetLastWin32Error() > > The value is 6 but that tells me very little. > > Where can I find some text to better describe the error?? Dim s As String = _ (New Win32Exception(Marshal.GetLastWin32Error())).Message /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Work perfectly
thanks Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:%23XYI9djfFHA.2424@TK2MSFTNGP09.phx.gbl... >" **Developer**" <REMOVEdevelo***@a-znet.com> schrieb: >> For WinSpool.SetPrinter a zero return indicates an error. >> >> SetLastError defaults to True in VB so I can get the errorcode as >> follows: >> >> ErrorCode = Marshal.GetLastWin32Error() >> >> The value is 6 but that tells me very little. >> >> Where can I find some text to better describe the error?? > > \\\ > Dim s As String = _ > (New Win32Exception(Marshal.GetLastWin32Error())).Message > /// > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/>
Send datagrid via email
Need Help With Translation C#? to VB How to convert this code from C# to VB.NET? How To? import vb net forms ??? Change Value of Existing Element Monitor process creation MessageBox coming up with blank message and blank buttons. how pass data between forms Design Question Open forms |
|||||||||||||||||||||||