Wrox Programmer Forums
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 9th, 2005, 02:46 AM
Authorized User
 
Join Date: Jul 2003
Posts: 40
Thanks: 0
Thanked 1 Time in 1 Post
Default Error in mscorlib.dll

I've got the error as "An unhandled exception of type 'System.ExecutionEngineException' occurred in mscorelib.bll" without any description.

I tried to use code as I post below ... did I make something wrong ?
This error occured at the line == >"GVOP = Marshal.PtrToStructure(ptrGVOP, GetType(GETVERSIONOUTPARAMS))" in try block but it throw error immediately .. don't go into catch block..

I've tried to debug some value .. such as 'hDrive', 'ptrGVOP' ... they all got some values..

Any Idea..


   Private Structure GETVERSIONOUTPARAMS
        Dim bVersion As Byte
        Dim bRevision As Byte
        Dim bReserved As Byte
        Dim bIDEDeviceMap As Byte
        Dim fCapabilities As Long
        <VBFixedArray(3)> Dim dwReserved() As Long

        Public Sub Initialize()
            ReDim dwReserved(3)
        End Sub
    End Structure

    Public Declare Function DeviceIoControl Lib "kernel32.dll" _
                            (ByVal hDevice As Int32, _
                            ByVal dwIoControlCode As Int32, _
                            ByVal lpInBuffer As IntPtr, _
                            ByVal nInBufferSize As Int32, _
                            ByRef lpOutBuffer As IntPtr, _
                            ByVal nOutBufferSize As Int32, _
                            ByRef lpBytesReturned As Int32, _
                            ByRef lpOverlapped As OVERLAPPED) As Int32


    Private Function MyFunction(ByVal hDrive As Long) As Boolean

        Dim cbr As Long
        Dim GVOP As GETVERSIONOUTPARAMS = New GETVERSIONOUTPARAMS
        Dim ptrGVOP As IntPtr

        MyFunction = DeviceIoControl(hDrive, _
                                          DFP_GET_VERSION, _
                                           IntPtr.Zero, Marshal.SizeOf(GVOP), _
                                           ptrGVOP, _
                                          Marshal.SizeOf(GVOP), _
                                          cbr, _
                                           Nothing)
        Try
            GVOP = Marshal.PtrToStructure(ptrGVOP, GetType(GETVERSIONOUTPARAMS))
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
    End Function


Thaks in advance








Similar Threads
Thread Thread Starter Forum Replies Last Post
Error adding DLL jayznz VS.NET 2002/2003 3 June 12th, 2008 12:15 PM
dll Error Norberto_Caraballo VB Components 4 August 9th, 2006 12:38 PM
DLL Registry Error Nirmalakrishna VB Components 0 June 19th, 2006 06:10 AM
CLSID error in DLL Mcanic2k Beginning VB 6 2 March 11th, 2004 05:43 AM
Error capture from DLL c3r3al_kill3r Classic ASP Components 0 July 1st, 2003 05:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.