|
|
Use a DWORD like this:
#define ACTION1 2
#define ACTION2 4
#define ACTION3 8
#define ACTION4 16
#define ACTION5 32
DWORD actions = ACTION3 | ACTION5;
if (actions & ACTION3)
...
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
|
hi,
I am using Cristi Posea's control bar code to display a tabbed bar.
I have some lists to be shown when the relevant tab is hit.All works fine untill I relocate the bar.The tab window gets resized but the lists inside the tab donot.How to get that working.
The tab I am using is a class derived from CTabCtrl and I have handled the WM_SIZE and WM_SIZING to relocate the lists.This works in a resizable dialog box but not in the bar.WHY? Also no style other than WS_CHILD|WS_VISIBLE|WS_BORDER get shown eg WS_EX_CLIENTEDGE.WHY?
Also,why is the rect of the bar in negatives and why the child should have
zeros while creating?
I really need some help.I want to restructure all the lists into tabs for my
on going project.
Waiting desperately.
Steven Wu.
|
|
|
|
|
I am using a callback to process wave messages (WIM_DATA, WIM_CLOSE, WOM_DONE, WOM_CLOSE). The problem is: under Windows 9x and ME everything worked great. Now, however, Windows XP locks when I free up allocated memory by calling waveOutReset() or waveInReset().
I think the problem is that the callback exists in a different thread than where the memory was allocated. If this is correct, what should I use: GlobalAlloc(), VirtualAlloc(), HeapAlloc()??? Or should I be doing something different altogether?
Johnny
|
|
|
|
|
Hey, can anyone give any recommendations of good books that I can get that will help with my COM/OLE/ATL woes? I am using COM/OLE (and/or ATL) and trying to incorporate MS Word into an application, add a toolbar button dynamically, and other processing, and I was wondering if anyone knew of any books that might be good, possibly show some examples, etc. I would like to get a couple of books that might be working with Word in them. Any ideas would be appreciated!!!
I have looked at various posts on this website and a few others and they have helped alot. But they just don't seem to work in my application and I am not sure why...
|
|
|
|
|
Inside COM by Microsoft Press
|
|
|
|
|
When i use it on mine it returns 0xcd as the color of ALL the pixels.
|
|
|
|
|
according to this, you need to test RC_BITBLT
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Can anybody shed some light on why my list box might be doing this when I size it, and sometimes not even *appearing* when I alt-tab back to my app?
It's part of a tab control (in my dialog app) that I manually ShowWindow when a user clicks on a certain tab.
Thanks ahead of time,
- Jason
(SonorkID 100.611)
In the beginning, teachers taught the 5 W's: who, what, where, when, why. Now it's just a big damn G
|
|
|
|
|
I have had a simliar problem on a docking window. In the end I had to force the control to re-paint everything, not just the area that had changed. You will probably have to put and Invalidate() call at the end of your OnSize() procedure to get it to re-draw properly.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Thanks for the response. I've been hunting this problem all day and have narrowed it down enough to know the cause. It seems to do this only when I have two list controls stacked atop each other. They're inside a tab control and I ShowWindow(FALSE) them and then ShowWindow(TRUE) one of them depending on which tab is active. Any further ideas? I'll keep poking around in the meantime, and I'll try your trick.
UPDATE: It's the tab control that's causing it. When I ShowWindow(FALSE) the tab control before anything else, the problem goes away. Will I have to subclass CTabCtrl and make it not draw the background or somethiNG?
Thanks again,
- Jason
(SonorkID 100.611)
In the beginning, teachers taught the 5 W's: who, what, where, when, why. Now it's just a big damn G
|
|
|
|
|
Jason Hooper wrote:
Will I have to subclass CTabCtrl and make it not draw the background or somethiNG?
First, make sure you have the WS_CLIPSIBLINGS style set for the tab control. While you're at it, make sure WS_CLIPCHILDREN is set for the dialog also. If neither of those works, i'd try Roger's suggestion (Invalidate() on resize) before something as drastic as sublcassing.
--------
The real problem is that you don't have to be religious to be a religious fanatic,
you just have to be a fanatic. -- Stan Shannon, the lounge
|
|
|
|
|
I removed WS_CLIPSIBLINGS for the tab control, and added WS_CLIPCHILDREN to the dialog itself, and all seems to work fine. Thank you! This was getting under my skin.
- Jason
(SonorkID 100.611)
In the beginning, teachers taught the 5 W's: who, what, where, when, why. Now it's just a big damn G
|
|
|
|
|
As an aside, I would also change the ShowWindow() calss from TRUE/FALSE to SW_HIDE and SW_SHOW, as you cannot guarantee that TRUE/FALSE will work as expected.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Thanks for the tip, I'll do that.
- Jason
(SonorkID 100.611)
In the beginning, teachers taught the 5 W's: who, what, where, when, why. Now it's just a big damn G
|
|
|
|
|
2 header files:
- Class1.h contains CClass1
- Class2.h contains CClass2
2 class files:
- Class1.cpp #include "stdafx.h"
- Class2.cpp #include "stdafx.h"
CClass1 contains pointer to CClass2 object, CClass2 contains pointer to CClass1 object.
So:
-Class1.h: #include "Class2.h"
-Class2.h: #include "Class1.h"
When trying to compile this, the compiler returns aprox. 60000 errors. That's because the classes are already defined.
How can we solve this problem? A clean solution please.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
The both classes use this:
#if !defined
#define
....
#endif
and it still doesn't work
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I answered a question similar to this one a while back. Look here.
Regards,
Alvaro
Insanity: doing the same thing over and over again and expecting different results. - Albert Einstein
|
|
|
|
|
put forward declarations in the Class1.h and Class2.h files and only add the include directives in the cpp files.
class Class2;
class Class1
{
Class2* p;
};
and
class Class1;
class Class2
{
Class1* p;
};
Max.
|
|
|
|
|
I just can't.
Class1.h needs definitions for CClass2 and Class2.h needs definitions for CClass1
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
frisco wrote:
Class1.h needs definitions for CClass2 and Class2.h needs definitions for CClass1
Forward declaration will tell the compiler to expect this class definition later and allow it's use now
Class CClass2; // Fwd declared, but not defined yet
Class CClass1
{
// Stuff
// Ref to class 2 here
};
Class CClass2
{
// Other stuff
// Ref to class 1 here
};
Paresh Solanki
hombre que trabaja pierde tempo precioso "The man who works is losing precious time." Vuemme
|
|
|
|
|
Then your design is broken. Change your design to not have a circular dependency.
|
|
|
|
|
been there.fixed that.
follow the steps.
1.choose one class to be a pointer say class2.In class2.h after the include guards-
2. class class1;
class class2 - declaration
3. #include"class1.h" - definition
now class 2 need not use a pointer
class1 class2::m_class1 will work.
If you still need a pointer just use it.
In class1.h,again declare
class class2
now
class2* class1::m_pclass2 will work
-cu
|
|
|
|
|
If i want to save a bitmap to the disk, i first write BITMAPFILEHEADER struct to the disk and then a BITMAPINFO struct, but where do i specify the colors? I have an array of RGBQUAD's that contain all the colors but where do i specify them?
Thanks
|
|
|
|