Link to home
Start Free TrialLog in
Avatar of mike_turner
mike_turner

asked on

Linking property sheet text box values to Active X settings

I'm trying to build a properties dialog for an ActiveX
control, and I'm having difficulty getting the data in
text boxes to transfer to the relevant attributes of my
component class.

When tracing the program in the debugger, the
DoPropExchange function in the property sheet class
is called and the data exchange is performed within the dialog class.  The DoPropExchange method in the component
class, however, isn't called.

The component has a property set up and is linked to
get and set methods.  Neither of these are called during
execution.

Any ideas on how to get the two to talk to each other?  
ASKER CERTIFIED SOLUTION
Avatar of Answers2000
Answers2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mike_turner
mike_turner

ASKER

The instructions given are the same as all the books I
have and do not work...

I think that the problem is more to do with the way the
property has been set up within the control.  I've got
a sample program which draws a different shape in the
control when setting a shape property.  When opening the
properties screen for the control in Excel (the Excel
properties screen, not a control defined dialog), the
property is listed in the set of properties that can be
changed.

I can't seem to get my property to be displayed in this
screen.  Here is the procedure I go through to add a
property to my control...

-Open Class Wizard
-Click Automation Tab
-Change class to CXXXXCtrl
-Click Add Property
-Click Get/Set Methods
-Set the variable name
-Set the type to double
-Click OK
-Click OK (Exit Class Wizard)

The property is now displayed in the class view, but after
re-building the component it is not in the list of
properties in Excel.


Any more ideas?
I think I've tracked down the problem.  Excel seems
to lock the Control interface the first time the project
is compiled.

For example, if you build a new project with 1 property it
will be displayed just fine.  If you then add another
property to the control, this property will not be displayed.

A similar thing happens when building a control with several
properties and then trying to add extra ones.

Copying the ocx file to another machine and running Excel
produces the correct behaviour (i.e. all properties are
displayed).

Does anyone know how to get Excel to reset the properties
it displays, and why it works like this?  Am I inadvertantly
creating different versions of the control interface or
something?