Solved

Linking property sheet text box values to Active X settings

Posted on 1999-01-08
3
187 Views
Last Modified: 2013-11-20
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?  
0
Comment
Question by:mike_turner
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 200 total points
ID: 1327406
1. In the dialog class,

i. ctrl-w for class wiz
ii. member variables tab
iii. pick the relevant control
iv. enter member variable name,
v. in "category" pick - value (if you don't step vii won't be possible)
vi.in "variable type" pick CString, int, etc. based on the property type required
vii. in "optional property name" enter the property name you used when creating the get/set methods

2. I assume you have made the control class properly

This works on all my VC5 ActiveX controls.  If you are still having difficulties, please post more details of your code, compiler, etc.
0
 

Author Comment

by:mike_turner
ID: 1327407
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?
0
 

Author Comment

by:mike_turner
ID: 1327408
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?

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 93
difference between String.subString() and String.subSequence() 6 201
haveThree challenge 22 118
JQuery serialize and unserialize 8 94
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

831 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