?
Solved

Linking property sheet text box values to Active X settings

Posted on 1999-01-08
3
Medium Priority
?
217 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 400 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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 …
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

719 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