Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

PocketHAL app hangs if any window created before init


PocketHAL app hangs if any window created before init

Postby diProtector » Feb 18, 2006 @ 12:20pm

I've tested PocketHAL (firework sample) application and got an interesting
results: if MessageBox (or any other window) creates BEFORE some
PocketHAL initialization routines - the application hangs.

Here is a piece of code:

Firework::Firework()

: m_buffer1(0),
m_buffer2(0),
m_map1(0),
m_map2(0),
m_blobs(0)
{
MessageBox(NULL, TEXT("Hello World"), TEXT("New Menu: Hello World"), MB_OK);
m_config.m_appName = TEXT("Firework");
m_config.m_orientation = ORIENTATION_NORMAL;
}

Here MessageBox function called before initialization - application
will hang.

But if we place MessageBox calling somewhere in OnInitialize() method
- everything works good. Example:

bool Firework::OnInitialize()
{
if (!Game::OnInitialize())
return false;

MessageBox(NULL, TEXT("Hello World"), TEXT("New Menu: Hello World"), MB_OK);
m_width = GetDisplay()->GetParameters().m_width;
m_height = GetDisplay()->GetParameters().m_height;
...

Can you explain that thing?
diProtector
pm Member
 
Posts: 27
Joined: Dec 15, 2005 @ 10:56am


Postby fast_rx » Feb 21, 2006 @ 2:52am

Could it just be losing focus before the calls to create the window?
User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby diProtector » Feb 21, 2006 @ 7:28am

fast_rx, what did you mean? Could you explain with more details?
diProtector
pm Member
 
Posts: 27
Joined: Dec 15, 2005 @ 10:56am


Postby fast_rx » Feb 22, 2006 @ 1:44am

I was just thinking that maybe it was missing the 'WA_INACTIVE' message in the GameBase::MessageHandler() because of where you were using the popup. If it loses focus and doesn't know - it would probably hang when it hit the gameloop.

It's all speculation, though.

I have used a few popups in my apps, but it's a lot cleaner to use some sort of ingame display - even if it's a bit crude.
User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby diProtector » Feb 22, 2006 @ 7:53am

fast_rx, you think I should send 'WA_INACTIVE' to main window before displaying any other windows? But there is no main window created yet.
diProtector
pm Member
 
Posts: 27
Joined: Dec 15, 2005 @ 10:56am


Postby fast_rx » Feb 22, 2006 @ 1:40pm

I was merely speculating on why it may be a problem...
Don't got sending wm_ events.

I suggested not using the popups at all. Why do you need to use them before init?
User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby diProtector » Feb 22, 2006 @ 5:49pm

Because all apps protected with my product (diProtector) should display nag-window.
diProtector
pm Member
 
Posts: 27
Joined: Dec 15, 2005 @ 10:56am


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron