|
Well, just so everyone knows...
I got it. Finally. (Stupid MSDN Docs!)
Here's what I did.
After creating my menu and giving appropriate IDs and such... (ID_TIMEOUT_blah, etc)
I created a member var in my dialog class: CMenu* m_menu; //private, of course.
In my OnInitDialog():
CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB;
m_menu = pCommandBar->InsertMenuBar(IDR_CHIPMENU);
m_menu->CheckMenuRadioItem( ID_TIMEOUT_15SECONDS, ID_TIMEOUT_5MINUTES, ID_TIMEOUT_15SECONDS, MF_BYCOMMAND);
Then, I created Message Handlers. In OnTimeout15Seconds, I placed:
//SELECT THE APPROPRIATE MENU ITEM
m_menu->CheckMenuRadioItem( ID_TIMEOUT_15SECONDS, ID_TIMEOUT_5MINUTES, ID_TIMEOUT_15SECONDS, MF_BYCOMMAND);
If you look in the documentation(when you can get it to show every-fn-thing related to CMenu (Initially, MSDN only showed 4 methods. There is about 20)), you'll see what CheckMenuRadioItem does.
InsertMenuBar returns a CMenu*. Given the range of IDs and the one to select, CheckMenuRadioItem Deselects the non-clicked ones and sets a checkmark next to the clicked menu item.
Enjoy!
|
|
|
|
|
Anyone have any experience with a licensing/copy protection system that works with PDA apps? Looking for a recommendation.
|
|
|
|
|
strange things happen....
i wrote a PPC02-C++-MFC app that reads html-files and shows them (including images and links). I used a lib called CSHTMLDialog by Vassili Philippov, which is based on the htmlview-lib.
Every now and them, mostly when i click on a part of the screen where the html is shown, my app just disappears. it seems that it is closed and even with a task-manager (DTSysView), there is nothing left from my app.
I cannot simulate the error, it usually doesn't happen the next time i do the same.
In general, has anybody ever had that kind of problem? what could be the potential reason?
thx for any hints...
thx, Daniel
|
|
|
|
|
I tried to edit data by calling this query:
CString Query = "Update Points SET X = 12 WHERE PointID = 1";
CADORecordset rs(&g_db);
rs.Open(Query,CADORecordset::openQuery);
And I Got nothing changed.
|
|
|
|
|
No, it doesn't work like that. If you look ath the online help you will see that the only DML statements that are accepted are DELETE , INSERT and SELECT .
To achieve what you want, open recordset using something like:
CString Query = "SELECT X FROM Points WHERE PointID=1";
CADORecordset rs(&g_db);
rs.Open(Query,CADORecordset::openQuery);
rs.SetFieldValue(_T("X"), 12);
Regards,
João Paulo
|
|
|
|
|
I am in the process of creating an activex control for PocketPC. I am having problem in getting a focus rectangle when a button in the control gets focus.
Any help?
|
|
|
|
|
The Pocket PC does not show a focus rectangle like you see on the desktop.
Regards,
João Paulo
|
|
|
|
|
If PocketPC doesnot show FocusRect, then is there any way we change the control appearance to show th euser that control has got the focus? Any idea on this ?
|
|
|
|
|
When you click a button, it retains its focused state (unless you change it). This is visually shown as a double border (even if you tab through a series of buttons).
Regards,
João Paulo
|
|
|
|
|
João Paulo Figueira wrote:
When you click a button, it retains its focused state (unless you change it). This is visually shown as a double border (even if you tab through a series of buttons).
Hi,
Thanks for the reply.
But when I create BUTTON control in eVC++ , it does not reflect the border when it is in focus( particularly when I test the ocx in eVB). The objective is to use the button ocx in eVB, so that when the user navigates through keyboard in PocketPC, the focus status is shown.
The following code draws the focus rect when in focus, but the application crashes after the focus is lost.
void CMfcnewCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC *pdc;
CPen* pOldPen;
CRect rcSrcBounds;
RECT rect;
SHORT inflate;
pdc = CDC::FromHandle(lpDrawItemStruct->hDC);
switch (lpDrawItemStruct->itemAction)
{
case ODA_DRAWENTIRE:
case ODA_SELECT:
case ODA_FOCUS:
// Just draw focus rect
pOldPen = (CPen*)pdc->SelectStockObject(BLACK_PEN);
if (lpDrawItemStruct->itemState & ODS_FOCUS)
{
CopyRect((LPRECT)&rect, (LPRECT)&lpDrawItemStruct->rcItem);
inflate = (SHORT)min(3,min(rect.right - rect.left + 1,
rect.bottom - rect.top + 1) / 5);
InflateRect(&rect, -inflate, -inflate);
pdc->DrawFocusRect(&rect);
}
pdc->SelectObject(pOldPen);
break;
}
}
|
|
|
|
|
Why My pocket PC makes new columns with counter???
For example i have the table with columns:
PointID - counter;
X int;
Y int;
and when i copy this database to pocket and get it back to Desktop PC i got this:
Point ID - int;
X -int;
Y -int;
ID1 - counter;
Where is the problem???
|
|
|
|
|
Try using the Pocket Access option on ActiveSync to synchronize your databases.
What is happening is that when you copy the Access file to the Pocket, it will lose all unique indexes and counter fileds. They will become integer fileds with a non-unique index (read the ActiveSync help on this). When you copy it back to the desktop, the conversion mechanism seems to automatically create a unique ID field for the table.
When synchronizing databases through ActiveSync, this problem never happened to me.
Regards,
João Paulo
|
|
|
|
|
How can I create a Installer for my evc-PPC2002-MFC-Program? Most programms come with installers that you start on the desktop and that copy all required filed to the device via ActiveSync.
Are there tools for doing that? Maybe free tools? Or is it include in eVC somewhere? thx..
thx, Daniel
|
|
|
|
|
You install applications on a pocket PC using a two step approach.
First, you have to create a setup cab file. Information for this is available on the SDK help, but you can find a sample here:
QA: How can I install ADOCE 3.1?[^]
Next, you have to copy the cab file to the Pocket PC and execute it. You can do this manually or through ActiveSync's Application Manager. Search the "Registering with Application Manager" item on the SDK help.
Regards,
João Paulo
|
|
|
|
|
you can sync data using wireless or wired options. In either ways you can get connected to the server.
Types of options you can have
1. Wireless
2. Wired - via Modem to internet, or LAN
It works fine with all these options..
|
|
|
|
|
Hi,
Can you please explain more about wireless communication, and how it can be done using .NET compact framework.
Mahesh
|
|
|
|
|
Mahesh,
Look into Bluetooth, as it already supports Active sync over Bluetooth.
And many PDA's like iPAQs come preintalled with bluetooth and Windows CE supports bluetooth API as well that you can use.
|
|
|
|
|
I have some question about CADORecordset.
I've got the code like this:
void CAccessLayer::Repaint()
{
CADORecordset rs(&g_db);
CString Query;
Query = "SELECT * FROM Points WHERE LayerID = "+m_LayerID;
int X;
int Y;
if(rs.Open(Query,CADORecordset::openQuery))
{
rs.MoveFirst();
for(int i = 0; !rs.IsEof(); rs.MoveNext(), ++i)
{
rs.GetFieldValue(_T("X"),X);
rs.GetFieldValue(_T("Y"),Y);
X=(_BitmapWidth*(_rotate*X - _ViewLeft))/_WR;
Y=(_BitmapHeight*(_rotate*Y - _ViewTop))/_HR;
_BitmapCanvas->Ellipse(X-100,Y-100,X+100,Y+100);
}
}
rs.Close();
}
but i use this function very often, and i'd like to place the query in the constructor of the class. And i want to call in the function only this:
void CAccessLayer::Repaint()
{
rs->MoveFirst();
for(int i = 0; !rs->IsEof(); rs->MoveNext(), ++i)
{
rs->GetFieldValue(_T("X"),X);
rs->GetFieldValue(_T("Y"),Y);
X=(_BitmapWidth*(_rotate*X - _ViewLeft))/_WR;
Y=(_BitmapHeight*(_rotate*Y - _ViewTop))/_HR;
_BitmapCanvas->Ellipse(X-100,Y-100,X+100,Y+100);
}
}
And in constructor i have this :
rs = new CADORecordset(&g_db);
CString Query;
Query = "SELECT * FROM Points WHERE LayerID = "+m_LayerID;
rs->Open(Query,CADORecordset::openQuery));
But my programm doesn't work. Is it necessery to have CADORecordset locally???
Thaks.
|
|
|
|
|
Is g_db initialized when the constructor is called?
Regards,
João Paulo
|
|
|
|
|
Hi All,
I have an Inventory application running on the desktop(Developed using C#). I'm planning to write one for PDA( Using C# & .NET Compact Framework). But the issue is that, i want to synchronize data between the destop application and the handheld application.IR communication is not possible, as it is limited for a very short distance.
Can any one throw light on other communication options available( like GPRS, wireless etc..).
Thanks in advance
Mahesh Varma
|
|
|
|
|
How to create a Console Application in eMbedded Visual C++ 3.0 for Pocket PC emulation
Thanks.
|
|
|
|
|
The Pocket PC does not support native console applications. You have download a third party console.
Regards,
João Paulo
|
|
|
|
|
u select WCE application as ur project type!
|
|
|
|
|
Hi
i'm looking for a mime encoder/decoder class for the pocket pc (am using evc++ 3.0)
does anyone have any useful suggestions for a class to use that they know works?
regards
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
I use the File Open dialog from an article on CP, and it works fine when used form my app class.
Weirdness, Part 1 - In our app, we have a listview. One of the contxt menu items needs to call up this dialog box also. However, the dialog box displays, but locks up when called from the listview.
Weirdness, Part 2 - If I put a call to AfxMessageBox in the dialog's OnInitDlg() function, the dialog box works fine after I dismiss the message dialog. If I don't display the message dialog, the dialog box locks up.
Weirdness, Part 3 - The "X" button in the titlebar doesn't work, but the SIP does, and I can dismiss the dialog box by clicking the ENTER key in the SIP.
Anyone have any hints?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|