I have a program that has a dialog box - call this 'box1' on top of another dialog.
I want to create a 'box2' that will have some of the same buttons as 'box1' and perform the same actions - don't ask why i need to do this!
What i think is that making box2 a 'child' / derived class of box1 will be the best idea.
What i want to do is tell the program, when button 'my buttonbox2' is clicked in box2 it just goes to the 'mybuttonbox1' in box1 and carries out that process.
I understand all the class and derived class things in C++, and I understand all the OnBtnClicked stuff etc... i'm just having a hard time with my limited knowledge to connect standard C++ with MFC!
If anyone can help I would be very grateful. Thankyou.
If it is only a few buttons AND in your second dialog you know the handle of the first one (for example it is its parent) then you can try simply relaying all the command messages to the first dialog, if this suits your needs or not i can't tell of course.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
I think that would be right for my needs,
the problem is, i have not been able to work out the actual code to relay back to the 1st dialog, I could do this in standard C++, but with MFC macros I'm sure how to go about actually coding it...
Could you (or anyone else reading this) give me an example code to relay the buttonclick back to the 1st dialog button click?
Sorry, i'm quite new to MFC, and i'm not sure quite how to treat the macros in it as opposed to standard 'int's' or something.
Thankyou very much for your help. (and yes, its only a few buttons - probably 3or 4).
Does your second dialog know of the first dialog? Is it its parent for example? Then you could try overwriting the OnCommand[^] method of the second dialog's class (it doesn't even have to be a subclass of the original dialog's class). So something like this:
Of course this carries some risks...a more safer aproach is maybe adding message handlers to your buttons and then relaying the events from there. Since we are talking about a few buttons only, it should be easy:
1. Write a C program to read a list of books from a file and create a linked list to store them. The purpose of this program is to keep track of the books kept in a shelf. The shelf is a three-tier shelf and each tier can store up to 4500 pages maximum. The books are kept in alphabetical order (ascending).
we don't do the homeworks or assignments. we are way past from that stage.
If you can start and are stuck somewhere, someone may help you.
On another note - Can I politely ask you to read the forum guidelines/rules?
You need to google first, if you have "It's urgent please" mentioned in your question. _AnShUmAn_
It's called "homework". It seems to me that if you were given that assignment, then the instructor probably gave you everything you need to implement a solution. That's what I know about it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
can i get some help on how to disable and enable cd/dvd drive in windows XP-64 bit. the application needs to isolate the user from using the cd/dvd drives. how can i go ahead writing a
i am developing the application in VC++ 9.
some code examples will be of great help and much of appreciation.
i am through all the things mentioned in that posts.
my issue is my application has to run for windows XP-64 bit.
and the registry stuff is not working. i have tried all the stuffs mentioned.
any other feasible ideas???
if u want to run ur stuff in 64, there few things that should be taken care.
if u want to make 64 bit application run on 64 bit environment, firstly compile it as 64 bit. And build it, and some API in 32 bit wont work. Definitely you can use registry APIs in 64 application, using which you can modify registry.
If want to port your 32 bit application to 64 bit then
1. Build using vs 2008(64 bit support enabled) is must.
Last Visit: 31-Dec-99 19:00 Last Update: 6-Feb-23 3:51