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? int nCount = str.GetLength() + 1; int nLineLength = tmp.GetLength(); //Format the line read in from the file properly. tmp1[0] = '\\'; for(int i = nCount, j = 1; i < nLineLength; i++, j++) { if( tmp.GetAt(i) == '\\' ) { tmp1[j] = '\\'; j++; } tmp1[j] = tmp.GetAt(i); tmp1[j+1] = '\\'; tmp1[j+2] = NULL; }
Thanks for any insight you can provide. -Eric
VanHlebar
Posts
-
Event / Message sent to framework on Theme Change -
Event / Message sent to framework on Theme ChangeJoã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
-
Sending Messages between appsI have two applications that I am working on. I want to be able to perform some routines in one application based on information from another app. How can I or how do I go about sending messages between the two applications? Is it possible since I already know what the window class name is to obtain a handle to that window and then just post a message directly to it? Thanks, -Eric
-
Event / Message sent to framework on Theme ChangeJoã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
-
Event / Message sent to framework on Theme ChangeJoã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:
TCHAR* pszFile = _T("\\Windows\\My Theme.tsk"); // The theme file
If I make the filename "MyTheme.tsk" it works just fine. If I say something like "\\Storage Card\\MyTheme.tsk" it also fails. -Eric -
Event / Message sent to framework on Theme ChangeJoã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
-
Event / Message sent to framework on Theme ChangeJoã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
-
Event / Message sent to framework on Theme ChangeJoã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
-
Event / Message sent to framework on Theme ChangeOk, I found it.. WM_WININICHANGE is fired when the theme is changed. -Eric
-
Event / Message sent to framework on Theme ChangeDoes 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
-
Dialog ErrorI have a dialog that is asserting during the OnInitDialog method. The framework is sending the dialog an nID=1. I don't have a single #define or a control that is defined as 1. The framework seems to be sending this nID value each time a dialog is opened. In most cases nothing happens, but in this one dialog it asserts during the ddx routines. Any ideas why on this one dialog asserts? Thanks, -Eric
-
DocumentationThis may be a dumb question, but what does everyone use to create their documenation for their ppc apps? I want to include some kind of online documentation for my application, but I don't think the standard .hlp files will work on the ppc correct? Is it just best to create an html type file? Thanks, -Eric
-
Porting from WinCE to VC++I am not sure this is the best place to put this thread so I apologize ahead of time if it should have been posted in the embedded section. I have an application that I would like to port over to VC++. What is the easiest way to port the project and does anyone have any tips that I can use? I have not used any specific methods or API that are found only in wince, but I would like to be able to have only one code base for ease of future development. Also it would be nice to be able to take advantage of the increase in screen real estate on the desktop that I didn't have on the ppc. Everything in the ppc applciation was coded using unicode also. Thanks for the help, -Eric
-
Wierd Dialog Box ErrorJoão, Thanks, I figured it out. Yes I am using MFC. It had something to do with the CCETitleBar object of your that I was using. I had it defined in a view class that was not instatiated yet at the time I was calling the first "wizard". To fix it I just moved the CCeTitleBar object into the first view class and then everything worked as it was supposed. The reason it was working in the second instance of calling the same code was because the "wizard" was being called after all of the different view classes were instatiated. I am not really sure why the CCeTitleBar object was causing this. It was never created yet and there was no call to it or any of its methods inside my dll, but its fixed anyways. Thanks, -Eric
-
Wierd Dialog Box ErrorI have an application that uses a dll to export various dialog boxes. This dll implements a "wizard" if you will that walks the user through setting up a new document for the application. It exports various functions, resources and dialog boxes. The issue that has all of a sudden jumped up, is that when the users starts the wizard, the first dialog box is shown just fine, but when they click next all I get is a blank screen. If I click on the home button on my ppc and go back out to the today screen then click on the icon to start the app again I am give the proper dialog box displayed. This continues thoughout the entire wizard. In a different exported function that uses the same wizard, all the dialog boxes are presented as they should be as the users walks through the wizard. This other function allows the user to go back and add different features to the already created document. It uses all the same code as the first wizard, but yet everything works as I would expect. It as if the drawing mechanism is not being called for each of the dialog boxes after the first one in the initial wizard. On top of all this, everything works just fine in emulator, but not on my device. (Dell Axim X3i) I haven't had a chance to test in on a different machine. Anyone see anything like this before? Thanks, -Eric
-
Multiple CScrollViews in the same appI have an application that has multiple CScrollViews defined in it. Everything works just fine in the one CScrollView right up to the point that I have to have scrollbars in the second view. At this point then neither scroll bar performs correctly. I have set the properties of each scroll bar seperately in each views OnInitialUpdate() method. In these methods I calculate the vertical range of the scroll bars. Each view has its own OnVScroll method. When I only have a single scroll bar set in a view then I can reach both the upper limits and the lower limits of the scroll bar. However, when the second view comes into view and the scroll bar is set up I can no longer reach the lower limits of the first scroll bar. Are these two views using any shared properties? Any ideas on where to start searching for the bug? Thanks, -Eric
-
Switching views in SDI applicationI used this article for my multi view application. http://www.codeproject.com/docview/switchingviews.asp It worked fine for me in both my desktop application and my ppc application. -Eric
-
ScrollView helpJoão, Thanks again for all the help. I added a few features to your base class to allow the users to change the height, text color and background color of the title bar on the fly. If you want to see those changes I can post them or email them to you. I ended up having to play around with the OnPaint() to get my multiple lines of text into the Title Bar. It works for my application, but would not be very handy for general use. If I figure out a way to fix it I will post it here. I am also looking into a way to allow the user to change the Font used on the fly also. Thanks again, -Eric
-
ScrollView helpJoão, Thanks for the code sample. After looking at it a bit this morning I have a few additional questions. 1. In my app I have multiple views defined. Only one of the views is currently a CScrollView class. I have only included the CeTitelBar object inside this one class, but yet it appears as a title above all of the views in my app. How can I get it to only show up in the once class that it is defined in? When I created the CeTitleBar object I used GetParent(), should I have used something else? 2. I need to have more control over the placement of the text inside the title and I need to be able to change the size of the title bar. I think I can see where to change the code to make the changes to the height of the bar, but I need to have multiple lines inside the title bar, some with Bold text some with underlined text etc. 3. Last I would like the title bar to be the same color as my view. This may relate to the second question above. I am going to continue to play around with it this morning, but any help is appreciated. Again thanks for the initial help! -Eric
-
ScrollView helpI have a scroll view implemented in my app and have a question. Currently my scroll bars go from the top of the screen to the bottom of the screen. What I would like to do is have a spot at the top of the screen to be say a title section. I need to have this section not be repainted everytime a WM_PAINT message is sent, only the below it needs to be repainted. So the question is, how do I create such a non-client area inside this ScrollView? Thanks, -Eric