Solved

.rc  pushbutton problemHi

Posted on 1997-05-20
2
295 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
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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…

830 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