Pocket PC Thoughts - Daily News, Views, Rants and Raves

Check out the hottest Windows Mobile devices at our Expansys store!





Go Back   Thoughts Media Forums > POCKET PC THOUGHTS > Pocket PC Developer

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-14-2006, 08:48 AM
Neophyte
Join Date: Feb 2006
Posts: 7
Default Dynamic Toolbar

I am creating a dialog based application. I am dynamically attaching a
toolbar to dialog at the bottom.
The problem which I am facing is that the toolbar is showing at the behind
of the "command bar" instead of displaying it above the command bar.

What should be the problem.

I am using following function call to create toolbar:
CreateEx(m_pMainWnd, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM );



Please help me in solving this problem.
I am using Visual studio 2005 and VC++.



Regards,
Rakesh
 
Reply With Quote
  #2 (permalink)  
Old 02-14-2006, 05:41 PM
Intellectual
Join Date: Dec 2005
Posts: 196
Send a message via AIM to Guest979

This is a guess and may not work, but...

Windows Mobile forms/windows/dialogs can be very fussy, and draw incorrectly, if they do not have a menu-bar object attached to them. I recommend attaching a menu bar to every window you create. You don't have to put any menus or menu items in it, and it will not affect the appearance of the form if you don't. The only potential harm I can think of in doing this, besides the slight inconvenience, is that it may slightly increase the size of the resulting application.
 
Reply With Quote
  #3 (permalink)  
Old 02-15-2006, 08:16 AM
Neophyte
Join Date: Feb 2006
Posts: 7

I am trying to attach a menu bar to a dialog box.

I have written following code but menu is not showing on dialog:

CMenu menu;
menu.LoadMenuW(IDR_MENU1);
bool b=SetMenu(&menu);
DrawMenuBar();

What could be the problem?

Regards,
Rakesh
 
Reply With Quote
  #4 (permalink)  
Old 02-15-2006, 06:13 PM
Intellectual
Join Date: Dec 2005
Posts: 196
Send a message via AIM to Guest979

Well, it's normal for a menu object to be invisible if it doesn't have any menus or menu items.

I'm a little unclear what you mean by a Dialog-based app. I'm mostly experienced with C# .NETcf on PocketPCs, but in that system, the only thing called a "dialog" is the small pop-up error box that isn't especially interactive - although you can take a Form and have it drawn in a "dialog"-style appearance. What do you mean by dialog?
 
Reply With Quote
  #5 (permalink)  
Old 02-16-2006, 11:27 AM
Neophyte
Join Date: Feb 2006
Posts: 7

I am creating a dialog based application for smart device under VC++ section.

I tried to attach menu to dialog but it's not showing.
I also tried to create command bar using comman_create method and attaching menu using command_insertmenu function but nothing is working.

I am using Visual studio 2005 and using pocket PC 2003 SE square Emulator.

I am stuck at this please help me in solving the problem.

Thanks,

Rakesh
 
Reply With Quote
  #6 (permalink)  
Old 02-16-2006, 05:40 PM
Intellectual
Join Date: Dec 2005
Posts: 196
Send a message via AIM to Guest979

Well, like I said, it is normal for a menu bar to have minimal visible appearance if it doesn't have any associated menus or menu items. Are you saying that attaching the menu object doesn't help with the toolbar either?

Since you said the original problem is that the toolbar is appearing in the wrong place, have you tried just altering the dimensions of the dialog itself?

Isn't Visual Studio 2005 VC++ based on .NET? I'm sure it supports .NET, but I'm not sure if that is the only option. Your code doesn't look like normal .NET to me - in fact, with .NET and .NETcf, you can usually just use the graphic designer to draw the features you want rather than creating everything in code, although creating the code does work if you need it (actually, the drawing environment just generates the code for you).
 
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 09:15 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 RC7