I'm not really familiar with the stuff you're using, and I haven't used C++ for a few years, but from what I remember any functions in the Windows API that changed between character types depending on precomiler definitions had other similarly named functions.
I remember the function to show a message box was called MessageBox(), and internally it mapped to either MessageBoxA() or MessageBoxW() depending on precompiler definitions.
Maybe you'll find something similar with your function for sending the mail?
Then depending on how speedy you need it to run you could write some code to attempt the other version of the function if the first try failed, or if you need it faster try to detect what the MAPI client needed you to use and have some kinda fancy interface, function pointer, etc to convert your text and send it using the right format.
Alternatively, you could try using .Net from C++ to use all of the email junk built into that - though I'm kinda assuming you're avoiding needing to install the entire .Net framework alongside your application.
I'm studying MMS Protocol in order to develop the program connecting to FM Radio broadcast of which the url scheme is mms://domain_name/sub_name(directory name?) such as mms://wmc1.liquidviewer.net/WEEI
I can obtain the ip address of mms url above, but i don't know the meaning of sub_name. it's important when i write tcp socket code.
The socket function usually takes ip address and port number.
The MMS protocol's port number is used with 1755.
If i have ip address and port number, i can write code as below.
const int MMF_PROTOCOL = 1755;
so that I can process the absolute coordinate to windows desktop
This shouldn't matter because coordinates in Windows are always with zero,zero being in the top, left corner of the screen. Whether a screen is rotated 90 degrees to one side, or 270 to the other, you get the same origin reference point (top,left).
int g_x = 0;
DWORD WINAPI Add(void* p) //p unused parameter
int i = 0;
for( ; i < 10; i++ )
//Wait for all the 10 threads to complete its execution
//Now print the result.You expect 10 but it may not be...
cout<<"g_x = "<<g_x<<endl;
The above code answers your first question about data race..
Because the order of the execution.
Suppose you have 4 floats a,b,c,d
and you want to sum up them.
In case of serial implementation, it will be like a + b + c + d
But in case of parallel, it may execute like
(a+b) + (c+d)
So the result wont be same.
This answers your 4th question.