|
Good call, I was wary of the `while(true)' loop.
|
|
|
|
|
Shouldn't that message loop be:
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(msg);
DispatchMessage(msg);
}
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Yes, as long as this window message handling loop is not responsible for any dialog boxes.
Otherwise, and you need to know the dialog box's window handle:
while (GetMessage(&msg, NULL, 0, 0)){
if( !IsDialogMessage(hWndDialogBox, &msg) ){
TranslateMessage(&msg);
DispatchMessage (&msg);
}
}
You also might want to break if the message is WM_QUIT.
Now, the new and improved suggestions, from MSDN is:
BOOL bRet;
while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
{
if (bRet == -1)
{
// handle the error and possibly exit
}
else
{
if( !IsDialogMessage(hWndDialogBox, &msg) ){
TranslateMessage(&msg);
DispatchMessage (&msg);
}
}
}
|
|
|
|
|
Hi all,
I was wondering if anyone could refer me to some c++ class that can be used to generate xml code from a dtd file. If not, then if someone knows of a class that can be used to validate a dtd file and/or tokenize it; not validate xml using dtd, but make sure that a dtd file is "valid".
Thanks in advance,
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
I'm not sure, but I'd lean towards the IXMLDOMDocument interface and its methods.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I looked into this class, but I am pretty sure it doesn't provide this functionality. I have not been able to find any class that will generate a basic valid xml document from a dtd file.
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
HI
I am getting error in executing a program ..It says that a dll file is not found.
How do I fix that?
Thanks
Preeti9
|
|
|
|
|
Preeti9 wrote:
How do I fix that?
Supply the missing DLL, perhaps, or at least ensure that the DLL is located in one of the paths pointed to by the PATH environment variable. Without any more detailed information than what you've provided, I can't offer much more.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanks for reply
I don't understand how to ask...But let's see....
I don't know how to add that DLL file. I don't know why it is looking for that DLL file.
What do you mean when it says that
"Installing the file can fix the problem" ?
Thanks
Preeti9
|
|
|
|
|
Preeti9 wrote:
I don't know why it is looking for that DLL file.
Use Dependency Walker or Dumpbin to find out what DLLs are required by the application. Those DLLs, and possibly others, must exist on the target machine.
Preeti9 wrote:
What do you mean when it says that
"Installing the file can fix the problem" ?
Isn't that self-explanatory? If the file existed and could be located by the OS, the problem would not exist.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I know that's self explanatory but I didn't know where from install the DLL file.
Thanks
Preeti9
|
|
|
|
|
Preeti9 wrote:
...but I didn't know where from install the DLL file.
And you assumed someone here would, given that you did not provide the name of the application or the missing DLL?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
The missing DLL is MSNHook.DLL
Tell me where to find this?
Thanks
Preeti9
|
|
|
|
|
Preeti9 wrote:
The missing DLL is MSNHook.DLL
I believe, First you have to build the dll project come with you sample application.
"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
|
|
|
|
|
Yes,
Thanks a lot...I am trying it that way now...
Preeti9
|
|
|
|
|
I'm having trouble when I export an image as a bitmap on a 16-bit color system (seems to work well under 24 or 32 bit color). The strange thing is that when I bitblt the image to the screen, it looks right but when I save it to a file, the colors are completely off (I mean completely) though the image is not distorted in any other way. I'm pretty sure this has to do with my lack of understanding of bitmaps and 16 vs 32 bit color.
How is each pixel represented. I'm guessing it must be an index, not an actual color value since there are only 2 bytes available. Here's how I build the bitmap header structure:
<br />
BITMAP bm; <br />
bitmap->GetBitmap(&bm);<br />
bm.bmBits = new RGBQUAD[640*480];<br />
bitmap->GetBitmapBits (sizeof(RGBQUAD)*(640*480), bm.bmBits);<br />
<br />
BITMAPINFO BitInfo;<br />
ZeroMemory(&BitInfo, sizeof(BITMAPINFO));<br />
BitInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); <br />
BitInfo.bmiHeader.biBitCount = bm.bmBitsPixel;<br />
BitInfo.bmiHeader.biHeight = -bm.bmHeight;<br />
BitInfo.bmiHeader.biWidth = bm.bmWidth;<br />
BitInfo.bmiHeader.biPlanes = bm.bmPlanes;<br />
BitInfo.bmiHeader.biSizeImage = 0;<br />
BitInfo.bmiHeader.biCompression = BI_RGB;<br />
<br />
BITMAPFILEHEADER BmHdr; <br />
BmHdr.bfType = 0x4d42;
BmHdr.bfSize = (((3 * bm.bmWidth + 3) & ~3) * bm.bmHeight) + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);<br />
<br />
BmHdr.bfReserved1 = BmHdr.bfReserved2 = 0;<br />
BmHdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); <br />
BitInfo.bmiHeader.biCompression = 0;<br />
Does anyone have any ideas?
Karim Shehade
http://www.iwonderdesigns.com
|
|
|
|
|
Karim Shehadeh wrote:
How is each pixel represented
2 bytes per pixel: _rrrrrgggggbbbbb (5-5-5) or rrrrrggggggbbbbb (5-6-5)
no palette.
how are you viewing the BMPs ?
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Chris Losinger wrote:
how are you viewing the BMPs ?
I'm viewing the bitmaps via a photoshop and the built in preview app in WinXP.
Karim Shehade
http://www.iwonderdesigns.com
|
|
|
|
|
the only thing that looks even a little off is the bmSize calculation, because that looks like it assumes 32 bit pixels. but that shouldn't affect the colors - most programs don't care about that value.
what does your BITMAPINFOHEADER struct look like after you've filled it in ?
-c
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Thanks again for all your help with this. Here's the bitmapinfoheader structure just before it's written along with everything else, to disk:
- BitInfo.bmiHeader {...}
biSize 40
biWidth 320
biHeight -260
biPlanes 1
biBitCount 16
biCompression 0
biSizeImage 0
biXPelsPerMeter 0
biYPelsPerMeter 0
biClrUsed 0
biClrImportant 0
Regards,
Karim Shehade
http://www.iwonderdesigns.com
|
|
|
|
|
|
No, I haven't though I did see it while I was perusing the docs. I'll give it a shot. Thanks again for your help.
Karim
Karim Shehade
http://www.iwonderdesigns.com
|
|
|
|
|
Hi all,
I wanna create a program that startup each time the pc started..which api i can used?
|
|
|
|
|
See MSDN articles Q179365 and Q137367.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
to have programs start when the computer starts up u need to edit the registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
or
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
|
|
|
|