|
Hello Mike
I finally wrote the line in a different way. In this line a function was called, but now I have erased that call and I have writen all that function code following the problematic line, and it works.
Thank you for your help.
|
|
|
|
|
Dear experts,
I cannot seek the DB after mounted and opened the DB, I think it needed to
set the sort order before seek but if I set it, the DB cannot be opened,
what's wrong in my code?
Following is the extract of my code in eVC3.0:
//====================begin====================
HANDLE g_hDB = 0; // Handle to database
CEOID g_oidDB = 0; // Object ID of the database
CEGUID g_guidDB; // Guid for database volume
DWORD dwIndex;
CEPROPVAL propSeek;
// Below is property for the sort order
const CEPROPID BookID = MAKELONG (CEVT_LPWSTR, 1);
// I can mount the .cdb successfully
CeMountDBVol(&g_guidDB, _T("\\test.cdb", OPEN_EXISTING);
// I can open the DB if no sort order
// but error to open if any sort order exist, why?
g_hDB = CeOpenDatabaseEx (&g_guidDB, &g_oidDB, _T("book"),
//BookID, //caused runtime error if use "BookID", so
I only can use the default '0' here:
0,
0, NULL);
//First seek to the start of the database, success for offset value.
//The bookID in the first record should be "00001111"
CeSeekDatabase(g_hDB, CEDB_SEEK_BEGINNING, 0, &dwIndex);
//Seek the record with passed-in parameter
//search value below, just a sample and this record does exist
propSeek.propid = BookID;
propSeek.val.lpwstr = _T("00005555");
//anyway, string value always cannot be seek, only offset success
g_oidDB = CeSeekDatabase(g_hDB, CEDB_SEEK_VALUEGREATER, (DWORD)&propSeek,
&dwIndex);
//then read the record, it done well
CEOID ceoidRec;
DWORD dwBuf;
CEPROPVAL *props = NULL;
unsigned short lProps;
ceoidRec = CeReadRecordPropsEx(hDB, CEDB_ALLOWREALLOC, &lProps, NULL,
(LPBYTE*)&props, &dwBuf, NULL);
//try to display the result
MessageBox (hWnd, props[0].val.lpwstr , _T("Message"), MB_OK);
//======================end====================
What do you think the result?
Right! it's "00001111", that means the first record, haven't seek?
I created the access ".mdb" file with sample records, field is "BookID" with
index that must be unique, from "00001111" to "00009999". And then I copy it
to my iPAQ3970 (I've also try with iPAQ3950 as well as the emulator with same
result), it converted to "test.cdb" (without synchronization).
I have try the VOConnection and VORecordset, it can seek by SQL but very slow
where my real database have 30 thousand records and besides the speed, very
strange that some records in the middle cannot be seek and read, (about the
15000'th to 20000'th records), I don't know whether it's memory problem but
my iPAQ still have very much main memory spaces.
How can I use the sort order and seek my record in API?
Thousand thanks!
Nick.
|
|
|
|
|
Does anyone happen to know either the message(s) that are sent when a theme is change on the ppc or where I can research this information? I am trying to look at msdn and pocketpcdn but am not having much luck.
Thanks,
-Eric
|
|
|
|
|
Ok, I found it.. WM_WININICHANGE is fired when the theme is changed.
-Eric
|
|
|
|
|
VanHlebar wrote:
WM_WININICHANGE is fired when the theme is changed
... and wParam = 0xF2 !
Regards,
João Paulo
|
|
|
|
|
João Paulo Figueira wrote:
... and wParam = 0xF2!
Regards,
João Paulo
That would be correct if I was making the change to the theme and wanted the os to update the screen. What I was looking for was how can my app tell that the os has just changed the today theme, maybe by another application or because the user when into settings->Today and changed it.
WM_WININICHANGE is fired, but it is also fired when the users add/deletes a today module. I have yet to figure out if the message was really sent because the theme was changed or something else.
The definition of the message handler that I found was OnWinIniChange(LPCTSTR lpszSection).
When I have put a break point in this handler lpszSection is always empty. For my purposes it really doesn't matter but it would be nice to not do anything in the function if the user only added a today item and not changed the theme.
-Eric
|
|
|
|
|
João,
I saw your earlier post regarding how to change a theme programatically. I have tried using it, but it doesn't seem to work on my Dell Axim X5 or X3i.
Each time I goto Settings->Today and change the theme manually or when ThemeMaster changes the theme the WM_WININICHANGE message is sent and I can trap that just fine. This may work as a workaround for my purposes, but it would be nicer if I could just change the theme myself.
Is there a different message that is being sent by the framework to tell the os to update the theme? I have searched MSDN and I have come up with nothing. My changes are being recorded in the registry, but the theme is not changing on the screen.
Thanks,
-Eric
|
|
|
|
|
João Paulo Figueira wrote:
VanHlebar wrote:
WM_WININICHANGE is fired when the theme is changed
... and wParam = 0xF2!
Regards,
João Paulo
I sort of got it to work. Why won't it work if there is a space path to the theme? If I have a theme that has a space in its name the code won't work, however if I change the name and remove the space then it works just fine.
-Eric
|
|
|
|
|
VanHlebar wrote:
Why won't it work if there is a space path to the theme?
Try enclosing the path in double quotes.
Regards,
João Paulo
|
|
|
|
|
João Paulo Figueira wrote:
VanHlebar wrote:
Why won't it work if there is a space path to the theme?
Try enclosing the path in double quotes.
Regards,
João Paulo
Here is what I currently have:
<br />
TCHAR* pszFile = _T("\\Windows\\My Theme.tsk");
If I make the filename "MyTheme.tsk" it works just fine. If I say something like "\\Storage Card\\MyTheme.tsk" it also fails.
-Eric
|
|
|
|
|
Try this:
TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\"");
Regards,
João Paulo
|
|
|
|
|
João Paulo Figueira wrote:
Try this:
TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file
Regards,
João Paulo
Worked like a charm!
Thanks,
-Eric
|
|
|
|
|
João Paulo Figueira wrote:
Try this:
TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file
This works great if I am personally entering the information in as a constant into the variable. The problem is that if I read in the path from a text file I can't get it to work.
In my text file I have \Windows\My Theme.tsk
I have also tried put in my text file the above text of "\"\\Windows\\My Theme.tsk\"" and it still won't change the theme.
How can I go about ensuring that the path is formated correctly before I put it into the registry? I have even tried running thru the path and adding the extra "\" characters and the extra '"' characters and it still did not work.
Thanks for the help.
-Eric
|
|
|
|
|
Can you please show me the code that you are using to add the quotes to the string?
Regards,
João Paulo
|
|
|
|
|
João Paulo Figueira wrote:
Can you please show me the code that you are using to add the quotes to the string?
Regards,
João Paulo
Ok,
Again the text in my text file is Today Theme=\My Documents\My Theme.tsk.
If I was going to do this without reading it in from the file I would have to format the string as such:
_T("\"\\My Documents\\My Theme.tsk\"");
Here is the code that I am using to attempt to format the string properly. I am getting the path then converting it to a CString so that I can do some other maniplutions to it.
"str" has the string value of "Today Theme" and tmp has a value of "Today Theme=\My Documents\My Theme.tsk".
I created the file on my desktop using Notepad so I am sure that the file is not Unicode and I wonder if that is having anything to do with this?
<br />
int nCount = str.GetLength() + 1;<br />
int nLineLength = tmp.GetLength();<br />
<br />
tmp1[0] = '\\';<br />
<br />
for(int i = nCount, j = 1; i < nLineLength; i++, j++)<br />
{<br />
if( tmp.GetAt(i) == '\\' )<br />
{<br />
tmp1[j] = '\\';<br />
j++;<br />
}<br />
<br />
tmp1[j] = tmp.GetAt(i);<br />
tmp1[j+1] = '\\';<br />
tmp1[j+2] = NULL;<br />
}<br />
Thanks for any insight you can provide.
-Eric
|
|
|
|
|
VanHlebar wrote:
I created the file on my desktop using Notepad so I am sure that the file is not Unicode and I wonder if that is having anything to do with this?
This is where I would look first. Use the Notepad encoding option on File / Save As... and choose Unicode.
Regards,
João Paulo
|
|
|
|
|
Has anyone successfully used the STUtil class to manage __try __Except handling in their embedded apps? I have installed it and it builds successfully, but if I try the following, my app still hangs:
__try
{
TCHAR *p=NULL;
int x = _tcslen(p);
}
__except(CATCH_COM_ERROR)
{
// handle the error
}
Souldn't the __except handler catch the error and let the app proceed?
|
|
|
|
|
I'm developping programs on wince using evc3.0
I made a new project using WCE ATL COM AppWizard with MFC support.I got no compile errors when i create a simple object.But when i create a full control or lite control,i got compile errors like this:
......error C2504: 'IBindStatusCallback' : base class undefined
......error C2061: syntax error : identifier 'IBinding'
......
the same project under vc6.0 i got no problem.I knew there are many limitations in evc.Does my problem stands for "mfc and atl won't cooperate with each other under wce?"
i have struggled on this problem for one day. i'm too tired now.
But i need to use CInternetSession class(MFC class) in my ATL COM Control(full control) project. Anybody can give me a hand?
Thanks a lot!
|
|
|
|
|
Hi all,
I'm using eVC 3.0. There is a linker error popping up when I try to convert string to BSTR. I can find its declaration under \Embedded Tools 3.0\wce300\Pocket PC 2002\atl\Include\COMUTIL.H. Which library do I have to include to get rid of the same, since COMSUPP.LIB is not supported by eVC 3.0 ?
Regards,
Amit
|
|
|
|
|
My guess is that because ConvertStringToBSTR uses char* instead of TCHAR* , it is not supported under Windows CE. To achieve the same effect, take a look at _bstr_t and CComBSTR .
Regards,
João Paulo
|
|
|
|
|
First this is what I am trying to achieve.
I want a single checkbox and a textbox. If the checkbox is checked (selected) I want the textbox to instantly become invisible or read-only. If the checkbox is un-checked I want the textbox to be visible and writable.
The environment is ASP.NET mobile controls i.e. a browser on a mobile phone, PDA, etc. Ideally I don’t want to postback when the checkbox is selected. I assume I need a SelectionList to create a checkbox but where do I go from there?
Thanks.
John.
|
|
|
|
|
Is it possible to develop mobile application on
Symbian OS for enabling bluetooth Internet bridge via LAN Access
Profile e.g. Point-to-Point Protocol(PPP) over RFCOMM?
Any guideline or Example?
|
|
|
|
|
Hi all,
I am using ADOCE. My requirement is to open a connection to a database (Test.sdf) in the Pocket PC. The problem is _Connection::Open throws an exception "File not found" even though I am giving the right path. My question is, What is the exact format format in which the connection string has to be passed to the _Connection::Open() function ?
Any help would be appreciated.
Regards,
Amit
|
|
|
|
|
From the adoce31.tlh file (generated using the #import directive, we can read the method prototype as:
HRESULT Open (
_bstr_t ConnectionString,
_bstr_t UserID,
_bstr_t Password,
long Options );
All parameters are optional. The ConnectionString parameter states the connection string(that can be optionally set via PutConnectionString ) has a very specific format. For "Pocket Access" databases, use Data Source=\\FolderName\\DbName.cdb . Top open SQL CE databases, use:
_Connection::PutProvider(_T("Microsoft.SQLSERVER.OLEDB.CE.2.0"));
_Connection::Open(_T("Data Source=\\FolderName\\DbName.cdb"));
You can optionally do everything in one step:
Open(_T("Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\\FolderName\\DbName.cdb"));
Regards,
João Paulo
|
|
|
|
|
Hi,
I am giving the connection string as "Data Source = history.sdf" but still the same problem persists. Could this be because this format is only applicable for *.cdb file and not *.sdf ? I am having Test.sdf on my pocket PC as the query analyzer gave only one option (SDF) while creating the database.
Many thanks for your reply.
Regards,
Amit
|
|
|
|