Skip to Content
Feb 10, 2016 at 03:52 PM

Code in OLE Control Events within PowerBuilder not executing


Hi All,

I’m using PB 12.5 Build 2511 on Windows 10.

I've been using SocketTools' File Transfer Control 8.0 since a long time ago and have been using its ActiveX control with PB with no problems until now. Well, sort of because now I'm trying to do something new.

The way I normally use the control in PB is by declaring an OLEObject variable and calling the pertinent methods from the object. Here is a code example of how I use it and works ok (I excluded error handling):

OleObject lole_ftp

lole_ftp = create OleObject


lole_ftp.Initialize('<product key>')
lole_ftp.ServerName = ‘…’

lole_ftp.ServerPort = 21

lole_ftp.UserName = ‘…’

lole_ftp.Password = ‘…’

lole_ftp.TimeOut = 30

lole_ftp.Options = 1


lole_ftp.GetFile('c:\', '')



Destroy lole_ftp

All this works perfectly, but the thing is, now I want to access the ActiveX control events so I can write some script and show a progress bar of the copy process. I understand I cannot do this by using the current method so I read PB's documentation and learned that I have to create an OLE control inside a Window so that the control events get exposed. I did this and now I can see the OnProgress event which according to the manufacturer’s documentation gets fired once a second or so.

So I inserted a line of code to update a progress static text (see image) but the code in the event doesn’t gets executed even though the file gets copied. It could be a fault in the ActiveX control but I seriously doubt it because the control has been in the market for many years and it even includes code examples for doing this using Visual Basic 6 and C++. PowerBuilder is mentioned as a language that can use the control but there are no examples using it for this case.

Any help would be greatly appreciated.



SCN - Question.png (57.2 kB)