Solved

.rc  pushbutton problemHi

Posted on 1997-05-20
2
274 Views
Last Modified: 2012-06-21
Hi
      I am using Borland c++ 4.5 resource workshop to prototype. My problem is
I have created a standard dialogue box ie a box with 2 input fields. I have an ok, a cancel and a view list pushbutton in the window as well.  The OK and CANCEL are the standard pushbuttons while the VIEW LIST I added myself. The VIEW LIST button has a unique control number and name.
In the CPP file that uses the resources I have a switch statement to invoke another window when the VIEW LIST button is depressed. Problem is that I cannot get the view list button recognised. I can depress it at runtime to my hearts content but to no avail.
If I use the value of the OK or the CANCEL button in the switch statement I can invoke the new window.
I have set all the possible option of the VIEW LIST button to the same settings as the OK button (bar the identifier) and I still cannot get it to recognise.


?? Thanks Tim.
0
Comment
Question by:nerd
2 Comments
 
LVL 4

Expert Comment

by:md041797
Comment Utility
Are you using OWL?
Show us some code.
Try changing the control ID, you may have a conflict.
Use Winsight to track the message flow and see what message is being generated.
0
 
LVL 3

Accepted Solution

by:
gaohong earned 50 total points
Comment Utility
Since you have it up and running. I assume that you got the
control ID, else you wouldn't pass resource compiler.

You properly forget to add message handler for your button,
add following in your cpp file

DEFINE_RESPONSE_TABLE1(YourDialog, TDialog)
    //EV_WM_ACTIVATE,
    //EV_WM_SYSCOMMAND,
    //EV_COMMAND(IDOK, CmOk),
    //EV_COMMAND(IDHELP, CmHelp),
    //EV_COMMAND(IDCANCEL, CmCancel),
    EV_COMMAND(YOURBUTTONID, CmYourButtonPressedAction),
END_RESPONSE_TABLE;

void YourDialog::CmYourButtonPressedAction()
    {
     //replace with your own action code here
     MessageBox(HWindow, "I pressed this button", "Notifier", MB_OK);
    }
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now