Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing objects

Status
Not open for further replies.

davebh

Programmer
Feb 16, 2005
7
0
0
GB
I have created a form (a VC++ GUI) and also another data class. I have included data.h in form.cpp

When I press a btn on the form, I want to call a function in data.cpp.

How do I create a data object so that it can be used when called by function btn1_click to access data in data.cpp?
 
So, if I understand this correctly, you have a form (let's call it CDialogForm) and a class (let's call it CMyDataClass).

You want to call a function (let's say MyDataFunction()) in MyDataClass from CDialogForm, correct?

Code:
CMyDataClass myDataClass;// This can be declared inside the function making the call
myDataClass.MyDataFunction();// This calls the function in the class
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top