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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automation DLL using appwizard & MFC.

Status
Not open for further replies.

RichardF

Programmer
Oct 9, 2000
239
GB

Can anyone help me with the following ??

Using the Appwizard i have created an Automation MFC DLL.
Using the Classwizard i have created a class (CWidget) . This works fine and i can use it in other compliers/interpreters etc.

Now i want to add a second class using the class wizard, and the new class (CWidgetList) should have a property/method to access an array of the first class. Obviously the class wizard does not provide my class in return type/argument list so I was wondering how it could be done ?

Thanks in advance.

R.
 
if you have a class A difined in A.h and you have a new class B created by the wizard that needs to have an array of A do this

1. in B.h add this line at the top:
extern class A;

2. in B.h add a pointer to class A which points to the array of As like this

A * myArray;

3. In B.cpp add this to the top
#include "A.h"

4. in B.cpp either in constructor or where ever you initialize your data create the array using the new operator.

5. ALTERNATIVE: add #include A.h to B.h and define an array
as:

A myArray[SIZE_OF_YOUR_ARRAY];
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top