?
Solved

ActiveX Control Problem

Posted on 2002-04-12
5
Medium Priority
?
156 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
[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
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 1200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

649 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