|
Hi all, i'm currently working on a school project and are very new in this.
The code below is something i had modify:
BOOL CCheckBookFile::New()
{
CString strFilter;
CString allFilter;
CString strTitle;
CString OpenFilter;
OpenFilter ="Text File (*.txt)|*.txt|";
OpenFilter += "RTF (*.rtf)|*.rtf|";
OpenFilter += "ASC (*.asc)|*.asc|";
OpenFilter += "Word Document (*.doc)|*.doc|";
OpenFilter += "All Files (*.*)|*.*||";
CFileDialog dlg(FALSE, NULL, TEXT("\\My Documents\\NewFile"), OFN_FILEMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST, OpenFilter, NULL);
strTitle.LoadString(IDS_FILE_NEW);
dlg.m_ofn.lpstrTitle = strTitle;
if (dlg.DoModal() == IDCANCEL)
return FALSE;
if (m_file.m_hFile != (UINT)CFile::hFileNull)
m_file.Close();
if (!m_file.Open(dlg.GetPathName(), CFile::modeCreate | CFile::modeReadWrite | CFile::modeNoTruncate | CFile::typeText ))
{
AfxMessageBox(CString((LPCTSTR)IDS_MESSAGE5));
// Call open again
if (!New())
return FALSE;
else
return TRUE;
}
return TRUE;
}
well, there are 184kb in the save file, and it's in .txt format.
but when i open it, it will show some strange words.
But when i use my program to open it, it seems fine.
Does anyone know how to change it to a readable .txt file?
Thanks
And by the way, i'm using pocket word to open the .txt files that i had saved.
|
|
|
|
|
It sounds to me like you are having a problem converting between unicode and ascii. All strings in wince are unicode (ie 2 bytes per character) whereas strings on a normal pc are ascii (1 byte per character). It looks like your program is writing and reading directly from windows ce strings which means your text file is probably in unicode, and pocket word is probably trying to open them in ascii format.
You can check this out by using a program like ultraedit to view the file and see if it is indeed in unicode or ascii.
Kind Regards
|
|
|
|
|
hi hterry61, thank you for the reply
I'm using Embedded C++ ver3.0 and running on an emulator.
Can i install the "ultraedit" in it?
And if say i want it to save to .txt format, so that it can be open in pocket words, do i have to change it to unicode? If so, how can i change the codings?thank you
|
|
|
|
|
if i want to open the saved file in pocket word, do i have to save it in ascii format in order to view the files?
I can view properly in my program, but got funny wordings when open in pocket words.
thanks
|
|
|
|
|
http://www.ultraedit.com
Put this trial software on your computer, transfer your "text" file to your pc and try to open it. Right click on the file that opened and go to "Hex Edit". This will show you exactly what is happening. My suspicion is that you will be getting 00 xx 00 xx 00 xx. This is because the first byte of every unicode will be 00 as it only requires the second byte for your ascii characters.
What you need to do is get your program writing and reading so that your data is xx xx xx instead.
If your "text" file is already writing as xx xx xx, then it is the reverse problem that you have.
There are plenty of resources on the web to show you how to do this.
for example:
http://www.developer.com/net/net/print.php/3304241
Good Luck!
|
|
|
|
|
Hi all,
I am wondering how to get a CCeSocket working properly from a separate user-interface thread. The trouble I am having is that if I use the CCeSocket::Send(pData, nSize) command in the main thread, I can send things fine, but since it is a blocking call I lose control of my GUI wile it is sending.
I instead call this from a second user-interface thread that I have running in the background, but it ALWAYS stops at 16384 bytes (16K). It is like it is waiting for some message from the server that it never receives. (Coincidentally, the same thing happens if you use CAsyncSocket::Send(pData, nSize) on my CE platform)
My thought is that the CCeSocket Monitoring thread is sending messages to the main thread instead of my second user-interface thread. Any thoughts on how I can fix this?
Thanks
Terry
|
|
|
|
|
1. Try insert Sleep(300) somewhere in the code before you call the function. It usually help.
2. Don't forget to use critical section, multithreaded application is a tricky business.
Cheers,
Yongki C. Andyka
Adisasta
Don't know much < I, don't care much > I, while I am here ... just be happy
|
|
|
|
|
I want to play a flash movie (.swf) in pocket pc for my application using vb .net. Whenever the user click a hyperlink, the application can play flash movie.
I have flash player. But I don't know whether I can call Pocket IE to run the flash player to play the movie.
Could anyone tell me whether it can do or not?
if yes, would you mind tell me how can i do? need any lib or something?
Thanks a lot!!
|
|
|
|
|
Hi,
could anyone please help me, how to pass command line argument to my app?
my code is as follows:
<br />
#include "stdafx.h"<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance,<br />
LPTSTR lpCmdLine,<br />
int nCmdShow)<br />
<br />
{<br />
if (*lpCmdLine == 'test'){<br />
MessageBox(NULL, TEXT("OK"), TEXT("Result"), MB_OK);<br />
}<br />
else {<br />
MessageBox(NULL, TEXT("NotOK"), TEXT("Result"), MB_OK);<br />
}<br />
<br />
return 0;<br />
}<br />
The problem is, that it always goes to "else"...
Thank You
Martin
|
|
|
|
|
Use
if(wcscmp(lpCmdLine, _T("test")) == 0)
for the comparison test.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
Thank You very much.
It is working. )
br
Martin
|
|
|
|
|
As you can imagine, I'm a beginner at programming Pocket PC's, and I need some help.
I want to "draw" the contents of a DATETIMEPICKER, at the Today Screen. I tried the following:
DateTime_SetFormat( GetDlgItem(hDlg,IDC_DATETIMEPICKER1 ), TEXT("dd MM yyyy"));<br />
DateTime_GetSystemtime( GetDlgItem(hDlg,IDC_DATETIMEPICKER1 ),&stDate);<br />
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &stDate, TEXT("dd MM yyyy"), date, 10);<br />
<br />
DrawText(hdc,date,10,&rcClient,DT_CENTER);
But it doesn't work.
I also tried with ExtTextOut, without any success.
I thank you all for taking the time to help me.
-ricardito69-
|
|
|
|
|
Hi,
I want to know how to communicate 700 series hand held intermec pc with 6920 communication server. I've 6920 communication server installed on my desktop pc. But I am pretty confused about client part on my hand held device. I don't know which client software to use.
So if anybody can provide me the exact steps for communication between pocket pc (700 series intermac OS: WinCE) & 6920 norand communication server, then it would be immensely helpful to me...
Thank you..
Dhaval.
|
|
|
|
|
:|I am loading a 4X5 picturebox matrix using a bitmap file template. As each cell in the matrix is being loaded, I append a text string using the DrawString function to complete the cell's image.
The problem is that the DrawString function seems to work only on the desktop and not on the hx4700.
Does any body know how to get around the DrawString to draw a string on a bitmap image at runtime?
This will avoid having to crate separate images for each cell on the matrix.
Thanks for the help!
dynertec.lcr
|
|
|
|
|
Hi,
I run down all the controls in my CDialog using
CWnd *hWnd = GetWindow(GW_CHILD);
anyone knows a way to retrieve the kind of control (I mean: if it's a CButton, CEdit... or even if it's a PUSHBUTTON, COMBOBOX ... and so on..) on my Dialog?
I tried using
CString str;
CRuntimeClass *prt;
prt=hWnd->GetRuntimeClass();
str=prt->m_lpszClassName;
but str always takes the value "CWnd".
I tried putting /GR compiler flag inside Project Options but the compiler complaint... Is there another way to do it? where am I wrong?
[environment: WinCE, pocketpc2003]
|
|
|
|
|
Use GetClassName API function to retrieve the HWND class name.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
Simple question - does anyone know what the block size of the filesystem on a storage card on an MS Smartphone is? Is it even system defined, or is it likely to vary depending on the device or storage card being used?
I'm basically developing a PC app that copies files to a Smartphone using RAPI, but am having problems as the size a file occupies, and its reported size are never the same (due to the block size)
I'm using OpenNETCF.Desktop.Communications for the RAPI work, and have been unable to find any way of either reading the actual free space on the device, or any kind of information about the filesystem.
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Hello all,
This is my 1st post a a member for a few months now.. Love the site...
OK.. I am trying to execute other applications (user has check boxes to select the function) on the PPC via the following:
CreateProcess(@"\windows\fexplore.exe",@"myPathAndExeHere",... other args...);
Note I am utilising:
[DllImport("CoreDll.dll")] to get CreateProcess.
It works really well, except that fexplore process remains running, even though the app I called has finished...
I can't proceed to any other apps I want to call, until fexplore is finished...
SO... what I am thinking I need to do is somehow scan to see if "File Explorer" is running {somehow} and "Stop" that/those process(es)..
Could anyone give me any insights?
Will be <GREATLY> appreciated.
TIA
|
|
|
|
|
(WinCE)
Hi, is there a way to enumerate the controls (or simply get the first, then the next..) of a CDialog?
(please don't answer: "try enumwindows..." and if you do, please tell me if it really works for what I need - I suppose enumwindows is no way what I need)
|
|
|
|
|
sorry, I meant "Figueira"
|
|
|
|
|
The solution is to use GetWindow . I usually use it on its API version. You must first use:
HWND hWndFirstChild = GetWindow(hWndDlg, GW_CHILD);
Next, you iterate all the siblings.
HWND hWndNext = hWndFirstChild;
hWndNext = GetWindow(hWndNext, GW_HWNDNEXT);
You should get a NULL when the enumeration finishes.
The behavior is the same with the MFC versions of the method.
Lvca wrote:
sorry, I meant "Figueira"
Yeah, I understood what you meant on the first post...
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
thank u very much... I'd like to specify this:
my original idea was to find a way to create a subclass for CDialog... what I want all my dialogs to do is to "SetWindowPos" every controls in a certain way. So ... I thought this: i could use a CMyDialog, derived from CDialog (is this possible?) ... where i get with
::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
..the handles of every controls this way:
int myID;
pDC->GetDlgItem(myID);
and I could use these HANDLES anyway I like.. but...
the problem is: is it possible to subclass CDialog?
is this a bad idea... and why?
|
|
|
|
|
WHen i connect my pocket pc to Desktop computer ActiveSync Activates and connects it ty my desktop. How Does it do it??? I want my programm handle the connection and disconnection of pocket.
|
|
|
|
|
What dlls i have to copy to my pocket pc to use MSXML??? And how to register them??? And repeating the question, i made an application on EVC40, but i can't see the menu bar or toobar of my window, seems like it biger, than window of my pocket can show. I tried to make an application with using MSXML on EVC30, but it doesn't compile, it says that problem is in file <msxml.h>, i can't understand...
|
|
|
|
|
Hello,
I am quite new to C++, and I was wondering what template do I choose in Visual C++ .Net 2003 to create a smart device application?
If it is just a regular windows forms application, which includes do I use?
Thanks,
Programmer2k4
My sig:
"The so-called 'Bugs' do not exist, they are merely features hidden by developers with message boxes that say 'An unhandled exception has occurred'." - Programmer2k4
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
I now use my CodeProject Blog!
|
|
|
|
|