D
David
Hi,
I am using the 'standalone' emulator with WM 5, so that I can connect to
activesynch.
I have a project (C# .NET CF 1) that works perfectly on my WM6 real device
and a colleagues real WM5 device. However, it is crashing on the emulator...
My code is...
Thread splashThread = new Thread(new ThreadStart(StartSplash));
splashThread.Start();
// Pretend that our application is doing a bunch of loading and
// initialization
Thread.Sleep(kMinAmountOfSplashTime_ms / 4);
// Sit and spin while we wait for the minimum timer interval if
// the interval has not already passed
while (sForm.GetUpMilliseconds() < kMinAmountOfSplashTime_ms)
{
Thread.Sleep(kSplashUpdateInterval_ms / 4);
}
What happens is that I get an error that I see, but is then masked by the
splashscreen, but the splash never disappears. At the moment, I have
remarked this code so that I can get it to work, but I would really like it
to work on the emulator.
Alternatively, if this code will never work on the emulator, is there anyway
that I can check if the current device is real or emulated? I could perhaps
skip the splash code...
Any help would be appreciated.
Further code...
static public void StartSplash()
{
// Instance a splash form given the image names
//splash = new SplashForm(kSplashUpdateInterval_ms);
sForm = new splash(kSplashUpdateInterval_ms);
// Run the form
Application.Run(sForm);
}
My splashform has...
int numUpdates = 0;
int timerInterval_ms = 0;
System.Threading.Timer splashTimer = null;
public int GetUpMilliseconds()
{
return numUpdates * timerInterval_ms;
}
protected void Draw(Object state)
{
numUpdates++;
}
public void KillMe(object o, EventArgs e)
{
this.Close();
}
public splash(int timerInterval)
{
timerInterval_ms = timerInterval;
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
this.BackColor = Color.White;
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
private void splash_Load(object sender, System.EventArgs e)
{
// Make the form full screen
this.Text = "";
this.MaximizeBox = false;
this.MinimizeBox = false;
this.ControlBox = false;
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
this.Menu = null;
// Start a timer that will call Draw every 200 ms
System.Threading.TimerCallback splashDelegate = new
System.Threading.TimerCallback(this.Draw);
this.splashTimer = new System.Threading.Timer(splashDelegate, null,
timerInterval_ms, timerInterval_ms);
}
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
I am using the 'standalone' emulator with WM 5, so that I can connect to
activesynch.
I have a project (C# .NET CF 1) that works perfectly on my WM6 real device
and a colleagues real WM5 device. However, it is crashing on the emulator...
My code is...
Thread splashThread = new Thread(new ThreadStart(StartSplash));
splashThread.Start();
// Pretend that our application is doing a bunch of loading and
// initialization
Thread.Sleep(kMinAmountOfSplashTime_ms / 4);
// Sit and spin while we wait for the minimum timer interval if
// the interval has not already passed
while (sForm.GetUpMilliseconds() < kMinAmountOfSplashTime_ms)
{
Thread.Sleep(kSplashUpdateInterval_ms / 4);
}
What happens is that I get an error that I see, but is then masked by the
splashscreen, but the splash never disappears. At the moment, I have
remarked this code so that I can get it to work, but I would really like it
to work on the emulator.
Alternatively, if this code will never work on the emulator, is there anyway
that I can check if the current device is real or emulated? I could perhaps
skip the splash code...
Any help would be appreciated.
Further code...
static public void StartSplash()
{
// Instance a splash form given the image names
//splash = new SplashForm(kSplashUpdateInterval_ms);
sForm = new splash(kSplashUpdateInterval_ms);
// Run the form
Application.Run(sForm);
}
My splashform has...
int numUpdates = 0;
int timerInterval_ms = 0;
System.Threading.Timer splashTimer = null;
public int GetUpMilliseconds()
{
return numUpdates * timerInterval_ms;
}
protected void Draw(Object state)
{
numUpdates++;
}
public void KillMe(object o, EventArgs e)
{
this.Close();
}
public splash(int timerInterval)
{
timerInterval_ms = timerInterval;
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
this.BackColor = Color.White;
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
private void splash_Load(object sender, System.EventArgs e)
{
// Make the form full screen
this.Text = "";
this.MaximizeBox = false;
this.MinimizeBox = false;
this.ControlBox = false;
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
this.Menu = null;
// Start a timer that will call Draw every 200 ms
System.Threading.TimerCallback splashDelegate = new
System.Threading.TimerCallback(this.Draw);
this.splashTimer = new System.Threading.Timer(splashDelegate, null,
timerInterval_ms, timerInterval_ms);
}
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available