As a general rule, whatever you select into a device context must eventally be selected out. SelectObject returns the old object of the type you selected in.
See GetObjectType for a list of object types: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_9pt1.asp...
You are cleaning up by selecting the bitmap OUT of the device context.
When you select something INTO a device context, you can imagine the device context clamps onto and "owns" the bitmap. Selecting the "old" object back into the device context releases control of the...
The speed difference between C and C++ in this case would be so small that it wouldn't matter.
If you are sending 5 megs per second, then I would worry. If you are taking about dialup, the modem is thousands of times slower than the CPU. Even high speed internet is super slow as far as CPU...
If you want help on a warning, click the warning in the build tab and then hit F1.
The meaning of the warning is that you are returning a different type than the declared type. For example, this function would produce that warning:
int myfunc()
{
char v;
v = 123;
return v;
}
In...
You have to pass a *string* to atof(). You can't pass one character.
This would work:
char myHardcodedString[] = "12345.67";
double d;
int main()
{
d = atof(myHardcodedString);
return 0;
}
This would NOT work:
int main() // Doesn't work
{
char c; // Doesn't work...
The reason that a compiler might put that structure in the code section is to make it read-only. Most win32 linkers make the code (.text) section read-only.
Some compilers put C strings in the code section for that reason.
Also, in a DLL, the code section is shared by all processes (with some...
The best way to make a COM file with Nasm is to use the 'bin' format, and put ORG 0x100 near the top of your source file. If you make the output file have a .COM extension, it will be directly usable without linking.
Doug Gale
Be careful when making a .COM program (as opposed to .EXE). The CS, DS, and SS segment registers all point to the same area of memory, so if you use too much stack space, it will eventually start to trample your code. The stack pointer is initially at the top of the code segment (64KB). For...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.