|
|
i tried to open some images in my app, but they don't like the way they should. I opened them with pocketIE, but they still look the same. (this all happened on the emulator, because my ipaq is broken, but i think it will be the same on the device)
i think it is because pocketIE tries to resize them but this doesn't work.
it is a grey and white jpg sized 393 x 202 Pixels. PocketIE kind of shrinks it to square-size and then duplicates the image. very strange. what can i do?
thx, Daniel
|
|
|
|
|
I am trying to close a MFC-EVC++-Application from a modeless Dialog that was created as a child window of the MainFrame. I tried it with:
::SendMessage(this->GetParent()->m_hWnd, WM_CLOSE, 0, 0);
but this does not exactly do what I want.
Most of the time, it closes all open windows (i.e. the modeless dialog and the MainFrame), but the Aplication with the modeless dialog still remains in the "running programs"-list (settings->memory).
In some occasions however, it completely closes the application.
I think, something is not working correctly in my code....
thx, Daniel
|
|
|
|
|
Maybe this is due to the interaction of the modeless dialog and its parent. Try this: when pressing the button to close the frame, close the dialog and post a WM_CLOSE message to the frame:
GetParent()->PostMessage(WM_CLOSE);
Regards,
João Paulo
|
|
|
|
|
but that's quite the same than my previous code.
it still leads to problems
thx, Daniel
|
|
|
|
|
I would have to see more code to help you.
Regards,
João Paulo
|
|
|
|
|
thx for the help-
the problem seems to be somewhere else. it also doesn't work if i try to do it the other way round, i.e. to close the dialog from the mainFrame. to e more detailed, it works in some cases, but most of the times after i worked a little bit in the dialog, my app crashes when trying to close both. probably, somewhere in my dialog i did not free memory or something like that...
here's some of my code anyway:
I have a PPC app that start and shows a modeless dialog:
Code:
//in MainFrame.h:
CComPortDlg* m_pDlg;
//in MainFrame.cpp:
CMainFrame::CMainFrame(){
m_pDlg = new CComPortDlg;
}
//when clicking menu-entry "End":
if(this->m_pDlg->m_hWnd != NULL){
this->m_pDlg->ShowWindow(SW_HIDE);
this->m_pDlg->DestroyWindow(); //close dialog
//the destroyWindow() usually take VERY long and makes the whole PDA crash...
}
SendMessage(WM_CLOSE,0,0); //close mainframe
//in Destructor:
CMainFrame::~CMainFrame(){
delete m_pDlg;
}
is this the right way to deal with modeless dialogs?
thx, Daniel
|
|
|
|
|
Hi there...
Im in way to develop a Pocket PC application which places a window in the taskbar. After placed a shortcut in the \windows\autostart folder the application is running each time the device starts up. But after starting the device the Password and the User Information Dialog appering...my application in the taskbar also ... How can i determine if these dialogs are closed before my application is placing her (;)) window in the taskbar?
Any ideas or experience in this kind of problem?
Thanks for reading
|
|
|
|
|
what's the best way in ecv3 to show a html-file that was read from the local file system??
my plan was to use sHtmlView (a class based on htmlview, that provices setHtml(CString) to show stuff.
I wanted to use CreateFile and ReadFile to open the file and give the buffer (that was filled by ReadFile) to setHtml.
MyProblem: ReadFile requires a char[X]-buffer that has to have a constant size. But of course I don't know the HTML-file's size...
thx, Daniel
|
|
|
|
|
slomoman wrote:
But of course I don't know the HTML-file's size...
Use GetFileSize() ...
Regards,
João Paulo
|
|
|
|
|
but a char array still needs a CONSTANT size, not a variable size, right?
Or is there another way when passing the parameter to readFile...?
I'm quite new to Strings in C++.....
thx, Daniel
|
|
|
|
|
slomoman wrote:
but a char array still needs a CONSTANT size, not a variable size, right?
Sure, but you should not allocate it statically. Use the value that GetFileSize() returns to create a dynamic char array using new or other memory allocation mechanism you find more convenient. It should be something like this:
TCHAR *pBuffer;
DWORD dwSize = GetFileSize(hFile);
pBuffer = new TCHAR[dwSize];
if(pBuffer)
{
delete [] pBuffer;
}
else
{
}
TCHAR is the UNICODE equivalent of char .
Regards,
João Paulo
|
|
|
|
|
I wrote an MFC app (PPC2002), but I can't close it. When I click (x) in the upper right corner, the window disappeards, but my app is this there in the task-manager.
I think PocketPC wan't it like that because the same happens with pocketword and all the other apps. but for developing and debugging, i don't like that.
Is there a way I can really close my app?
thx, Daniel
|
|
|
|
|
|
ok, i found out more on that:
Normally, I can close my app (ppc2002, evc3) and restart without problem. however, if I call the following line more than three times, i cannot close anymore and the PPC crashes when i try to close.(soft-reset).
void CSTHtmlDialog::SetHtml(CString* strHtml){
::SendMessage(m_hwndHtml, DTM_ADDTEXTW, FALSE, (LPARAM) (LPCTSTR)*strHtml);
m_hwndHtml is a CDialog that uses htmlview.dll and <htmlctrl.h>.
What can i do? i'm going crazy
thx, Daniel
|
|
|
|
|
slomoman wrote:
m_hwndHtml is a CDialog
Is it a CDialog or the child HTML Viewer control?
Regards,
João Paulo
|
|
|
|
|
actually, it is a CSTHtmlDialog from http://www.codeproject.com/ce/sthtmldialog.asp. But that is dereived from CDialog.
thx, Daniel
|
|
|
|
|
Have you tried using CSTHtmlDialog::SetHtml() ?
Regards,
João Paulo
|
|
|
|
|
João Paulo Figueira wrote:
Have you tried using CSTHtmlDialog::SetHtml()?
Yes, that's what i used and that's what caused the problem...
thx, Daniel
|
|
|
|
|
ok, i found out more on this.
my problems seems to have something to do with the html i am showing.
i modified the html and now it seems to work (at least now...).
the reason could be one ore more of the following:
1) links to jpgs were to long. I had some links that were 32 characters long, and that always causes problems after some of those images. now the link (and the filename) is 15 chars long and it seems to work.
2) the character "\" in the path to the image. Now I have all images in the base-directory ("\")
2) German Umlauts in HTML could be a problem. (i replaced ä,ö and ü with ä etc).
3) Maybe the character " (quoatation) within -tags is a problem.
wow, this took me 3 days of work. Probably all because my image-filenames were too long.
and remember, the images and all other html were always shown correctly. I just couldn't close my application after it anymore and i had to soft-reset my PDA in the end.
strange strange strange
thx, Daniel
|
|
|
|
|
I created a Document/View-SDI Application for Pocket PC 2002 a while ago. It works fine and want ot reuse it.
At the beginning the app show the Document, but now I want to show a CDialog class I wrote. How can I show that instead (or on top) of the document.
Further question:
When I show dialogs, the Main-Applications Tool- and Menubar are not shown anymore. Can I show a dialog and use the menubar and toolbar at the same time? How?
thx, Daniel
|
|
|
|
|
I have a ppc application that opens and shows an html-file. it's places in "/programme/bla".
Where do I have to put that file so that the Emulator (evc3) finds that file?
thx, Daniel
|
|
|
|
|
The emulator does not have access to the PC file system. To copy file to and from the emulator, use the Tools / Remote File Viewer menu option.
Regards,
João Paulo
|
|
|
|
|
are all files deleted when i close the emulation program?
why is there so few memory? i can only add 600kb....
thx, Daniel
|
|
|
|
|
slomoman wrote:
are all files deleted when i close the emulation program?
Depends on how you close the emulator. You may ask it to save its state.
slomoman wrote:
why is there so few memory? i can only add 600kb....
Read the readme:
Changing the Memory Configuration of the Emulator
By default, the emulator will start up with about 16MB of RAM available for the device – with approximately 8MB each for Program Memory and Object Store. Generally, this is sufficient and reduces the physical memory requirement on the development machine hosting the emulator. However, if you wish to increase the amount of memory available within the emulator, change the Memory value in this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Tools\Platform Manager\{F384D888-F9AA-11D1-BB9E-00A0C9C9CCEE}\{DE9660AC-85D3-4C63-A6AF-46A3B3B83737}\{F384D894-F9AA-11D1-BB9E-00A0C9C9CCEE}\{67C8D913-F0CF-486A-8CF0-CE7D116225E8}
From 32 to 48 or 64.
This value indicates the total amount of memory available to the emulator for both the Pocket PC 2002 image and the available memory. The image requires between 16 and 24MB depending on the language version of the image (Japanese, Chinese Simplified, and Chinese Traditional images are approximately 24MB) and whether the image includes support for GSM radios.
Regards,
João Paulo
|
|
|
|