|
It was a long process of looking into partial clues. I found one clue in the registry key HKEY_CLASSES_ROOT\tdyskin\Shell\Open\Command . Then I found an answer to a similar question in a newsgroup saying that you need to broadcast a message after setting the skin (by Vassili Phillipov). Suddenly, something flashed in my mind and voilá!
This approach has a problem, though. If you have an installed CF card with an actionable Autorun.exe, your wallpaper will not be correctly set. I'm looking into this issue.
|
|
|
|
|
Wow ... Another great detective work ...
YOu should work for the police .
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Daniel S. wrote:
YOu should work for the police
Nah... They have to work with all sorts of nasty issues and terrible people. I'd rather investigate these harmless issues and share them with all of you bright CPians.
Thanks for your compliment!
João Paulo
|
|
|
|
|
New post. Check it out! The bug is corrected.
|
|
|
|
|
I found a bug in the code I posted before. When you change from the Bliss theme to any other one, you will get a painting error on the Today screen. This is because the code I posted did not delete the UseStartImage value. You have to delete it before sending the broadcast message to the desktop. Here is the revised code:
PROCESS_INFORMATION pi;
CString strCmdLine(_T("/safe /noui /nouninstall /delete 0 ")),
strFile;
HKEY hKey;
LONG lRet;
m_edtFile.GetWindowText(strFile);
strCmdLine += strFile;
lRet = RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Today"), 0, 0,
&hKey);
if(ERROR_SUCCESS == lRet)
{
RegDeleteValue(hKey, _T("UseStartImage"));
if(::CreateProcess(_T("\\Windows\\wceload.exe"),
strCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, NULL, &pi))
{
::WaitForSingleObject(pi.hProcess, INFINITE);
RegSetValueEx(hKey, _T("Skin"), 0, REG_SZ, (BYTE*)(LPCTSTR)strFile,
sizeof(TCHAR) * (strFile.GetLength() + 1));
RegCloseKey(hKey);
::SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
}
}
As before, strFile contains the full path skin file name.
|
|
|
|
|
Thanks!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hi!
I`m relative new to Embedded Visual C++ and Basic. I have good experience with Visual Studio C++.
What i want to do is to make an Automation Server in C++ so i can expose methods to Visual Basic by
using Createobject() from the Visual Basic side.
I have made an Automation Server in Visual C++ by using MFC and a ODL file, it was pretty easy because
much of the code was generated with the AppWizard. With Embedded Visual C++ its not that easy if you
are making an exe file, but with DLL it works fine because there the odl is generated.
Anyway, i made an Automation Server, compiled just fine, but when testing it with Visual Basic it doesn`t find the activeX object. So i guess my Automation Server didn`t get registered in the windows register on the PocketPC, the type ID should be correct.
I hope someone knows how to make an Automation Server in Embedded Visual C++ :=)
Hope someone will answer.
|
|
|
|
|
I am currently working with MS embedded Visual c++ 3.0 and using its Pocket pc 2002 emulator for debugging. The matter is that I have to download many files to the emulator (one by one) for running my application (not only the program and dll files that are automatically downloaded). After shuting down the emulator or rebooting my desktop computer, the emulator's memory is lost, so I have to repeat the process.
I was wondering if there's any option or tool that make possible to backup the emulator's memory state and reload it when neccesary.
Thank you!
|
|
|
|
|
Jose M Castellanos wrote:
I was wondering if there's any option or tool that make possible to backup the emulator's memory state and reload it when neccesary.
The easiest approach is when you shut down the emulator, tell it to keep its state (there's a combo for that purpose).
|
|
|
|
|
I have an MFC application that I need to maintain both for Windows and Windows CE (all the various flavors of both Pocket PC and HPCPro). I wrote it for the PC first using VC++ 6.0. I need to port it to CE (I'm using eVC++ 3.0 for that) but I don't want to have to maintain two sets of code.
I've written for CE before so I know I'll have to deal with unicode, function parameter differences, etc. I figure I can just #ifdef the differences that can't be solved generically.
But I'm having problems with the resource files. I don't want to have to rebuild all the dialogs and controlls on the CE side....and also the resource ID numbering would then be out of sync. So, I've heard that the resource file format is compatible between VC++6 and eVC++3 so I copied the resource files(s) to the CE project, but am getting resource compile errors like:
error RC2111 : invalid control type,
error RC2113 : END expected in dialog, and
error RC2135 : file not found: 1002.
What project files and resources are shareable between the two projects? Has anyone done something like this before?
majoob
|
|
|
|
|
OK, I pretty much have it figured out, and am currently sharing code and resource files between a CE eVC++3.0 project and a PC VC++6.0 project. It is slick...everything is in the same project directory. The resource file errors I was getting was from context-sensitive help incompatibility. Post a reply if you are interested in the details of how I did this.
|
|
|
|
|
I want to do the following with my user interface in my application:
1. Split my application into 2 parts. (I use CSplitterWnd::CreateStatic)
2. The Upperpart is a "global" tool bar which is always accessable.
3. The Lowerpart is a property sheet. (I use CPropertyShee::DoModal)
4.When click into one of the icon of the toolbar, it will switch to another property page (of course, the old sheet should not be destroyed).
It is possible for PocketPC 2002?
I try thousand of solutions, however, they fail.
The main problem is:
Is it impossible for PPC 2002 or am I doing wrong idea? (i.e. as beginners' always ask for)
I only can see similar user interface on BlueTooth Manager in iPAQ 5450 or the Backlight Setting on Pocket PC 2002.
Please suggest ideas on how to setup for such user interface. Or how to do the similar task in another way?
|
|
|
|
|
I have created a MFC dialog appliaction and want to show the SIP (software keyboard) automaticly at startup.
I have tried to put the SipShowIM(SIPF_ON); in the OnInitDialog() message function, but the SIP will only popup for a short time and then the SIP will be hidden.
How can I show the SIP at application startup?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
You can use SHSipPreference(m_hWnd, SIP_UP); on your OnInitDialog handler. Use SHSipPreference(m_hWnd, SIP_DOWN); on exiting the dialog.
|
|
|
|
|
Thanks ! It works fine!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Can someone explain why I get a Datatype Misalignment error message when I use the ::GetDiskFreeSpaceEx function? I am getting the correct data returned but when I try to save any of the values to a variable I get this error. I've tried delcaring the variable as ULONGLONG or __ui64, but nothing works.
What datatype should the variable be? and should I save the LowPart or QuadPart? I wont ever see more than 2GB of memory space. Does anyone have an example for eMbedded VC++?
Paul Jahans
|
|
|
|
|
Hi, did a quick check on my system and it works fine. Since you didn't post any code, I have no idea why you got a datatype misalignment.
TCHAR buff[200];
ULARGE_INTEGER lFreeCaller, lTotBytes , lTotFreeBytes ;
::GetDiskFreeSpaceEx (NULL, &lFreeCaller, &lTotBytes, &lTotFreeBytes);
swprintf(buff, _T("%u mb free for caller, %u total mbytes, %u total free mbytes"),
lFreeCaller.QuadPart >> 20 , lTotBytes.QuadPart >> 20, lTotFreeBytes.QuadPart>> 20 );
MessageBox(0, buff, _T("Info"), 0);
unsigned __int64 test1 = lFreeCaller.QuadPart;
unsigned __int64 test2 = lTotBytes.QuadPart;
unsigned __int64 test3 = lTotFreeBytes.QuadPart;
int mb1 = (test1 >> 20);
int mb2 = (test2 >> 20);
int mb3 = (test3 >> 20);
swprintf(buff, _T("%u mb free for caller, %u total mbytes, %u total free mbytes"), mb1, mb2, mb3);
MessageBox(0, buff, _T("Info"), 0);
Not sure why the first messagebox reports 0 MB and the second shows 15 MB for Total number of bytes, but Im sure you can investigate that further if you're interested in that value.
HTH
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
Hi
Here's what i'm trying;
I have a DLL from which I have exported a set of classes. I have 2 generic classes; say CCat and CCats (Simple Classes).
In CCats class i have a pointer to an object of the CCat class (CCat *m_pCatsCollection). CCats is supposed to maintain a collection of classes. So in the "Initialize" member function of CCats class i dynamically allocate memory in this fashion;
m_pCatsCollection = new CCat[10] // to store 10 cats.
Now, in the destructor of the CCats class i'm freeing the memory in this fashion;
if(m_pCatsCollection) {
delete []m_pCatsCollection; m_pCatsCollection = NULL;
}
I'm using this DLL to populate contols in a MFC exe!
If I put this in the destructor its crashing, and it unpredictable, i.e. sometimes it crashes sometimes it hangs, sometimes it works fine. I even tried freeing individual CCat object memory in a for loop it does not work. I even had a Release member function to do this, but that also doesnt work.
Am i doing something wrong, i dont know why this is happenning. Is there any problem in allocating and freeing memory in a Class exported in a DLL.
If I comment out the above code of delete then everything works fine, but i know i'm not freeing memory.
I also tried using the STL "list" template class to do this, using list::push_back to insert objects and list::clear to delete all objects but still its not working, i'm just not able to free memory in the destructor of the CCats Class.
Pls Help!
Anand
Anand Vinod
|
|
|
|
|
Anand Vinod wrote:
I'm using this DLL to populate contols in a MFC exe
Did you create this DLL as an MFC extension DLL? I never experienced such a thing, but all my DLLs are created as MFC extensions...
|
|
|
|
|
Hi João,
Thanks for the reply. I've not made my Dll an MFC extension DLL since i'm not using any MFC classes in the dll. But shud this cause a problem.
Anand
|
|
|
|
|
Hi Anand,
Looking at your code, I could see nothing wrong. I have written code for DLLs where such allocations and deallocations were being made and I never had a similar problem. I suspect (never checked it) that MFC may use its own operator new and, by not using an MFC extension DLL, you might be exposing yourself to an allocation nightmare. I would suggest to try this code in an MFC extension DLL and check the results. That's my best guess so far.
Good luck!
João Paulo
|
|
|
|
|
Well, I think my recent post might actually be a good starting point. You see, MFC does redefine operator new in afxmem.cpp. Looking at the code you can see that there are special provisions for when you are using MFC in a shared DLL. As a matter of fact, operator new is implemented in the MFC DLL (if you are using it at all). So this might be the source of your problems: your app is using one operator new and your DLL is using another...
|
|
|
|
|
If I add a date time picker to my dialog resource for my property page the dialog fails to get created. If I create a standard dialog it all works fine. Any suggestions?
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
Yes. It's twisted. You have to create it yourself. See my (unrelated) article A File Open Dialog for the PocketPC 2002[^]. Here, in the sample code, you will find two classes: CExDialog and CExDlgEngine . The last is intended to be used as a means to implement common functionalities in both CDialog and CPropertyPage -derived classes. The method you want to use is CreateDateTime . To use it, replace your date time picker with a static control with the same size and ID. In your OnInitDialog use this method like:
CreateDateTime(this, m_dtcDate, IDC_DATE, DTS_SHORTDATEFORMAT);
Where m_dtcDate is declared in your property page class as a CDateTimeCtrl .
Voilá!
|
|
|
|
|
I had a feeling you would probably be the one to answer.
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|