C# VS.Net 2003 + .Net CF MessageWindow + DataSet problem!

Hi all,
My device is running under Windows CE .Net 4.2 with a built in barcode scanner. I found a problem over my .Net CF application which developed in C#. I do create a message window in a class like below to getting the value my barcode scanner get when scan key press.

public class myMessageWndMain : MessageWindow
{
frmMain app;
public const int WM_USER = 0x400;
public const int WM_SCAN_DATA = WM_USER+100;
public const int WM_DATA_SCANINIT_START=WM_USER+101;
public const int WM_DATA_SCANINIT_END=WM_USER+102;
public myMessageWndMain(frmMain app)
{
this.app=app;
}

protected override void WndProc(ref Message m)
{
switch(m.Msg)
{
case WM_SCAN_DATA:
app.GetScanData();
break;
}
base.WndProc (ref m);

}
}


In my frmMain_Load, include this
myMessageWndMain msgWnd = new myMessageWndMain(this);
At the first few times when the particular key press, and my scanner get the value, my application still able to step into/proceed into
protected override void WndProc(ref Message m).Butafter a few times i press my insert button(UI) which perform a dataset and also dataset.writexml, my application fail to step into/proceed into protected override void WndProc(ref Message m)when i pressed my scan button. No matter how i tried. My scanner able to get the value, just because my code cant step into protected override void WndProc(ref Message m). If i indent all my dataset and write xml code, it able to step into protected override void WndProc(ref Message m)and call myGetScanData()to capture the scan value, even ten hundred times. I had tried my best to do everything i can, but i cant solve. Is any expert here can help me on this? A thousand thanks for every single reply.
Is it related to any resourcesof object/GC(garbage collector) problem?

[2706 byte] By [Pony] at [2007-12-16]
# 1
Moving this to the NETCF forum so that the right set of people can look at this.
AmitChopra at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 2
Let me see if I understand this right. You have a breakpoint set on the WndProc method, and hitting some hardware key (like your scanner trigger) causes this breakpoint to be hit. But after you initiate a bunch of dataset operations (via another key press event), you do not seem to be hitting the initial scanner trigger breakpoint anymore, correct?

How are you handling the INSERT key input for doing the dataset operation? What does you threading model look like, are you doing all your work on one thread? Is there any UI involved here, and are there any elements on the UI that are being updated from a thread other than the main UI thread?

Thanks.

Nazim at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...