Imaging OCX

mkontou

New Member
I am trying to use the ocx controls of Imaging for windows, but
not to do this via appBuilder and smart windows. I am looking
for the way to use Imaging for windows like I do with
Microsoft word:

DEFINE VARIABLE oWord AS COM-HANDLE NO-UNDO.
CREATE "Word.Application" oWord.
oWord:Documents:Open("Some.Doc").
oWord:Visible = True.
PAUSE.
RELEASE OBJECT oWord.


Does anybody know how I can do the same thing to open Imaging
for windows and open a picture so I can give ocx commands to
change the picture?

Thanks
 

mkontou

New Member
From the Imaging for Windows Automation

Open Method
Description Opens an image file in the parent application window. This associates an image file with the ImageFile object. If a file is currently open, it should be closed before a new file is opened. (See Close Method).
Note: This method is not available when application is running as an embedded server.
The Imaging application has the focus after an Open. You can reset focus programmatically after an Open, if desired.

ImageFileObject.Open

Examples This example opens an image file named 5page.tif (VB):
Img.Open "C:\images\5page.tif"

What I am tryingDEFINE VARIABLE hImage AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE cDirectory AS CHARACTER NO-UNDO.

CREATE "Imaging.Application" hImage.

hImage:File:eek:pen = ("c:\test.jpg").
PAUSE.

RELEASE OBJECT hImage.

I get errors that property File is unregognized.
Where can I find the correct systax for
hImage:File:eek:pen = ("c:\test.jpg").
 

seenunandagiri

New Member
hi,
when I try to open a .doc file from progress, i am getting following error. Can u help me in solving that error.

"invalid handler for statement Open".
 

mkontou

New Member
What are you using to execute Word and Open the file?
Com-handles? OCX? Winexec? Provide your code to see.
 

seenunandagiri

New Member
Hi,

I am new to the progress 4GL. so I am practicing sample examples. I have gone through ur code and tried. As in ur code, i used COM-HANDLE. when i try to execute the code it just displaying the message and blank word file opened.please help me in solving the problem.
 

seenunandagiri

New Member
Hi,
Actually my intenton is to opening a crystal report from progress, but I am getting lots of errors in that. So I am practing with these small programs.
 

mkontou

New Member
The code should be:

DEFINE VARIABLE oWord AS COM-HANDLE NO-UNDO.
CREATE "Word.Application" oWord.
oWord:documents:Open("Some.Doc").
oWord:Visible = True.
PAUSE.
RELEASE OBJECT oWord.

Some.doc file should be on your hard disk and within a directory defined in your session propath. If it is not saved within a directory which is included in the propath enter the full path of the file i.e oWord:documents:Open("c:\SomeDirectory\Some.Doc").
 

seenunandagiri

New Member
Hi,
I used following code in definitions,


DEFINE VARIABLE oWord AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE oWordDocuments AS COM-HANDLE NO-UNDO.

and, in triggers used following code for a Button "Open File"


CREATE "Word.Application" oWord.
oWordDocuments:Open("D:\openEdge\hello.doc").
oWord:Visible = True.
PAUSE.
RELEASE OBJECT oWord.
END.

WHILE EXECUTING THE CODE I AM GETTING THE FOLLOWING ERROR:

"INVALID COMPONENT HANDLE- REFERENCED WHILE PROCESSING METHOD/STATEMENT Open"
 

seenunandagiri

New Member
thanx..its working fine without side effects.....
if u know how to call crystal reports, let me help...
its highly appriciable...........
 
Top