?
Solved

Creating an activeX control and sending data to it

Posted on 2009-07-09
1
Medium Priority
?
153 Views
Last Modified: 2012-05-07
I am creating my own vb6 activeX control for use in my own VB6 exe.  I have most of it working, but I cant figure out how to send data to my activeX.

How do I set it up so my activeX can be send data from the vb6 program?  I want to be able to type MyControl.Address = 10.0.0.1 and then in the activeX control there would be a variable called address I would use.
0
Comment
Question by:Tom_Hickerson
[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
1 Comment
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 2000 total points
ID: 24815477
To be able to use the syntax you show, you have to define a 'Property" for the ActiveX control.

I don't know if it is different in .NET, but in VB6, all you had to do was define a pair of matching Get and Let properties if you wanted to be able to read and write the address value (or just Get to only read or just Let to only set)

Basically, you need something like the following Snippet in the CTL file of you ActiveX control.  (Note, if the property is passing an Object rather than a built in variable type, replace 'Let' with 'Set' and prefix the A=B statements with 'Set')
Private m_Address as String
 
Public Property Let Address(Value as String)
  m_Address = Value
End Property
Public Property Get Address() as String
  Address = m_Value
End Property
 
Public Property Set SomeObj(Obj as Object)
  Set m_Obj = Obj
End Property
Public Property Get SomeObj() as Object
  Set SomeObj = m_Obj
End Property

Open in new window

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

770 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