|
Hi all,
I have a question :
how to use XML to support Visual C++ multi-language program ?
Please give me some documents/resources/suggests/webpages,if u can ;P.
very very very very very very very very thanks ,
neo
|
|
|
|
|
My question is, what has XML got to do with multi language support in Visual C++?
Do you have an extremely shivering hand that rolled the mouse over the smileys and clicked on them repeatedly or is that some kind of morse code?
|
|
|
|
|
|
Sorry if I've offended you. Enabling Unicode is simple. Just #define _UNICODE and UNICODE in your precompiled header file. Tell me what you are going to do with XML. Do you want to store your application related Unicode data in an XML file?
|
|
|
|
|
it doesn't matter.
i wanna save all of the strings to a xml file,
then i could modify other languages strings in that xml files,
and load strings from the xml file at program runtime.
because i think xml file support multi-language better than other functions.
but i don't know how to use this function.
thank u brahmma.
|
|
|
|
|
Which version of Visual C++ are you using? Check out Microsoft XML Core services. If you need to just store and retrieve a string, you could use a simple .inf file too. Using an .inf file may be easier, but XML has its own advantages and so it may be worth the overhead.
|
|
|
|
|
thanks.
i wanna learn to use VC and XML,and i will build a application of multi-language.
so,if you know any information about how to use xml to store the strings of a software and how to retrieve it by VC,tell me please!
thank you so much.
|
|
|
|
|
|
Read this[^] article. With that, you could process/build simple XML documents.
Shog on learning VB6: Ah, that would have been VB6. Kicked my ass anyway. So easy to learn, just like falling down a flight of stairs...
|
|
|
|
|
Nice to see that you can read empty messages these days.
[modify]
Actually, I could find smiley, when I posted this message.
[/modify]
Prasad
MS MVP - VC++
|
|
|
|
|
?
|
|
|
|
|
neo3155530 wrote: how to use XML to support Visual C++ multi-language program ?
hi it very simple
let you support English, German and Hindi as in your multi language package
you define English = 1, German=2 and Hindi = 3.. then you can create XML like this
<XML>
<sentenceID ID=1>
<1> Some thing in English </1>
<2> Some thing in German </2>
<3> Some thing in Hindi </3>
<\sentenceID>
<sentenceID ID=2>
<1> Some thing in English </1>
<2> Some thing in German </2>
<3> Some thing in Hindi </3>
<\sentenceID>
</XML>
now you just have to find required ids from the sentence you required!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok: thank u very much!
But it's hard to me.
I'm a fresh.
I just konw I'll create a XML file like u said.And create some XML to store the App's resources of multi language's resources.
But I don't know how to use them in my program.
eg.1.how to define or change the default resource?
2.how to load resource form XML?
My mean is we should choose the menu: English/Greman/Hindi/...
Then the App was reshow the menu、title、frame and all of the characters in language of our choose.It look like .ini resource to support the multi language,but it's .XML resource.
In the program,I don't konw how to achieve it.
so if u konw,help me plz.
|
|
|
|
|
hi all,
i'm just learning C++ programming,
and i have a question:
how do i make a function send a data and address from one device to other device:
example; sendbyte(addr, data); the address and data send from divice A is 0x2C1 to divice B is 0x10
thanks,
john
|
|
|
|
|
First of all what do you mean by device ?
May be then you have to take a look at the hardware programming pages here, how to interact with a device driver from an user-level application, or even write a device driver that the system can load for you, such it is possible to call its services and capture its notifications that first rise from IRQs then an ISR (interrupt service routine), which is a sort of a callback registered by the driver itself into the system in order for the latter to trigger its code when an IRQ happens.
I really do'nt know whether you can directly access a global address from a user mode application code. this results in a fault and your program is stopped, because application are monitored and can only access offset_addresses
|
|
|
|
|
johnntran003 wrote:
example; sendbyte(addr, data); the address and data send from divice A is 0x2C1 to divice B is 0x10
by what mode.. both of device is connected~!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc ;
PAINTSTRUCT ps ;
RECT rect ;
HDC hdcWindow;
static int nScreenWidth, nScreenHeight;
switch (message)
{
case WM_CREATE:
nScreenWidth = GetSystemMetrics(SM_CXSCREEN);
nScreenHeight = GetSystemMetrics(SM_CYSCREEN);
SetTimer( hwnd,0,2000,NULL);
return 0 ;
case WM_LBUTTONDOWN:
{
HWND tBarHandle= NULL;
return 0;
}
case WM_PAINT:
{
hdc = BeginPaint (hwnd, &ps) ;
hdcWindow = GetWindowDC( hwnd);
HWND hDesktopWnd = GetDesktopWindow();
HDC Source = GetDC(hDesktopWnd);
HDC Destination = CreateCompatibleDC(Source);
HBITMAP hCaptureBitmap =CreateCompatibleBitmap(Source, nScreenWidth, nScreenHeight);
SelectObject(Destination,hCaptureBitmap);
BitBlt(Destination,0,0,nScreenWidth,nScreenHeight, Source, 0, 0, SRCCOPY);
BitBlt(hdc,0,0 , nScreenWidth, nScreenHeight, Source, 0,0, SRCCOPY);
ReleaseDC(hDesktopWnd,Destination);
DeleteDC(Source);
DeleteObject(hCaptureBitmap);
EndPaint (hwnd, &ps) ;
}
return 0 ;
case WM_TIMER:
GetClientRect(hwnd,&rect);
InvalidateRect( hwnd, &rect, true);
return 0;
case WM_DESTROY:
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
How to convert DDB format to DIB format using GETDIBits() function ????
|
|
|
|
|
See here, here, and here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
And if Mr Crow's links aren't enough, I've provided code for you here[^]
There's no need to post on multiple discussion boards! I took the time to write and test code
and post it for you and come here and see you had at least 3 solutions. Grrr
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: There's no need to post on multiple discussion boards!
At this point we may as well just add it as a suggested practice on the "How to get an answer to your question" post. Given how infrequently those guidelines are followed we might gain some ground.
led mike
|
|
|
|
|
There's guidelines?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
led mike wrote: At this point we may as well just add it as a suggested practice on the "How to get an answer to your question" post.
like i do 2 posts below ?[^] ?
|
|
|
|
|
Not sure you follow me. I mean add item 12. to say: You should post your question multiple times and on multiple forums to improve your odds of getting an answer.
Since items 1. thru 11. are rarely ever followed we might end up reducing the number of multiple posts and cross posting.
led mike
|
|
|
|
|
ok
shish you suggest this to Chris ! lol
|
|
|
|
|
Or simply mark the post from Chris Maunder as urgent???
|
|
|
|