Solved

.rc  pushbutton problemHi

Posted on 1997-05-20
2
310 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 50 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

717 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