?
Solved

.rc  pushbutton problemHi

Posted on 1997-05-20
2
Medium Priority
?
316 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.
Suggested Courses

771 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