Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic OLE Object Events 2

Status
Not open for further replies.

WAbrey

MIS
Sep 26, 2003
4
CA
HI,

I'm using PB OLEObject to dynamically declare and connect to an OCX file. I can access the functions just fine after I call 'OLE.ConnecttoNewObject()' but I also need access to the events of the OLE object.

Does anybody know how to do this without placing a control on the window directly?

Many Thanks
Warren Abrey
 
OLEObject is when u want to use a Control with no interfase.

If u want to use its interfase u should add the control in the window / userobject with Controls - > OLE.

is it that u need ?


Regards.
 
Hi..

Thanks for your reply... I think I'm looking for part of both. I don't want to give the user an interface, yet I need call the functions and access the events of the OLE.

THanks Again.
 
Thanks Everybody for all the Help....

PowerObject... do you know of a way to dynamically modify the powerscript of an event at runtime?

Thanks
 
There is currently no way to alter/modify the PowerScript of an event/function at runtime. Because, once the script gets compiled, it gets converted into binary format (PCode/Machine-code) that is short of the source-code (the reason why a PBD is smaller than its library). And binary code is what is used by the runtime to execute app. If we have to have this feature available at runtime, we need to store the source-code in the PBD/EXE/DLL and also a dynamic compiler built into the runtime engine that is not currently available. We had a macro-compiler in CA-Clipper. However, we can evaluate dynamic expressions using dw.Describe( 'Evaluate(...)' ) in a small way.

We can query if an event/function exists and it if it has been scripted using some PowerScript functions (See: PFC's n_cst_MetaClass) and call them or not call them depending on their existence/scripted-state at runtime.

Try ORCA (I don't know much about ORCA).

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
hi!

u can do it with ORCA

I have a few samples

write me if u need them yet

Regards
 
royjimenez:

I'd love some samples if you can send them!

Thanks
 
You can have a modified behavior in your application by using instance boolean vars or storing the variables in an INI-file or the Registry or database. Depending on their runtime values, you may use them in IF/CASE statements to differ the process. Such as:

/////////////////////////////////////////////////////////

IF GetProfileString( ... ) = "Y" THEN
//
li_Choice = MessageBox( "Caution", "Exit the application?", Question!, YesNo! )
//
END IF

/////////////////////////////////////////////////////////

The above is a user-preference neatly implemented using an INI-file that prompts with a dialog to Exit.

Hope this helps...

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
WAbrey

send me an email at rjimenez@sysde.co.cr
i will send u several examples

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top