|
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???
|
|
|
|
|
led mike wrote: 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.
Yeah...that's good for the first version upgrade.
But I'm thinking ahead to the future...nobody's going to read the item 12. I think we'll soon
find that most people will post to just one board.
To fix this, I propose the item is emblazened across the top of the page in big red flashing block letters (flames optional).
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: nobody's going to read the item 12.
Bah, this should be easily fixed. Simply say that it's strictly forbidden to read item 12 at the top. Everybody would jump right to item 12 skipping the items before it.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Excellent idea I hope led mike is writing this stuff down!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: But I'm thinking ahead to the future...nobody's going to read the item 12.
In that case, we need to add some "Flash" content to that post. Or may be we try "Silverlight". The 12th point will be flashing in red, brown, magenta, and dark green colors, alternatively.
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...
|
|
|
|
|
The animated ads are distracting enough!
Come to think of it, I ignore the ads so maybe I'd ignore the blazing flashing posting rules.
Maybe this scheme isn't going to work at all...
Mark
p.s. I wonder what happened to the OP...
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
// Hassancap.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "Hassancap.h"
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_HASSANCAP, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_HASSANCAP));
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage are only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_HASSANCAP));
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_HASSANCAP);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassEx(&wcex);
}
//
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
// hWnd = CreateWindow(szWindowClass, szTitle, WS_POPUPWINDOW|WS_CAPTION|WS_VISIBLE,
//480, 400, 320, 240, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
//
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
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 ...
|
|
|
|
|