Solved

Linking property sheet text box values to Active X settings

Posted on 1999-01-08
3
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

617 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