It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am new to c++ GUI and would like to know more
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
return 0;
}
Would someone be kind enough to explain what HINSTANCE hInstance, HINSTANCE hPrevInstance,PSTR lpCmdLine, int nCmdShowdo?
Find information here:
theForger's Win32 API Programming Tutorial - Getting Started
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
int main()
{
for(;;) {
printf("INSIDE FOR LOOP");
return 0;
}
}
How many times is the printf statement gonna be printed? and why?
The statement is printed 1 time. The return exits the loop and the program.
It loops forever because there is no condition (what normally goes between the ;;).
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
It's well known how easy it is to raise exceptions in Ruby and it's suggested to inherit your own exceptions from StandardError or RuntimeError. And I'd like to systematize all best practices and suggestions into concise list of advantages and disadvantages of Ruby exception handling. Question:
what are advantages and disadvantages of ruby exception handling?
We could have a long discussion on this, or you could get the "Exceptional Ruby" eBook by Avdi Grim, which is a substantial discussion on the topic by a well-known Rubyist and quite a steal at USD15.
http://exceptionalruby.com/
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Is it possible to allow only one instance of any windows app? If yes, how?
Thanks!
You can create a named mutex. At the start of the application, typically the WinMain() function, if you succeed in having the mutex, it implies the instance is the first one else you can flag an error or activate the first application using other means.
HANDLE hMutex = CreateMutex(NULL, FALSE, "MY_MUTEX_123_UNIQUE_STRING");
if (ERROR_ALREADY_EXISTS == GetLastError())
std::cout<<"This is not the first instance\n";
else
std::cout<<"This is first instance\n";
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
The Tao of Programming begins with the words:
Thus spake the master programmer:
"When you have learned to snatch the error code from the trap frame,
it will be time for you to leave."
Please enlighten me.
It is not for the master to enlighten the novice, it is for the novice to travel the pathways to become a master. When you see Tao you know.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
As all you know, C++0x can't bring lots of important changes because of legacy code: all legacy code (including C code) can be compilable with a C++0x compiler.
So why don't add something like #pragma syntax(language_version), which will allow new syntax with breaking changes?
#include <legacy_code_header.h>
#pragma syntax(2098)
// something strange
func(x)
{
return x + 1, x * 2;
}
int main()
{
a, b = func(1.0);
return a + b;
}
Some C++0x compilers might allow this. After all, #pragmas are generally compiler specific and not dictated by the standard. Others support this with command line options.