|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
VB.NET: Implementing RasGetErrorStringfor most RAS API calls...except for RasGetErrorString. i've seen a C# example, but can't seem to get the right declaration and use in VB.NET. the current attempt is: --- Private Declare Auto Function RasGetErrorString Lib "rasapi32.dll" ( _ ByVal ErrorValue As Integer, _ ByRef ErrorString As String, _ ByVal BufferSize As Integer _ ) As Integer 'And then in a button click somewhere... Dim errstr As String Dim err As Integer = 639 Dim lbuff As Integer = 256 Debug.WriteLine(RasGetErrorString(err, errstr, lbuff)) Debug.WriteLine(errstr) --- the call to RasGetErrorString fails with an unhandled System.ExecutionEngineException - even if i trap it in a Try...Catch block (?). any help would be appreciated... nevermind, i got it (sorry, just impatient i guess :).
Private Declare Auto Function RasGetErrorString Lib "rasapi32.dll" ( _ ByVal uErrorValue As Integer, _ ByVal lpszErrorString As IntPtr, _ ByVal cBufSize As Integer _ ) As Integer
Show quote
Hide quote
"bhc" <bchor***@gmail.com> schrieb: \\\> i'm trying to wrap a RAS library, and i've found pretty solid examples > for most RAS API calls...except for RasGetErrorString. i've seen a C# > example, but can't seem to get the right declaration and use in VB.NET. > the current attempt is: > --- > Private Declare Auto Function RasGetErrorString Lib "rasapi32.dll" > ( _ > ByVal ErrorValue As Integer, _ > ByRef ErrorString As String, _ > ByVal BufferSize As Integer _ > ) As Integer > > 'And then in a button click somewhere... > Dim errstr As String > Dim err As Integer = 639 > Dim lbuff As Integer = 256 > > Debug.WriteLine(RasGetErrorString(err, errstr, lbuff)) > Debug.WriteLine(errstr) > --- > > the call to RasGetErrorString fails with an unhandled > System.ExecutionEngineException - even if i trap it in a Try...Catch > block (?). any help would be appreciated... Private Declare Auto Function RasGetErrorString Lib "rasapi32.dll" ( _ ByVal uErrorValue As Int32, _ ByVal lpszErrorString As String, _ ByVal cBufSize As Int32 _ ) As Int32 /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Opening a MS Word document through a button click
updating control on form2 from form1 2 dimensional array-->1 dimensional array Help with deleting a Row in a database Datagrid - recognizing changes made Get calling function in a function? about example code FTP routines programmed by VB .net SharpDevelop vs M'soft IDE Download a file from a secured Https Server |
|||||||||||||||||||||||