|
Thank you Superman for valuable information.
|
|
|
|
|
Hello ,
I am Lakshmanan, a new to MFC.
I have created a multilanguage supported application in mfc.
The below problem occurs in SImplfied and Traditional Chineese localization only
I Have created a dialog having Textbox, buttons , radiobutton and check boxes.
When Displaying the dialog box for the first time, the text inside the button control is not visible fully.
Alignment set in the button control property is Default.
But, on closing the dialog box and opening it again causes the text to be visible clearly and fully.
Also, if the check box state is changed (From Checked to Unchecked), the text inside button is clearly and fully visible.
Also on tab change, (means getting focus to button), the text inside button is getting clearly and fully visible.
Anyone please help me to sort out the problem.
Thanks in advance.
Regards,
Lakshmanan
|
|
|
|
|
I didnot know what happen. Does you project set as Unicode. Or you system have the suitable Chinese Font?
If you can get screen image, perhaps I can help you.
|
|
|
|
|
Hello Mr. yu-jian,
Thanks for your Quick reply.
The Project is Set to Multibyte Character Set.
I have Installed Language Packs for chinese (both traditional and simplified)
Thanks
Lakshmanan
|
|
|
|
|
Hi, You should set this project as UNICODE type. In China, we use the Multibyte Character Set only when we develop the English version software.
|
|
|
|
|
It is not clear to me if this problem happens with the Button, RadioButton or CheckBox controls or if it happens with all of the controls?
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Is there an equivalent of the system() C function in MFC?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
system does exist in VS2003+ libraries - I cant remember the details but its http://msdn.microsoft.com/en-us/library/277bwbdz(v=vs.80).aspx[^]
try using
::system(command);
that being said, I'd use CreateProcess API instead - it give much more control .. as for the 'MFC' part of your question, MFC is just a higher order level of classes/abstractions anyway
|
|
|
|
|
Or perhaps ShellExecute.
Steve
|
|
|
|
|
gawd - getting old (just turned 0x30) - memory slipping, lining up spot on park bench
'forgot that one'
ta
|
|
|
|
|
|
Well there is this[^], but it has nothing to do with MFC.
|
|
|
|
|
Yep, Richard is completely correct, the system call has nothing to do with MFC. +5
|
|
|
|
|
what is the importance of virtual and pure virtual fuctions?
|
|
|
|
|
|
They allow polymorphism, where derived classes can provide different behavior for the same function calls.
For example, a Shape class can have a virtual getArea () method.
Derived classes (like Circle, Square, etc...) will provide different implementations of getArea (), which use different formulas for the area calculation. Thus, you can call getArea () on a Shape object, regardless of which concrete derived class it represents, and you'll get the correct area.
|
|
|
|
|
Yes. you are right.Using these functionality in c++ we can make good code design also.
|
|
|
|
|
Try here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Jackkrishjk wrote: what is the importance of virtual and pure virtual fuctions?
VERY important.
Nihil obstat
|
|
|
|
|
Suppose more than one application is running in my system. I want my program to trace all the popup exceptions i.e. error messages from other applications.
Can anybody help me in this with a simple VC++ example????
|
|
|
|
|
|
<pre lang="text">Thanks a lot <b>Alan </b>
I tried the following code. It is giving me the title of every open windows. But I want only the exception popup window( i.e. error windows generated from other applications) from them.How could I get this. Plz help me.</pre>
<pre lang="c++">
BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lParam)
{
TCHAR title[500];
ZeroMemory(title, sizeof(title));
GetWindowText(hWnd, title, sizeof(title)/sizeof(title[0]));
CString msg=L"";
msg.Format(_T("Value is %s\n"), title);
AfxMessageBox(msg);
return TRUE;
}
void CEnumWindowTest1Dlg::MyFunc(void) //(called by main)
{
EnumWindows(MyEnumProc, 0);
}
</pre>
|
|
|
|
|
Without seeing those titles, I can't give you a way of distinguishing them. If the titles don't work, then using the windows' handles, you can probably get the applications or processes that own them. Then you can use this information to isolate the ones you want.
|
|
|
|
|
<pre lang="text">
<b>Alan</b>
Yes I can get the IDs of each thread with the API GetWindowThreadProcessId()
DWORD threadId = GetWindowThreadProcessId(hWnd, NULL);
now if I go to each thread and call GetLastError() then I am able to know which of them are error windows.
But I don't know how can to call GetLastError() for each thread with threadId.
</pre>
|
|
|
|
|
You cannot use GetLastError() in this way, it will only return the last error value in the current thread of your application. And even if you could somehow call it you would not get a valid response. I think you will find that this project is not viable.
|
|
|
|