Jump to content


Photo
- - - - -

ActiveX


12 replies to this topic

#1 Albert Ho

Albert Ho

    Member

  • Members
  • PipPip
  • 19 posts
  • Gender:Male

Posted 10 January 2003 - 09:25 AM

I have created an ActiveX control (.ocx) in VB. I found out that when I added it into VIP, I can't access those properties, methods and events (it wasn't visible in the editor). However, If I create a standard VB program and put that ActiveX control in, I could see all those property, method and events. And it works fine.

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.

Any Idea?

Rgds
Albert

#2 Guest_Dogger_*

Guest_Dogger_*
  • Guests

Posted 10 January 2003 - 09:42 AM

What operating system are you using?

#3 Albert Ho

Albert Ho

    Member

  • Members
  • PipPip
  • 19 posts
  • Gender:Male

Posted 10 January 2003 - 10:32 AM

The PROIV engine is running on RedHat Linux 7.1 and VIP client is running on Win 98

#4 Stuart Burton

Stuart Burton

    Advanced

  • Members
  • PipPipPip
  • 71 posts
  • Gender:Male
  • Location:Luton, United Kingdom

Posted 10 January 2003 - 10:40 AM

I had real problems with this a while back. Rob Donovan actually wrote some ActiveX controls for me in VB for use in a V5 project I was doing but I could never get them to work. Called by anything else they were tip-top but via Pro-IV they just wouldn't work... I believe that VB is not a compatible tool for ActiveX controls for use in Pro-IV...

#5 Guest_Dogger_*

Guest_Dogger_*
  • Guests

Posted 10 January 2003 - 04:22 PM

There are issues when registering Active X control on a windows 98 client - For some reason PRO-IV cannot read the properties / methods etc. If is done on a win 2000 / Xp they work fine.

#6 Guest_Whitter_*

Guest_Whitter_*
  • Guests

Posted 29 November 2005 - 04:18 PM

Hi
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.

Thanks

#7 gdmjdkc

gdmjdkc

    Member

  • Members
  • PipPip
  • 38 posts

Posted 01 December 2005 - 01:32 PM

I am not a VB6 expert by any means, but we have a few activeX controls running. We are running the majority of our machines on XP but have a few 2k machines still on the network. We have not seen any difference in these machines as far as the activeX controls work.

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!
'MemberInfo=0,0,0,0
Public Property Get Enabled() As Boolean
Enabled = m_Enabled
End Property

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.

Gayle

#8 calebsg

calebsg

    Member

  • Members
  • PipPip
  • 38 posts
  • Gender:Male

Posted 21 February 2006 - 05:15 PM

Gayle (or others) -- any tips on getting VB sub (Methods) to work?
Caleb

#9 Agent_Smith

Agent_Smith

    Newbie

  • Members
  • Pip
  • 2 posts
  • Gender:Male

Posted 23 February 2006 - 11:09 AM

Creating the ActiveX's properties in VB with the ActiveX Control Wizard works 100% - properties and events are then visible to ProIV - has issues when writing the "Let" and "Get" statements manually....

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

MyActiveX.My_Method($Parm1, #Parm2)

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
MyActiveX.My_Method()

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...

#10 mglaeser

mglaeser

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 23 February 2006 - 01:40 PM

ARE YOU MAPPING YOUR PARMS?

MARK IV

#11 DARREN

DARREN

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 395 posts
  • Gender:Male
  • Location:Florida,USA

Posted 23 February 2006 - 05:10 PM

mglaser is correct. When calling a method from PROIV, you must define an interface id, exactly the same as if you were calling a global function.
Things should be made as simple as possible, but not simpler

#12 Agent_Smith

Agent_Smith

    Newbie

  • Members
  • Pip
  • 2 posts
  • Gender:Male

Posted 28 February 2006 - 06:37 AM

Yip, tried that, but still don't get the expected results. Unless I am missing something here?

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)

1) MyControl.MySub($PARM1,#PARM2)

or

2) MyControl.MySub()

or

3) MyControl.MySub(AXI)

Perhaps my code to invoke the method from ProIV is incorrect ? - since option 1 definitely doesn't work...

TIA

#13 mglaeser

mglaeser

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 01 March 2006 - 01:05 PM

Option 3 is the correct method call.

Mark IV



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users