Page 3 of 3

Re: ActiveX focus issue

Posted: Thu Feb 04, 2010 8:37 am
by rdonnay
Ok, now I'm starting to understand more about your problem after running the sample. It appears that this OCX is meant to run as it's own dialog and not as a control on another dialog, therefore your original code seems to be best and I have removed the @ DCACTIVEXCONTROL command because it fails to embed itself in the parent dialog anyway.

There needs to be a way to display the OCX screen in an appmodal state. I think this is the problem. Can you send me docs on the OCX?

Re: ActiveX focus issue

Posted: Thu Feb 04, 2010 9:28 am
by Stuart.Fraser
rdonnay wrote:Ok, now I'm starting to understand more about your problem after running the sample. It appears that this OCX is meant to run as it's own dialog and not as a control on another dialog, therefore your original code seems to be best and I have removed the @ DCACTIVEXCONTROL command because it fails to embed itself in the parent dialog anyway.

There needs to be a way to display the OCX screen in an appmodal state. I think this is the problem. Can you send me docs on the OCX?

Alternately (and I know this is a kludge), you could force the window to the foreground by figuring out it's window handle. The function WinIsRunning( ) contained in the attached PRG will do this for you. Requires BAP but worth a try.

HTH,

Stu

Re: ActiveX focus issue

Posted: Thu Feb 04, 2010 9:36 am
by Stuart.Fraser
hmm, file attachment didn't seem to work.

trying again....


Ahhh, it doesn't like the extension PRG. Changed it to TXT.

Ok it doesn't like TXT... Changed it to STU

Nope doesn't like that either... I'm guessing it doesn't like anything, last try with a zip file... Yay! it worked.

Re: ActiveX focus issue

Posted: Thu Feb 04, 2010 11:58 am
by Cliff Wiernik
I have a similar type application. I have a activeX Tiff file document viewer. I to have it as the child of a dialog window and static drawn on that window. I have dialogs appwindows set not to the main windows drawingarea but the appdesktop. It is not modal. Thus, when this dialog is opened, it appears as another application showing in the bottom task list. Likewise, it does not show on the main menu Window dialog list. If I click off the activeX controls dialog on another dialog tied to the mainwindow:drawingarea, the activeX control does disappear the main application window. However, since it is in the bottom task bar, it can easily be clicked on by the user. I also have a "Document" push button on the top button bar area that if clicked, also brings the document viewer automatically to the front. That code is shown below.

Code: Select all

  DCREAD GUI ;
    TITLE m->sCompCode+'-'+cTitle ;
    OPTIONS GetOptions ;
    SETFOCUS oBrowse ;    
;//    APPWINDOW m->G_MainWindow:drawingArea ;
    APPWINDOW AppDeskTop() ;
;//    SETAPPWINDOW;
;//    MODAL;
    FIT  ;
    EVAL {|o| d_oDialog := o,               ;
              m->g_lDocViewOpen := .T.,     ;
              m->G_oDocViewer := d_oDialog}

Code: Select all

SetAppFocus(m->G_oDocViewer)
Maybe the above will be helpful.

Cliff Wiernik

Re: ActiveX focus issue

Posted: Thu Feb 04, 2010 1:55 pm
by rdonnay
I can't do any more testing until I get the docs for the OCX. I can't even read the TypeLib info in the OCX with my favorite tools. I've never seen this before. I use the Jace31Wizard.exe to write out wrappers for an ActiveX control but it thinks there is nothing in the OCX.

Re: ActiveX focus issue

Posted: Thu Feb 04, 2010 3:57 pm
by BruceN
Here's everything I have.... hope it makes sense to you. I understand about 20% of it. If you need more info, Il'l get you the email of their developer. PDF files zipped up (your board would accept a pdf extension).

Thanks to A L L of you for the help!

bruce

Re: ActiveX focus issue

Posted: Thu Feb 04, 2010 4:07 pm
by BruceN
Stu:

Got your prg/zip. Am late for a soccer game (youngest son playing). Will look at it tomorrow in my 'copious free time'.

thanks, as always....

bruce