Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 03 MAR 2011 04:18:56PM Martin Drenovac wrote:

I take a form, place the OLE control on it. Set the property to sbVisiloadAutoload.AutoLoad for its text. It works perfectly as i can see the properties of the control on the Ole Control Properties.

Then in code what i want to do is to instantiate this via OleCreateInstance, so that i can use the OLE commands. Here's the code.

DECLARE FUNCTION get_property

DECLARE SUBROUTINE OlePutProperty

DEBUG

OLE_control$=OleCreateInstance('sbVisiloadAutoload.AutoLoad')

status=OleStatus()

if status then

 CALL msg(@window,'OLE Error code: ':status)
 return

end

I run the above code from a button off the same form as where i have the OLE control, and it hangs.

so, what have i done wrong that this is hanging? The OLE_control is not EQU to anything.


At 11 MAR 2011 08:56AM Karl Pozmann wrote:

Hi Martin;

You shouldn't have to run olecreateinstance as the Window is already doing that. You should also be able to manage the OLEs events from the event-handler of the control.

I've had better luck sometimes doing the olecreateinstance from a stored procedure (for example Word) and managing it from there.

HTH

Karl


At 11 MAR 2011 10:26AM Sean FitzSimons wrote:

Martin,

Karl is correct. When placing an OLE control in the form, the form will instatiate the OLE instance. The OleCreateInstance() function should be used when instantiating the instance programmatically.

Sean

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/434169016292fed78525784800751730.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1