Posted 10 January 2003 - 09:25 AM
I did a search prior to this post and found that Rob Donovan has a post similar to mine sometime back. Only that he face some difficulties on ActiveX DLL instead of ActiveX OCX. Somehow I think VB does things differently from languages like C++, Delphi and such. Even the AX Description couldn't load the description of the OCX that I created.
Posted 10 January 2003 - 10:40 AM
Posted 29 November 2005 - 04:18 PM
I have recently created a control to allow the a user to directly take a picture from a camera. After spending all day writing the thing in VB I find that ProIV cannot see its methods, events and properties.
I wrote the control in VB 6 and am trying to use it in ProIV v5 on Windows XP.
Anyone have any ideas.
Posted 01 December 2005 - 01:32 PM
1. First and foremost you must create a "*.ocx" control in VB not a "*.exe" and it must be properly registered on the client PC.
2. In VB you must establish the properties that you want exposed to the host program. You can do this simply by running the "add-in" property page wizard in VB6. It will walk you through the property setup. The wizard has a default list of properties that cover just about anything that you can imagine, but if you would need to add something it will accept custom properties also. When you have created those properties you should see somthing like this in the VB code.
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
Public Property Get Enabled() As Boolean
Enabled = m_Enabled
3. ProIV does not support design time settings, so even if you expose the property to ProIV and you can see the property ProIV will not allow you to make any changes. You must make those setting inside your VB wrapper, hopefully this problem will be fixed in V6. An example of that is the Microsoft text box that ProIV used in their demo of V5. The scroll bar property in the text box will not work, you can not turn it on from ProIV as the control exists. You must put the control inside a VB wrapper and set the Scroll bar properties on inside the ".ocx" wrapper since the scroll bars are a design time setting.
Hope this helps.
Posted 23 February 2006 - 11:09 AM
However, having said this, when it comes to methods and Events, I have found that they only work under the following condition (could just be me though)...
If you write the Sub/Function with arguments ie:
Public Sub My_Method(Byval Parm1 as string, ByVal Parm2 as Integer) and then ty to access the mthod from
within ProIV as follows
The method fires but the passed parameters don't get there - which is strange...
The workaround for me at the moment is to create the parameters as properties of the control, and then write the method without parameters ie:
Public Sub My_Method
The from ProIV do the following
MyActiveX.Parm1 = $Parm
MyActiveX.Parm2 = #Parm
It then works, but means that you need to remember to set the properties every time before firing the method...
Same applies to Events - the events get raised and are caught by proIV, but as soon as I add parameters, they don't get through...
Posted 28 February 2006 - 06:37 AM
Take for example the following VB Method (Sub)
Public Sub MySub(ByVal Parm1 as string, ByVal Parm2 as Integer)
After creating the interface in ProIV - lets call it AXI -with 2 links, being $PARM1 and #PARM2 - which would be the correct way of calling the controls method (obviously, $PARM1 and #PARM2 have suitable values)
Perhaps my code to invoke the method from ProIV is incorrect ? - since option 1 definitely doesn't work...
Reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users