Hi,
I'am using visual studio 8 beta2, i think it's missing a lots of things.
One of them is mfc code of MFC.
When i am using CCommandBar, when i compile with emulator. It make
an error like that:
f:beta2\vctools\vc7libsce\ship\arlmfc\src\mfc\barcmd.cpp
how can i get this packet
Thank

error with MFC in visual studio 2005
Troy
Can you explain what you are trying to do please I can't reproduce the compiler errors you mention. Could you give me step-by-step details, for example:
1) Create Smart Device MFC Dialog Project
2) Add a CCommandBar to dialog class
3) etc, etc...
Also, are you attempting to rebuild the MFC DLL I ask because barcmd.cpp is a source file and so changes to it would not be picked up by MFC projects unless you rebuilt the LIB and DLL.
Feel free to email me directly for a quicker reply (ritchieh at ... microsoft.com)
Thanks,
Ritchie
Newbie10
Sorry cos i am a little busy last week.
So we can begin with a very simple program like that.
1) Run Visual Studio 2005, i create a new MFC project for ppc2003 ( Dialog ) whose
name is Test.
2) In solution explorer, open TextDlg.h
Add variable mytest in class TextDlg like public:
...
public:
CCommandBar mytest;
3) Return TextDlg.cpp, in method OnInitDialog() add code like that:
mytest.InsertMenuBar (IDR_MYMENU);
You can make an IDR_MYMENU to test.
4) after that when debuging the program you will see the error in emulator.
Actually i don't think it's a bug in visual studio 2005, i think that i don't know how to use it.
So now i use directly SHCreateMenuBar to create a MenuBar but i met some problem when i want to insert Toolbar with SHCreateMenuBar ( can you show me how to do it )
In the past, with evc++ 4.0, cos i always downcast m_pWndEmptyCB ( a Command bar control in CDialog - i don't see it anymore in source code of vs 2005) to CCeCommandBar. Example like below:
CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB; pCommandBar->LoadToolBar(IDR_MYTOOLBAR); pCommandBar->InsertMenuBar(IDR_MYMENUBAR);
And it works.
And Many thanks for your attention.
npocmu
Thanks.
Deepak Malviya
{
mbi.dwFlags |= SHCMBF_HMENU;
}
IDR_MYMENU SHMENUBAR DISCARDABLE
BEGIN
IDR_MYMENU,
3,// Number of root menu items
I_IMAGENONE, ID_MENU1, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_MENU1, 0, 0,
I_IMAGENONE, ID_MENU2, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_MENU2, 0, 1,
I_IMAGENONE, ID_MENU3, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_MENU3, 0, 2,
END
===================================================
To explain:
The first "3" indicates how many menu buttons there are on the command bar (and therefore how many entries this resource has). This is followed by the 3 entries, each containing:
I_IMAGENONE: This menu's root button isn't an image
ID_MENU1: The unique command ID to fire when pressed (define it in resourceppc.h)
TBSTATE_ENABLED: The button's state
TBSTYLE_DROPDOWN: This button pop's up a menu taken from the IDR_MYMENU "MENU" resource
TBSTYLE_AUTOSIZE: Sized to the string's width
IDS_MENU1: The string resource to use as a label
0: I'm not sure what this is for, sorry!
0: The index of the POPUP element to use from your MENU resource defined in resourceppc.rc
===================================================
Please tell me if this helps unblock your application development or not. You will be able to remove this SHMENUBAR resource when you build using the final public release of Visual Studio 2005. Feel free to email me directly for additional help if this isn't useful (ritchieh@... the obvious domain! :-)
Regards,
Ritchie
--
Visual C++ for Devices Team
Pierre123
stiversj
I think if Microsoft don't want client use C++ instead of Dot.Net. Microsoft
should throw MFC and other C++ in vs 8.
I spent almost one days to try to work with MFC in vs 8 for pocket pc 2003.
It is so stupid.
In the end, i have to return to evc++ to make MFC.
Dot.Net is also greate, but all my source code needs the time of running.
JT
Toni
To use CCommandBar for pocket pc 2003 using visual studio 8.
You have to open barcmd.cpp, go to line 384.
add this line:
mbi.dwFlags = SHCMBF_HMENU;
So you can see the Menu Bar after when you use method,
InsertMenuBar
For expert, i think that you can easy using SHCreateMenuBar
Good Luck.
JT
vitamin
I can hide sip button and menu but the space and blue bitmap remain on top.
Anyone can help
Alexander S. Manenko
Hi,
I knew it.
I sent you a letter so i think you can make a test with it.
Thank you so much.
Farooq Azam
Many thank for your help.
Actually, i also did like you described last two days, but many thank for your detail.
Allow me to explain the params 0 you said that you was not sure what this is for.
0: If i understand exactly it is "string resource ID of tooltip".
Now, i need a popup menu which each item has a bitmap and a string, example like below:
______________________
| Bitmap1 string of bitmap1 |
-----------------------------
| Bitmap2 string of bitmap2 |
------ -----------------------------
|Menu |
But unfortunately in vs 8 i don't know how i have to add in custom resource SHMENUBAR If you have any idea, i am happy to hear that.
Have a good weekend.
Nico M.
C:\Program Files\Microsoft Visual Studio 8\vc\ce\atlmfc\src\mfc\
Obtek
I force to create CCommandBar like below:
mytest.Create(this);
After that i see that
mytest.InsertMenuBar(IDR_MYMENU);
will always reponds false. So we don't have the menubar in emulator
Big_Show
The workaround (resource file changes) worked in beta 2, but now that I'm using the release version I'm still having the same problem AND the workaround doesn't work anymore. Any ideas