|
(pardon).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
pix_programmer wrote: How to represent the above string in the XML file using Unicode?
For storing strings in XML file, you should best encode them as UTF-8.
pix_programmer wrote: I also have to read and display this string from C++ and display its Chinese and
Korean representation.
By "display" I guess you mean using Win32 API. In that case, you'll need to convert the text you read from the XML file from UTF-8 to UTF-16, set a font that supports the script your text belongs to and draw it on the screen.
|
|
|
|
|
Hi All,
i am working on dialog based application,here on the main dialog box on the button click i open the child dialog and perform some action in thread here for reading excel file using excel automation and put the values in list ctrl of main dialog box and after reading i m trying to close chile dialog so i m using EndDialog but here the exception occur.
Unhandled exception at 0x76dc8834 in test.exe: 0xC0000005: Access violation writing location 0x00000018.
please help me how can i resolve this thanks in advance.
|
|
|
|
|
How are you creating the child dialog?
EndDialog is used to destroy a modal dialog.
Here is an excerpt from the documentation -
Dialog boxes created by the DialogBox, DialogBoxParam, DialogBoxIndirect, and DialogBoxIndirectParam functions must be destroyed using the EndDialog function. An application calls EndDialog from within the dialog box procedure; the function must not be used for any other purpose.
|
|
|
|
|
yes its a modal dialog box,and i simply open this using DoModal() and on this dialog box create a worker thread to read excel and at the end of thread use EndDialog to close the child dialog.
|
|
|
|
|
The documentation says that you must call EndDialog from within the dialog box procedure.
In the case of MFC, you must call it from within the dialog class.
Are you doing this?
|
|
|
|
|
The worker thread is in child dialog class.
|
|
|
|
|
so as «_Superman_» suggested, you should not call EndDialog from other threads. Use PostMessage to send some user defined messages to your child dialog and call EndDialog() from that message handler.
|
|
|
|
|
|
Slightly off topic, but what is the child dialog doing while the secondary thread is reading the Excel file?
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
its not a secondary thread the thread is inside of child dialog box and when thread the excel file and insert the value in listctrl of main dialog,this time the child dialog box is in hidden form and after the ending of file reading i pass the command to end the child dialog.
|
|
|
|
|
Le@rner wrote: its not a secondary thread...
Are you calling AfxBeginThread() , _beginthread() , or CreateThread() ?
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
yes i start the thread tru AfxBeginThread
|
|
|
|
|
Then you do have a secondary thread.
Now that that's out of the way, why are you doing this? Your primary thread is already being blocked by the modal child dialog, so having a secondary thread is not buying you anything.
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
hi all guy!
I have a textbox. I want to input multi language to this textbox. In Control panel, i select location:japan. In VC++6, i select UNICODE, However Textbox cannot display corect(Ex:input tamin language). Please help me!
|
|
|
|
|
It is most likely 1 of 2 things wrong.
You don't have the correct language packs installed on your system, so the character is unprintable, or it is not supported by the selected font.
If the character works elsewhere on your computer, like in Wordpad or web pages (excluding wikipedia because it often uses images) then this is not your problem.
The character can't fit into Unicode. Unicode only defines space for 65535 characters. Some characters are out of this range, character sets like UTF-x can go up to a bit over 1.1 million characters (limited by a standard in the case of UTF-8, not the limits of the encoding).
Visual studio provides a Multi-byte option, which I have not used which may be able to help your problem, however the Windows core is coded in Unicode.
Other than this, make sure you have the correct character in the string to begin with.
|
|
|
|
|
Hi,
In microsoft word, u can input multi language? I buid small application in C for Win(VC++6), when I set location as EN. I can input multi language. Textbox is displayed corect with language input. When I set location as Japan, Textbox cann't display corect(Ex:Tamin Language)
|
|
|
|
|
hi everybody
i want to make a tree in a listctrl..
but i don't know how
i search but i don't find something about that
help me Plz
sorry if my english isn't good
|
|
|
|
|
|
|
I use BackupRead() to back up a bunch of files. This function reads all the streams contained in each file, including security information.
When I try to restore the file with BackupWrite(), it writes the security info into the beginning of the main file stream so that when you open the file in Notepad, you see a bunch of garbage at the top of the file.
What am I supposed to do with the security stream in order to restore it properly?
What functions are involved?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I write a Win32 DLL for a MFC app. The DLL needs to show a modal dialog at some point. When I move the dialog, the underlying app doesn't repaint all controls; it repaints window borders, MDI client area, a bunch of control inside MDI windows, but NOT the client area of MDI windows. Here's a screenshot[^].
Spy++ shows that WM_NCPAINT, WM_ERASEBKG, and WM_PAINT are sent and that DC of WM_PAINT is 0 (!), which seems to be similar to this topic on CodeProject[^].
I'm a beginner and I more or less follow the explanation there (a custom control subclasses wrong control ID), but don't quite understand if my case is same and if yes, how I can use the info to solve the problem.
Other info: the host app is a third-party app and I don't have the sources; I think it's MFC, because when I move the mouse over them, it says "Wizards" the classes of MDI windows are 'AFX:something'. My primary goal is not to find a bug in the host app, but to solve the redrawing issue; I know it must be possible because there are many other plug-ins that display such dialogs and they somehow solved this. The app makes a synchronous call into the plug-in; everything happens in the same thread. The Win32 DLL embeds Python and the calls are actually made from Python via 'ctypes'; the dialog code is very basic and only uses a couple of API calls, which all seem to work OK (i.e. the dialog shows up and closes), except for the redrawing.
Please help?
Update: please disregards the note about DC = 0, I've just re-read the WM_PAINT specs and saw that this and the whole question I referred to were not relevant to my case. At all.
modified on Wednesday, March 2, 2011 3:44 PM
|
|
|
|
|
maybe try posting this in the Q&A section with the code from your dll...
|
|
|
|
|
I'd love to, but I think I'm already posting this in Q&A, am I not? I'm new here, so I don't really know
The code in the DLL uses basically two API calls: DialogBoxIndirectParam and then EndDialog in the dialog proc. This code seems to be OK, the dialog opens, with all the necessary flags, correctly accesses the param, correctly handles the messages, etc.
|
|
|
|
|
well this is the forum, so even though you can ask questions here its probably better (because its easier to read) to post questions with a good deal of code in the "Questions and Answers" section. in this case, i'd probably have to look at a bit of code to be able to help.
|
|
|
|