|
Thanks for that,
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:
BOOL CMySecondDialog::OnCommand(WPARAM wParam, LPARAM lParam)
{
GetParent()->SendMessage(WM_COMMAND, wParam, lParam);
return TRUE;
} 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:
BEGIN_MESSAGE_MAP(CMySecondDialog, CDialog)
ON_COMMAND(IDC_FIRSTBUTTON, OnFirstButton)
ON_COMMAND(IDC_SECONDBUTTON, OnSecondButton)
...
END_MESSAGE_MAP()
void CMySecondDialog::RelayCommand(UINT nID)
{
GetParent()->SendMessage(WM_COMMAND, nID, 0);
}
void CMySecondDialog::OnFirstButton()
{
RelayCommand(IDC_FIRSTBUTTON);
}
void CMySecondDialog::OnSecondButton()
{
RelayCommand(IDC_SECONDBUTTON);
}
I am not completely sure i understood your situation correctly though...
> 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. <
|
|
|
|
|
Thats really great, thanks... I think you've understood what i want to do, that looks reasonable to me.
I didn't know about the RelayCommand, so thats really helped!
Thankyou very much.
Penfold.
|
|
|
|
|
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).
do u all know about this question ?pls help
|
|
|
|
|
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_
|
|
|
|
|
funjoke88 wrote: do u all know about this question ?
I do now.
|
|
|
|
|
Please read the posting guidelines here[^]. Pay special attention to points 2,3 and 10.
|
|
|
|
|
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
|
|
|
|
|
hi experts,
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.
thankyou.
|
|
|
|
|
|
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???
thankyou.
|
|
|
|
|
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.
|
|
|
|
|
yes.it's been done the same way in which u are saying.
do u have any ideas or any means to disable the cd/dvd rom in windows xp proffessional 64 bit??
i am following all the pre-requisites for 64 bit development.
hope to get a feasible solution this time..
thankyou.
|
|
|
|
|
I'm working with the project that using VC++ connect to SQL Server 2005.
I have a problem about making report from the data that get from database for print out to printer.
Please advise me the solution How can I use MFC to work with this issue.
|
|
|
|
|
See here[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi,
I'm looking for a way to determine that XP (or XP embedded) was shutdown correctly. Is there a way to see that in registry or is there som Windows API-calls that can tell me that?.
With Kind regards, Ole
|
|
|
|
|
|
excellent thanks. Any idea about this in windows7
|
|
|
|
|
HI
i want to make the usb device read only
i already opened the handle for the usb device
now i need to send scsi command to usb device to make it read only
aftert that i will appy dacl to that
now i need to know which scsi command i need to pass to the usb device
and how can i pass that command to usb device using DeviceIoControl
i am using VC++ and visual studio 2005
when ever you are free post the above topic in forums
|
|
|
|
|
Hey people!
In our program a dialog box is displayed with an edit field and some buttons and above the dialog a layered notification window is brought up, stays up for a while (the user has to wait at that point) and then is faded out (using UpdateLayeredWindow). The problem is that all the controls on the dialog (which was under the layered window) remain undrawn and the dialog looks like it has holes on it where the edit field and buttons are (you can then make the controls be drawn for example by dragging another window over the dialog and then removing it). Any idea why we get this and how we could resolve it? I tried playing with the clipchildren style and also tried using RedrawWindow to trigger a redraw but it did not work, also using a RedrawWindow-like solution is very ugly and problematic because the dialog and the layered window both are brought up by different message handlers from different parts of the code and they generally do not know of each other (and i would really like to keep it that way).
Thanks in advance for any usefull hints, fellas.
> 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. <
|
|
|
|
|
Hi All,
I am trying to use _stat C runtime method for a file with time stamp before 1970. It simply crashes.Anybody knows the reason?
Note: My time zone is GMT-5.00 (Eastern time [us+Canada]).
- Vikram S
|
|
|
|
|
_stat uses time which states in the documentation:
The time function returns the number of seconds elapsed since midnight (00:00:00), January 1, 1970
|
|
|
|
|
As far as C is concerned, time (== time_t) started on 1st January 1970[^] - your file with an earlier timestamp is obviously blowing the C runtime's mind. It's like saying to a physicist "here's a file from 10 minutes before the universe existed" - does not compute!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
So what method I should use for stat?
- Vikram S
|
|
|
|
|
I have to ask one question - are file date-times before 1970 actually meaningful? They obviously aren't proper create/modification dates, so why do you need to manipulate them?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|