|
Inherit your own class from CPropertySheet and override its WM_ERASEBKGND message. To get the buttons from the class use the ids of IDOK, IDCANCEL, IDHELP and I think IDWIZNEXT, IDWIZPREV.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
|
I need an array of CMenu pointers, so that I can loop through the array and do stuff like:
CMenu* pFlyOutMenu = new CMenu[sizeSub];
for (int i = 0; i less than sizeSub; i++)
{
pFlyOutMenu[i]->CreatePopupMenu();
pFlyOutMenu[i]->AppendMenu etc
}
I am doing something incredibly wrong , but it says :
C:\BKView.cpp(264) : error C2819: type 'CMenu' does not have an overloaded member 'operator ->'
Appreciate your help,
ns
|
|
|
|
|
You've declared pFlyOutMenu to be an array of CMenu 's, not an array of pointers to CMenu 's, hence:
CMenu* pFlyOutMenu = new CMenu[sizeSub];
for (int i = 0; i < sizeSub; i++)
{
pFlyOutMenu[i].CreatePopupMenu();
pFlyOutMenu[i].AppendMenu
etc
}
Software Zen: delete this;
|
|
|
|
|
Yikes! Shows you how inexperienced I am.......many thanks...I see my mistake now.
Appreciate your help,
ns
|
|
|
|
|
Hi all;
I'm using the CShellList class in a project I'm working on. I need to fill up a CComboBoxEx (as well as a CListCtrl) with what is normally seen in the drop-down of a CFileDialog, i.e., My Documents, Desktop, Network Neighborhood, etc. CShellList has calls to get the correct icon depending on the file extension, and it has calls to fill up an image list with the system icons [AttachSystemImageList()], but the position of a particular icon (say, Desktop) in this image list is variable. CShellList also has a GetImageListIcon(CString) which will retrieve the correct icon when passed "C:\\My Documents\\"; but I do not know what string to pass it (if one exists) that will get me the icons for the Desktop, Network Neighborhood, etc. I need to either a.) know what strings to pass it to retrieve the correct system icon, or b.) know how to detect what a particular icon in the image list filled by AttachSystemImageList() relates to. Any help would be greatly appreciated.
Thanks,
Thomas
|
|
|
|
|
Is it possible for an exe file that is running to open the same exe file and append data to it.
Thanks
|
|
|
|
|
I don't believe that this is possible, in a simple context. Rather you have to go about and copy the executable to some new file, append the data to the new file, and then write some special keys in the registry such that the next time Windows starts up, the original file is deleted and then the copy is renamed.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
I am porting some code to be UNICODE compatible and I have run into a few snags, namely that there aren't one to one mappings for all functions to work with UNICODE. There are some that have one to one mappings like atoi -> _ttoi.
I have an atof() function that needs a UNICODE equivlant but there doesn't seem to be anything of the sort. How would one go about simulating this or finding a proper _ttof() like function?
Cheers,
Clint
|
|
|
|
|
look up scanf() and the unicode/tchar version
- Roman -
|
|
|
|
|
clintsinger wrote: I have an atof() function that needs a UNICODE equivlant but there doesn't seem to be anything of the sort.
What about _tcstod() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I would like to display the standard hand pointer cursor over some buttons that are just images, and don't really look like buttons. I remember hearing that someone was able to read the graphic from some Windows DLL, and then use that as a resource instead of having to create their own. Does anyone have any suggestions on how to do this or could you point me to an article that has this?
Regards,
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
No need to read any graphics from a DLL. LoadCursor(hInstance, IDC_HAND) is one way to acquire the hand pointer.
Do you implement these buttons yourself? If so, you could specify the hand pointer when you register the window class. If you don't register a new window class, I guess you could track the mouse cursor movements in and out of the button and use SetCursor appropriately.
--
Eventhough the forrest is full of trees, there's still no tree between the trees.
|
|
|
|
|
Also another note is, set the cursor to be used in the WM_SETCURSOR message handler, not in WM_MOUSEMOVE etc as you get a flickering cursor as it switches between the default and WM_MOUSEMOVE one.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
Wow, you have no idea how simple you made this for me! I had done something like this by subclassing my buttons and using WM_MOUSEMOVE but now everything is much nicer. I am curious though if my subclassing is causing a memory leak:
LRESULT CALLBACK ButtonProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HCURSOR hCursorRHand = LoadCursor(hInst, MAKEINTRESOURCE(IDC_REDHAND));
switch(message)
{
case WM_SETCURSOR:
SetCursor(hCursorRHand);
return TRUE;
}
return CallWindowProc(DefButtonProc, hwnd, message, wParam, lParam);
}
The fact that I am calling LoadCursor and no DestroyCursor is that causing a leak because MSDN says there is no need to call DestroyCursor (or at least this is how I interpreted it). If it is causing a leak, where would I put DestroyCursor in this function?
|
|
|
|
|
You probably do have a resource leak in your code. You need to do LoadCursor() just the once and store the handle somewhere to re-use, as it is your leaking 1 cursor resource everytime the procedure is called.
I had some code a while back that was leaking icons, the results were very bad after a short period of time.
Roger Allen
Sonork 100.10016
WHats brown and sticky?
A stick or some smelly stuff!
|
|
|
|
|
I am confused on the matter actually, MSDN states that LoadCursor will not load the cursor if it has already been loaded but that sounds fishy to me. I was also thinking to call DestroyCursor just before the function returns. I think that would probably take care of every LoadCursor call wouldn't it?
|
|
|
|
|
hi, my quiestion is not related to VC++ programming.so forgiveme
my problem is i download some *.ps file. how can i open this file. i searched the google and i fooundout tha ps=post script. but i didn't find any utiliti to open this file.
it seems that ps is related to Some king of Printing files, plzz help meeee
thanx
|
|
|
|
|
http://www.cs.wisc.edu/~ghost
Regards,
Martin
--------------------------------------------
C'mon we all know computers are experimental devices and should only be used for playing games.
Using them for alternative stuff like business, is clearly not using them for what they are intended.
Colin Davies
|
|
|
|
|
I have seen source code on creating region information from BMP's by making one color transparent.
Is there any code available which can create regions to be used in skins from transparent png etc files.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi guys,
I have a MDI App without doc/view. The App start with 4 child windows open in Cascade. I would like them to open with "Tile" Style. How can I do that?
Thanks.
|
|
|
|
|
::TileWindows
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Thanks!! That's what I needed.
|
|
|
|
|
Hello all. I'd like to use something that approximates a Class Specific #define without using namespaces, static const's or enums. Actually enums in the class would be good except some of the defines are floating point numbers.
1 header file has #define MAX_LASER_POWER 23.3, another has #define MAX_LASER_POWER 44.0
Anybody have a clever way to elegantly encapsolate these defines?
Thanks in advance!
|
|
|
|
|
Well, you could try this:
class A
{
public:
static const double MAX_LASER_POWER;
};
[EDIT] Oops, I forgot the "const".
const double A::MAX_LASER_POWER = 23.3;
class B
{
public:
static const double MAX_LASER_POWER;
};
[EDIT] Oops, I forgot the "const".
const double B::MAX_LASER_POWER = 44.0;
You will get basically the same results as using a #define since they are const.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|