Click here to Skip to main content
16,005,826 members
Home / Discussions / Article Writing
   

Article Writing

 
GeneralRe: I need souce for a 'Library Program'..Book lending/returning etc.. Pin
Christian Graus17-Jul-01 18:47
protectorChristian Graus17-Jul-01 18:47 
GeneralRe: I need souce for a 'Library Program'..Book lending/returning etc.. Pin
Sam C22-Jul-01 17:04
Sam C22-Jul-01 17:04 
GeneralRe: I need souce for a 'Library Program'..Book lending/returning etc.. Pin
Christian Graus22-Jul-01 17:29
protectorChristian Graus22-Jul-01 17:29 
GeneralRe: I need souce for a 'Library Program'..Book lending/returning etc.. Pin
Albert van Peppen16-Aug-01 23:25
professionalAlbert van Peppen16-Aug-01 23:25 
GeneralEmbedding MS Word in an application Pin
14-Jul-01 11:40
suss14-Jul-01 11:40 
GeneralSimple but very confusing to me Pin
Kron of LS14-Jul-01 8:35
Kron of LS14-Jul-01 8:35 
GeneralRe: Simple but very confusing to me Pin
14-Jul-01 20:51
suss14-Jul-01 20:51 
GeneralRe: Simple but very confusing to me Pin
Steve T16-Jul-01 9:59
Steve T16-Jul-01 9:59 
Kron,

I'm not sure what parts you are finding confusing but the app you want is so simlple here's a quick walkthrough of how to make it in Visual C++; (No I/O control or formating/error checking etc) You should be able to spot where you went wrong.

Create a new Project - MFC AppWizard (exe)
Add the 4 controls you need ...
3 edit boxes and a button
Right click each one in turn and in their properties/general change the IDs to :
IDC_HOURS
IDC_RATE
IDC_PAY
IDC_CALC (for the button)
Now again right click one o fthe controls again and this time go to the ClassWizard.
For the 3 edit controls you want to add a variable and associate it with the edit box: In ClassWizard select the "Member Variables" tab then - ( example for "Hours" box... )
Highlight "IDC_HOURS" in Control IDs column.
Click "Add Variable"
Complete Member variable name as "m_Hours"
Make sure "Value" is selected in Category drop-down list.
Select "float" in "Variable Type" drop-down list.
Click "OK"

...do the same for IDC_RATE and IDC_PAY Controls IDs.

Now select the Message Maps tab on the AppWizard.
Highlight IDC_CALC in the Object IDs list
Highlight BN_CLICKED in the "Messages" list
Click "Add Function"
Click "Edit Code"

This will take you to the code at the newly created ::OnCalc()function.
Here insert the 3 lines:

UpdateData(TRUE);
// the above line transfers the input typed in the IDC_HOURS
// box and IDC_RATE box into the variables m_Hours and m_Rate

m_Pay = m_Rate * m_Hours;
// This does the work

UpdateData(FALSE);
// This causes newly calculated contents of m_Pay to be
// displayed in the IDC_PAY edit box.


Compile and run!

Hope that helps.

Steve T.






Generalthnx for the help, it worked Pin
Kron of LS17-Jul-01 10:03
Kron of LS17-Jul-01 10:03 
GeneralRe: Simple but very confusing to me Pin
fantastic_mr_fox23-Jul-01 2:35
fantastic_mr_fox23-Jul-01 2:35 
GeneralHelp Needed For Simple Problem Pin
Rob Carey13-Jul-01 12:54
Rob Carey13-Jul-01 12:54 
GeneralRe: Help Needed For Simple Problem Pin
14-Jul-01 20:52
suss14-Jul-01 20:52 
GeneralRe: Help Needed For Simple Problem Pin
Nikhil Dabas15-Jul-01 8:09
Nikhil Dabas15-Jul-01 8:09 
Generaldeleting IE history folder contents Pin
archana13-Jul-01 3:38
archana13-Jul-01 3:38 
GeneralRe: deleting IE history folder contents Pin
14-Jul-01 20:54
suss14-Jul-01 20:54 
GeneralRe: deleting IE history folder contents Pin
Shaun Kaasten14-Jul-01 21:24
Shaun Kaasten14-Jul-01 21:24 
GeneralRe: deleting IE history folder contents Pin
15-Jul-01 7:23
suss15-Jul-01 7:23 
GeneralRe: deleting IE history folder contents Pin
Shaun Kaasten15-Jul-01 8:28
Shaun Kaasten15-Jul-01 8:28 
GeneralRe: deleting IE history folder contents Pin
archana15-Jul-01 19:07
archana15-Jul-01 19:07 
GeneralRe: deleting IE history folder contents Pin
Shaun Kaasten15-Jul-01 20:17
Shaun Kaasten15-Jul-01 20:17 
GeneralRe: deleting IE history folder contents Pin
archana15-Jul-01 23:35
archana15-Jul-01 23:35 
GeneralRe: deleting IE history folder contents Pin
Shaun Kaasten16-Jul-01 10:34
Shaun Kaasten16-Jul-01 10:34 
GeneralRe: deleting IE history folder contents Pin
archana16-Jul-01 19:40
archana16-Jul-01 19:40 
GeneralRe: deleting IE history folder contents Pin
Shaun Kaasten17-Jul-01 20:44
Shaun Kaasten17-Jul-01 20:44 
GeneralRe: it's working. Pin
archana15-Jul-01 20:58
archana15-Jul-01 20:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.