Solved

Linking property sheet text box values to Active X settings

Posted on 1999-01-08
3
167 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now