Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
GeneralRe: Opening A Form using Reflection Pin
Dave Kreskowiak14-Apr-05 6:00
mveDave Kreskowiak14-Apr-05 6:00 
GeneralRe: Opening A Form using Reflection Pin
afinnell15-Apr-05 13:41
afinnell15-Apr-05 13:41 
GeneralDateTimePicker Problem Pin
drey114-Apr-05 4:14
drey114-Apr-05 4:14 
Generalwin32 dll & c# Pin
felopater14-Apr-05 3:58
felopater14-Apr-05 3:58 
GeneralRe: win32 dll & c# Pin
Dave Kreskowiak14-Apr-05 5:01
mveDave Kreskowiak14-Apr-05 5:01 
GeneralRe: win32 dll & c# Pin
felopater14-Apr-05 9:33
felopater14-Apr-05 9:33 
GeneralSystran Web Translator Pin
Dot Net14-Apr-05 3:27
Dot Net14-Apr-05 3:27 
GeneralError 998 on Windows API Call Pin
TyronX14-Apr-05 3:10
TyronX14-Apr-05 3:10 
The TrackMouseEvent function fails and returns zero.
So I called (as msdn advised me) GetLastError() to get the error msg and it returns 998 which means:
ERROR_NOACCESS Invalid access to memory location.

Has anyone a clue what my OS is trying to tell me here?
I guess the error is caused by the c++ struct which the function takes as parameter.
( TRACKMOUSEEVENT Struct on MSDN )


<br />
[DllImport("kernel32.dll", SetLastError=true)]<br />
static extern int GetLastError ();<br />
<br />
[DllImport("user32")]<br />
public static extern bool TrackMouseEvent(TRACKMOUSEEVENT lpEventTrack);<br />
<br />
[StructLayout( LayoutKind.Sequential,CharSet=CharSet.Ansi)]<br />
    public struct TRACKMOUSEEVENT {<br />
        public long cbSize;<br />
        public long dwFlags;<br />
        public long hwndTrack;<br />
        public long dwHoverTime;<br />
    }<br />
<br />
<br />
and in the C# App Constructor:<br />
<br />
TRACKMOUSEEVENT foo = new TRACKMOUSEEVENT();<br />
foo.cbSize = Marshal.SizeOf(typeof(TRACKMOUSEEVENT));<br />
foo.dwFlags = TME_NONCLIENT;<br />
foo.hwndTrack = (long)this.Handle;<br />
bool bar = TrackMouseEvent(foo);<br />
MessageBox.Show(""+GetLastError());

GeneralRe: Error 998 on Windows API Call Pin
Dave Kreskowiak14-Apr-05 4:54
mveDave Kreskowiak14-Apr-05 4:54 
GeneralRe: Error 998 on Windows API Call Pin
TyronX14-Apr-05 9:48
TyronX14-Apr-05 9:48 
GeneralC# Datarelation questions Pin
elapid14-Apr-05 3:05
elapid14-Apr-05 3:05 
Question&quot;printer select&quot; common dialog? Pin
User-37793614-Apr-05 2:54
User-37793614-Apr-05 2:54 
QuestionHow to get GlobaHook Keyboard DeviceID? Pin
Jeltz114-Apr-05 2:23
Jeltz114-Apr-05 2:23 
GeneralError 1706 in VS.net 2003 Pin
.NET Professional14-Apr-05 1:40
.NET Professional14-Apr-05 1:40 
GeneralRe: Error 1706 in VS.net 2003 Pin
turbochimp14-Apr-05 2:41
turbochimp14-Apr-05 2:41 
GeneralRe: Error 1706 in VS.net 2003 Pin
.NET Professional15-Apr-05 2:39
.NET Professional15-Apr-05 2:39 
GeneralDirectShow Capture Application Pin
14-Apr-05 1:05
suss14-Apr-05 1:05 
GeneralHelp Files Pin
Anonymous14-Apr-05 0:52
Anonymous14-Apr-05 0:52 
GeneralRe: Help Files Pin
Ashok Dhamija14-Apr-05 1:03
Ashok Dhamija14-Apr-05 1:03 
GeneralRe: Help Files Pin
Anonymous14-Apr-05 1:37
Anonymous14-Apr-05 1:37 
GeneralRe: Help Files Pin
Ashok Dhamija15-Apr-05 0:29
Ashok Dhamija15-Apr-05 0:29 
QuestionIs it possible to use ASP.NET in Windows.Forms application? Pin
Anonymous13-Apr-05 22:40
Anonymous13-Apr-05 22:40 
AnswerRe: Is it possible to use ASP.NET in Windows.Forms application? Pin
Dave Kreskowiak14-Apr-05 4:35
mveDave Kreskowiak14-Apr-05 4:35 
GeneralRe: Is it possible to use ASP.NET in Windows.Forms application? Pin
Anonymous14-Apr-05 7:44
Anonymous14-Apr-05 7:44 
GeneralProblems with Change Language Pin
AbuseByUnkindPeople13-Apr-05 20:32
AbuseByUnkindPeople13-Apr-05 20:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.