|
Hi,
Do you want to create a pocket excel file from your application? or you just want to display it ?
Mahesh Varma
|
|
|
|
|
I want to be able to display only.....
Thanks!
|
|
|
|
|
Hi, I'm using EVC++ 3.0 to develop an iPaq using PocketPC 2002 Premium.
I have a problem with my menu on my single dialog application. I have a Menu with two selections on it: 15 Seconds and 30 Seconds.
I want to place a checkmark next to the item the user selects but I want '15 Seconds' to be checked initially. It's not working though.
Here's my OnInitDialog(). (Note: Extranious garbage removed)
BOOL CMyDialogDlg::OnInitDialog()
{
...
// TODO: Add extra initialization here
CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB;
pCommandBar->InsertMenuBar(IDR_CHIPMENU);
// if( pCommandBar->IsDlgButtonChecked( ID_TIMEOUT_15SECONDS ) )
pCommandBar->CheckDlgButton( ID_TIMEOUT_15SECONDS, BST_CHECKED);
...
return TRUE; // return TRUE unless you set the focus to a control
}
The menu is there and works but I can not set a check mark next to any of the items. The IDs are correctly spelled, too. I've set a message up for clicking on '15 Seconds' and it correctly reports the state the label is in (Ie: checked or unchecked). Here:
void CMyDialogDlg::OnTimeout15seconds()
{
CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB;
if( pCommandBar->IsDlgButtonChecked( ID_TIMEOUT_15SECONDS ) )
{
pCommandBar->CheckDlgButton( ID_TIMEOUT_15SECONDS, BST_UNCHECKED);
AfxMessageBox(_T("Unchecked"));
}
else
{
pCommandBar->CheckDlgButton( ID_TIMEOUT_15SECONDS, BST_CHECKED);
AfxMessageBox(_T("Checked"));
}
/**/
}
What am I doing wrong/missing?
Thanks.
|
|
|
|
|
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
|
|
|
|