Hallo liebe Community,
ich habe ein Programm was eine C++ DLL importiert und von dieser Daten empfängt.Das ganze funktioniert auch.Hab leider nur das Problem das wenn ich das Programm außerhalb der IDE ausführe ,nach ein paar Sekunden das Programm abstürzt.(die ersten Aufrufe der DLL gehen noch durch)
Mit folgender Meldung
EDIT :
Exception Code steht für folgendes :
0xC0000005
EXCEPTION_ACCESS_VIOLATION
The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
Mein VB Code :
Bitte helft mir weiter, bin schon am verzweifeln.
ich habe ein Programm was eine C++ DLL importiert und von dieser Daten empfängt.Das ganze funktioniert auch.Hab leider nur das Problem das wenn ich das Programm außerhalb der IDE ausführe ,nach ein paar Sekunden das Programm abstürzt.(die ersten Aufrufe der DLL gehen noch durch)
Mit folgender Meldung
Quellcode
- Problemsignatur:
- Problemereignisname:APPCRASH
- Application Name:WindowsApplication4.exe
- Application Version:1.0.0.0
- Application Timestamp:4ea5264b
- Fault Module Name:unknown
- Fault Module Version:0.0.0.0
- Fault Module Timestamp:00000000
- Exception Code:c0000005
- Exception Offset:00411624
- Betriebsystemversion:6.1.7600.2.0.0.256.1
- Gebietsschema-ID:1031
EDIT :
Exception Code steht für folgendes :
0xC0000005
EXCEPTION_ACCESS_VIOLATION
The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
Mein VB Code :
VB.NET-Quellcode
- Imports System.Runtime.InteropServices
- Imports System.Reflection
- Imports System.IO
- Public Class Form1
- #Region "DLL-IMPORT"
- Declare Function SetKeyboardHook Lib "dskbhook" (ByVal hwnd As Integer, ByVal Callback As Integer, ByVal Adr As CallbackD) As UInteger
- Declare Function SetGlobalParams Lib "dskbhook" (ByVal Repeat As Integer, ByVal Discard As Integer) As UInteger
- Declare Function SetKeyParams& Lib "dskbhook" (ByVal KeyCode&, ByVal SCAE&, ByVal RDC&)
- Declare Function UseSendMessage Lib "dskbhook" (ByVal Send As Integer) As UInteger
- Declare Function SkipInjected& Lib "dskbhook" (ByVal Skip&)
- Declare Function NoLLHook Lib "dskbhook" (ByVal LLHook As Integer) As UInteger
- Declare Function SetStop& Lib "dskbhook" (ByVal Stp&)
- Declare Function HookVB& Lib "dskbhook" (ByVal Hook&)
- Declare Function NoTL& Lib "dskbhook" (ByVal TL&)
- Declare Function IsNT& Lib "dskbhook" ()
- #End Region
- Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- NoLLHook(0)
- UseSendMessage(0)
- SetKeyboardHook(-1, 1, AddressOf Callback)
- SetGlobalParams(0, 1)
- End Sub
- Public Delegate Sub CallbackD(ByVal action As Integer, ByVal state As Integer, ByVal vcode As Integer, ByVal scode As Integer)
- Public Sub Callback(ByVal action As Integer, ByVal state As Integer, ByVal vcode As Integer, ByVal scode As Integer)
- RichTextBox1.AppendText(state.ToString & "!" & vcode.ToString & "!" & scode.ToString)
- End Sub
- End Class
Bitte helft mir weiter, bin schon am verzweifeln.
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von „AlexE“ ()