|
I have a populated BITMAPINFOHEADER struct, and I have the bits of a device-independent bitmap. How do I get the RGBQUAD info out of those two items to build a BITMAPINFO struct?
|
|
|
|
|
I believe one of the many places this is explained can be found by a Google search for "rgbquad bitmapinfoheader" (to not promote codeguru after the takeover).
|
|
|
|
|
If you have the DIB bits as they are stored in a .bmp file, youu may have a look at this on MSDN (about BITMAPFILEHEADER): "A BITMAPINFO or BITMAPCOREINFO structure immediately follows the BITMAPFILEHEADER structure in the DIB file. "
Otherwise, you should have the palette stored somewhere, then use that instead.
I think the palette is fixed in size when it is stored in a file (16 or 256 RGBQUAD entries), but the last entries could be unused (usually zeroes) if biClrUsed < 2^biBitCount.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Hi All,
I am looking for some help/example code/links for the above. What I want to do is write some code in Visual C++ which will create an object. I then want to be able to use this object in vbscript and use it's member functions etc. I think the solution is ATL/Com but I'm not sure.
Any help on the above would be greatly appreciated.
thanks in advance,
Dave.
|
|
|
|
|
Hi,
If want to use Visual C++ I think the best choice is ATL, if you are going to use your components from VBScript make sure to implement IDispatch. (that way you can use the components from ASP for instance)
You can find information on the MSDN (you will find tutoriales and articles), or look on www.amazon.com for books on the subject
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Anyone knows about debugging ISAPI Extensions ? I tried lot of the techniques supplied in KB but no chance .
What i'm searching for is some handy tools to do the job (and free tools please)
Thanks .
|
|
|
|
|
Hi,
I've got a function that launches a simple dialog. How do I get the function to wait for the OK button to be pressed before returning?
<br />
void Import_Shader_Dialog::OnImportShaders() <br />
{<br />
Some_Dlg Progress;<br />
Progress.Create(IDD_IMPORT_SHADER_PROGRESS, NULL); <br />
Progress.ShowWindow(SW_SHOW);<br />
<br />
<br />
while(its_not_ok);
<br />
<br />
return;<br />
}<br />
I've tried making the dialog modal but then of course none of the function gets executed while the dialog is up.
The way it is, it just appears as long as the function is executing(very quick).
So how can I get my child dialog to stay up and receive messages from my program until the OK button is pressed?
Thanks
Josh
josh@that-guy.net
|
|
|
|
|
Is this dialog intended to be some sort of progress dialog or monitoring dialog of some type for the other code thats processing?
"I never met anyone I didn't like" Will Rogers.
|
|
|
|
|
Yes, It just supposed to display output strings in a listbox.
Josh
josh@that-guy.net
|
|
|
|
|
In that case just follow Tomaz's advice.
"I never met anyone I didn't like" Will Rogers.
|
|
|
|
|
If I understand your problem correctly, you just want to display a progress dialog during lenghty operation. If this is the case, have a look at Feb'97 issue of MSJ; there's a column titled 'Wicked Code' which describes CWaitDialog class.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Cool, thanks...
Josh
josh@that-guy.net
|
|
|
|
|
use Progress.DoModal()
but put your function code into the dialog class's InitInstance() so that the function runs when the dialog opens up. Then you can send function-related info to the dialog using member variables of the dialog and UpdateData()
Hope this helps...
|
|
|
|
|
Hi,
I would like to respond to the message WM_DRAWITEM within a CFrameWnd derrived Class. Unfortuanetly it doesn't appear within the list provide by class wizzard.
I want to use this message, to support an owner drawn CListCtrl.
Can anyone offer me any advice?
Cheers
Rich
|
|
|
|
|
If you plan to host your control in any CWnd-derived class, there's no need to handle WM_DRAWITEM in the parent. Just override CListCtrl::DrawItem in CYourListCtrl and MFC magic will work for you.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have created an Dialog-based MFC .exe Application and was wondering how to add a menu to the dialog box. I have found and used code adding toolbars and statusbars to dialog boxes successfully.
|
|
|
|
|
Create a menu. Right-click on your dialog box. Select Properties. You will see Menu: combobox. Select ID of your menu.
That's all
Jerzy
|
|
|
|
|
I want to know if it is possible to make a cell in a list control "span" both rows and columns (separately). I also want to change the font/orientation of text in a cell.
My request:
I want my list control to have visual highlights such as a whole row (item) be highlighted to show a visual break in the list - such as a grey block that spans all my columns and contains nothing.
I also want my list control to have a side-bar column that can have text displayed vertically to span a block of rows (items) - such as to indicate a block of related items.
In crude ASCII, I want something that looks like below (4 columns, XXX=grey blocks)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
P Last Name: First Name: MI:
e Address: City: State:
r Zip Code: Phone (H): Phone (W):
s
o
n
a
l
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
O Item 1: Price: Quantity:
r Item 2: Price: Quantity:
d Item 3: Price: Quantity:
e Item 4: Price: Quantity:
r Total Price: Total Items:
s
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Thanks all.
Johnny
|
|
|
|
|
You could achieve this with so-called custom draw, but I think you should switch to some grid control. There's one here on CodeProject; have a look in the Controls/Miscellaneous section.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Does each application have it's own message queue? Or is it one shared queue.
The VB function DoEvents()
and the C++ code
MSG msg;
while(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg) ;
DispatchMessage(&msg);
}
Would indicate that there is one queue.
Philip McGahan
|
|
|
|
|
Each thread that creates a window is allotted its own message queue, and must include a message pump like the one you've litsed in order to process messages for that thread.
Think thread, not application. Here's a snip from the "Multiple Threads in the User Interface" article in the MSDN:
Changes to the Message Loop
"Applications with multiple threads must include a message loop in each thread that creates a window. The message loop and window procedure for a window must be processed by the thread that created the window. If the message loop does not reside in the same thread that created the window, the DispatchMessage function will not get messages for the window. As a result, the window will appear but won't show activation and won't repaint, be moved, receive mouse messages, or generally work as you expect it to."
later... as usual...
Hmmm - maybe this is more helpful - from the PSDK docs on windowing and messages:
"The system maintains a single system message queue and one thread-specific message queue for each GUI thread. To avoid the overhead of creating a message queue for non-GUI threads, all threads are created initially without a message queue. The system creates a thread-specific message queue only when the thread makes its first call to one of the Win32 User or GDI functions."
|
|
|
|
|
Thank you.
That was very informative.
|
|
|
|
|
Has anyone here ever seen this error.
"fatal error C1084: Cannot read type library file: 'TLBs\astm.tlb': Error loading type library/DLL."
I really have no idea what is going on. I get that when doing a regual #import statement. We designed the TLB. The tlb file was just compiled with no errors. It isn't a sharing violation since i made a complete copy of the file just for use in this application. The TLB file comes from a ATL/COM project. (note: I have also posted this in the COM forum: Didn't really know where it belonged.) If anyone has seen this and knows whats going on please help. I have tried everything i can think of. There doesn't seem to be much of anything on the internet about it and there is NOTHING of MSDN about it.
Any help is greatly appreciated.
Joseph Dempsey
jdempsey@cox.rr.com
Joseph.Dempsey@thermobio.com
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."
--anonymous
|
|
|
|
|
Hello.
I am developing a project that includes a Dialog containing a CTreeCtrl object.
When running my application in a WindowsNT machine and i display the Dialog i can see correctly the CTreeCtrl.
But when i run my application in a Windows98 machine when i display the Dialog if i don´t click on the CTreeCtrl i can´t see it.
Could you help me?.
Thanks in advance
Yolanda
|
|
|
|
|
Is there a possibility to clear the output window content from C++ code ?
|
|
|
|