Solved

ActiveX Control Problem

Posted on 2002-04-12
5
154 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 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

691 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