|
Christian,
does this code correct for 8 bpp Bitmap?
WidthBytes=lpBitmap->biWidth/4;
if (lpBitmap->biWidth%4) WidthBytes++;
WidthBytes*=4;
How to use color table for 8bpp bitmap (for pixels)?
I think, RGBQUAD Quad = (LPRGBQUAD) Data;
in this case (for 8bpp) doesn't work
Am i ridht?
|
|
|
|
|
That looks promising. You'd need to then load the palette and look up the colour values based on the indexes. You're right, RGBQUAD will not work for 8/16 bit. To be honest, if it was me, I'd do it the lazy way and convert to a 24 bit DIBSection and then just read the bits off that in memory.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
What functions do i need to convert 8 or 16 bpp bitmap to a 24 bit DIBSection?
|
|
|
|
|
Chris has a nice DIBSection wrapper on this site, you just create a 24 bit DIBSection and select it into a DC, then you can copy it across, and the DIBSection has a pointer to the data.
LMK if you have any trouble, I'll dig it up and write some code for you. You probably don't even need the wrapper, if you go to www.wdj.com, they have an article online of mine from September, the code from which will show you how to create a DIBSection yourself and copy a bitmap onto it and access the bits directly.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
|
I want my applications to "monitor" all keys pressed (or messages in general) in another application. I know it's possible, since Spy++ does exacly that and much more; so how do I do it? I also want it to just monitor one specific application. I guess I'll have to use ::FindWindow() or something?
Please help
Sprudling
|
|
|
|
|
You'll need a hook - docs for SetWindowsHookEx are a good starting point.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
|
Sorry about the Delphi link. Hopefully it's still somewhat helpful.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Visual C++ 6.0 Enterprise Edition, Service Pack 5. I have created SubFolders under my main Project Folder in the ClassView pane. Randomly (from what I can tell), ALL the Classes that I have moved under those SubFolders will move back to the main Project folder whenever I open the project. This is a major pain as I have to keep moving the classes back to the SubFolders in order to keep my project folder from getting to full to use efficiently.
Am I misunderstanding something, or is this a bug ???
The SubFolders I created in the FileView Tab work fine. The files always stay in them.
Anyone have any suggestions ?????????
Thanks, John
|
|
|
|
|
I believe ClassView folder settings are stored in .opt file. Maybe you've deleted it?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I can exit VC++, go right back in, and all the classes will be moved back under the main project folder in ClassView. It doesn't happen every time, but every few days or so. I'm not physically deleting the .opt file or anything. I happens on my Notebook as well as my normal desktop.
Thanks for the input.
|
|
|
|
|
I haven't really understood how to add a message handler for a menu bar item. I just created an empty MFC project (MyApp) and then added a new menu item (ID_FILE_SOMEITEM).
Then through the Class Wizard on Mesage Maps tab I chose the view class CMyAppView and chose ID_FILE_SOMEITEM in ObjectIDs and then clicked on Command in Messages and clicked the Add Function button.
The class wizard created the function OnFileListen.
I added the
AfxMessageBox("Code Reachable");
line inside the function and when I built the project.....I was expecting it to give me a message box alert on clicking File>SomeItem
But Nothing Happens. Evidently I am making a pretty basic mistake in creation of message handlers.
Tell me what to correct.
Mike
|
|
|
|
|
ClassWizard has the annoying habit of sometimes changing the target class to something other than what I expect. Perhaps the handler got added to a class other than CMyAppView?
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
nope because I found the message handler function in CMyAppView class and I added the AfxMessageBox there!
|
|
|
|
|
Could I get some comment about the why and how the app have closed. Do Anybody knows a api function or MFC ?
[]'s Cris
|
|
|
|
|
PostQuitMessage(0) generally, or CDialog::OnOK ( or OnCancel) in a dialog based app spring to mind, but there are others.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
I'll just also mention that if you also meant how could it be closing without your wishes, the most common way is you hit return in a dialog based app. Other than that, if that's what you meant, you'll have to be more specific.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
When you run (in VC++6.0) in Debug mode and the app closes (by the user), appear on 'Docking view'window' - tab 'Debug', the messages:
The thread 0x3A4 has exited with code 32053 (0x7D35).
The thread 0x1B8 has exited with code 32053 (0x7D35).
The thread 0x498 has exited with code 32053 (0x7D35).
The program 'D:\MyProgram\Debug\MyProgram.exe' has exited with code 32053 (0x7D35).
I would like to know any shape to get some information like this about the program exit.
[]'s Cris
|
|
|
|
|
I have a problem with animating my OpenGL code in an MFC window. When I move the window the background leaks onto the screen. I was wondering if anyone knows what to do. I think you have to use the WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE messages, but I am not sure. Also I was wondering if anyone knows if you can animate OpenGL in a dialog box?
Matt
|
|
|
|
|
First of all I'd recommend not using MFC. nehe.gamedev.org ( from memory, to be honest all I am sure of is nehe ) has a ton of GL tutorials that do not use MFC and will help you learn pretty much all you'd want to know. As for your sizing, I'd have thought you'd handle WM_SIZE to keep track of the changing size of your GL window, but if you're drawing onto the DC of the window, I don't see how you'd be drawing outside it.
There's no reason you couldn't animate GL in a dialog box.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
> First of all I'd recommend not using MFC.
Why not Christian?
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
Doesn't MFC make OpenGL calls unnecessarily slow? MFC isn't the best thing to go with 3D Graphics.
|
|
|
|
|
Doesn't MFC make OpenGL calls unnecessarily slow?
How exactly it slows OpenGL calls?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|