Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

.rc  pushbutton problemHi

Posted on 1997-05-20
2
Medium Priority
?
323 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Expert Comment

by:md041797
ID: 1163588
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 150 total points
ID: 1163589
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

604 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