Sternoceral

I've changed my character encoding from unicode to multibyte, which has changed the appearance of form buttons from an aesthetically pleasing, windows xp style "round edge" to an aesthetically unpleasing windows 95 style "square edge".

How can I change character encoding without changing the appearance of buttons

Thanks in advance


Re: Visual C++ General Changing character encoding changes appearance of dialog buttons


Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

Sternoceral

Einaros,

I had hoped you could clarify a few things. Firstly, what is a manifest file Secondly, are you sure this applies to me This project was created in visual studio 2005. All that has changed is the encoding.
Regards,
Sternoceral




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

einaros

Well it's somewhat of a guess, but usually when people are having trouble enabling the XP look&feel, the manifest is the problem. The manifest is essentially an application configuration, which among other things specifies which dlls are to be used. The manifest described in the linked article enables the common controls which have the XP look&feel, so it would be a natural place to start. If it doesn't fix your issues, other options can be considered.




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

Sternoceral

Einaros,

Ok, I'll give it a shot. Since this occurs whenever I change the encoding of any wizard generated app, I'd expect it to be a fairly well documented problem, but it isn't.

Perhaps it just happens to me

I'll let you know how I get on,

Thanks




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

einaros

I wouldn't over analyze it prior to trying the manifest approach Smile




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

Sternoceral

Sounds like good advice :-)




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

Sternoceral

I tried to follow the tutorial, but ran into trouble.

I've added the following code to the head of "myapp.cpp":

Code Snippet

#include "commctrl.h"

INITCOMMONCONTROLSEX icce;

icce.dwSize = sizeof(INITCOMMONCONTROLSEX);
icce.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&ccex);



I've changed my linker's settings. It has an additional dependency on ComCtl32.lib .

I've added a file to my project, "myapp.exe.manifest", which contains the XML from the tutorial.

I'm getting lots of compile time error messages, among them:

Code Snippet

error C2143: syntax error : missing ';' before '.'



and

Code Snippet

error C4430: missing type specifier - int assumed. Note: C++ does not support default-int



and

Code Snippet

error C2371: 'icce' : redefinition; different basic types



Which suggest that, for whatever reason the compiler doesn't recognise the custom datatypes. I don't know why I get this error:
Code Snippet

error C2365: 'InitCommonControlsEx' : redefinition; previous definition was 'function'



Your help would be much appreciated, as always,
Regards,
Sternoceral




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

einaros

Where did you add the code you pasted above Make sure you add it to your main or winmain function, and not to the global scope, if that's what you've done.




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

Sternoceral

I have added it to global scope.

How can I access winmain I understand it's hidden away in the MFC somewhere.




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

einaros

You can't add a lone function call to global scope. Add all four lines to your entry function, meaning the first function your application runs.




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

Sternoceral

That's helped. Now I only have one error message:

Code Snippet

error C2065: 'ccex' : undeclared identifier


Since there is only that single reference to ccex in the tutorial, I don't know what it is.

Please advise.

Your help is much appreciated.




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

einaros

Replace "ccex" with "icce".




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

Sternoceral

It worked. Thanks A lot einaros. As I said, your help is greatly appreciated!




Re: Visual C++ General Changing character encoding changes appearance of dialog buttons

einaros

Sternoceral wrote:
It worked. Thanks A lot einaros. As I said, your help is greatly appreciated!

No problem Smile