Solved

ActiveX Control Problem

Posted on 2002-04-12
5
150 Views
Last Modified: 2010-05-02
hallo,

i have a big problem with an activex control and a type struct.
i want to store some values in a type struct in the activex control.
the values must be known and changeable in the property form and
from external. i´ve tried it with class and module. internal with friend, external with public functions or properties.
no success.
how can i do this.

here is a graphic.

                 |-----------|
                 | Property  |
                 |   Form      |
                 |              |
                 |           |
                 |-----------|
                     /\
                     ||
                     ||
                     ||--->< values in type-end type struct
                     ||
                     ||
                     \/
                 |-----------|
                 |  ActiveX  |
 Public     |  Control    |
 values><|             |
                 |           |
                 |-----------|

thank you !
0
Comment
Question by:msvb2000
5 Comments
 
LVL 1

Expert Comment

by:justinhemphill
ID: 6937481
Split the struct into its various fields for the purposes of sending the data back and forward from the control.  Then reconstruct the struct inside the control once it has received all of its property values.
0
 
LVL 1

Expert Comment

by:justinhemphill
ID: 6937485
Split the struct into its various fields for the purposes of sending the data back and forward from the control.  Then reconstruct the struct inside the control once it has received all of its property values.
0
 
LVL 1

Expert Comment

by:soferstam
ID: 6937486
Do you mean this:
Public Type str
a As String
b As String
End Type
Dim o As str

Public Function test() As str
o.a = "abc"
test = o
End Function

Private Sub UserControl_Initialize()

End Sub

This should work.
Be carefull,there is a bug fixed with SP3: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q223116
0
 
LVL 1

Accepted Solution

by:
ProgramIT earned 300 total points
ID: 6938473
Link Public Variable through the Property Get, Set and Let.
EG:
In Module declaration:
Private Type MyDataType
  MyString as string
  ANumber as long
  MoreData as String
End Type

Public MyData as MyDataType

In the class section use:
Public Property Get MyString() As String
    MyString = MyData.MyString
End Property

Public Property Let MyString(byval vData as string)
    MyData.MyString = vdata
End Property

etc.


0
 

Author Comment

by:msvb2000
ID: 6938498
Thanks ProgramIT, that´s it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

920 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

16 Experts available now in Live!

Get 1:1 Help Now