Skip to main content

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

Hi Dylan, If memory serves me right, sometimes the OCX widget has to be 'run' outside the IDF - in other words, tested from a Uniface.exe / application shell environment - and that might be what's causing you the problem. Here's a snippet from the manual:

Testing

When the form containing the OCX is run using FileTest in the Development Environment, the OCX control runs in the UDE rather than in your application. This means that the OCX is loaded in a type of development mode (AmbientUserMode=false) that might have some restrictions for the OCX. For more information, see Test Form Components Containing OCX Controls. Regards, Knut


Author: Knut (knut.dybendahl@gmail.com)

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

Hi Dylan, $ocxhandle can only be used after the OCX has been instantiated. And this happens when the form on which the OCX is painted has executed a show, edit or display statement. Hope this helps. Regards, Daniel


Author: diseli (daniel.iseli@uniface.com)

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

Hi, Thank you for your information, I'll try to test it one last question : when I do the display or edit ? Regards, Dylan


Author: Dylan (dylan.huart@gmail.com)

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help
Hi Dylan, This should work:
 

variables HANDLE lh_ocx boolean ln_b endvariables

show

lh_ocx = $ocxhandle ( FIELDOCX.CINOMPJ ) lh_ocx->loadfile( ln_b, "c:\\test2.pdf" )

display

 
And if you want to use display or edit depends on the purpose of the form in question - display: display only, content cannot be changed; edit: content can be changed.
 
Hope this helps.
 
Regards, Daniel

Author: diseli (daniel.iseli@uniface.com)

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

Although if your code is in the details trigger of a button, you shouldn't need either the show or display. In fact, I think display has no function outside the exec trigger.  I do believe the thing doesn't work unless in an actual runtime environment, (i.e. not from the test function in the IDF).  Also, ensure you have run the adobe reader on your machine and accepted the licence agreement.  (If running his in debug, what is the status on the loadfile operation)   Iain


Author: Iain Sharp (i.sharp@pcisystems.co.uk)

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

Hi, So, I've successful with a button  from the same "FROM"  without a "display" and "show", but by another "FRM" the problem remains the same : => FRM1 -> click on button -> call FRM2 "execute" ->

variables HANDLE lh_ocx boolean ln_b endvariables

show

lh_ocx = $ocxhandle ( FIELDOCX.CINOMPJ ) lh_ocx->loadfile( ln_b, "c:\\test2.pdf" )

display

I don't understand...   Dylan   Thank you for your help Wink


Author: Dylan (dylan.huart@gmail.com)