Page 1 of 3

ActiveX question?

Posted: Mon Sep 25, 2006 9:06 am
by Taiwan
Hello Antonio,

If I define window for ActiveX, work fine.

Code: Select all

DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support" 

   oActiveX = TActiveX():New( oWnd, "oa.oactrl.1" )

   oWnd:oClient = oActiveX 

   oActiveX:Do( "ShowToolBars", .t. )
   oActiveX:Do( "Open", "c:\計算.xls" )
   
   ACTIVATE WINDOW ownd on init oActiveX:Do( "Open", "c:\計算.xls" )
If I define Dialog for ActiveX, work. but disappear any action.

Code: Select all

DEFINE DIALOG oDlg RESOURCE "D_DR_WIN_TestActiveX"

         REDEFINE ACTIVEX oActiveX ID 10000 OF oDlg ;     PROGID "oa.oactrl.1"
        
  ACTIVATE DIALOG oDlg CENTER on init  init oActiveX:Do( "Open", "c:\計算.xls" )
I use xHarbour 0.99.4+FWH2.6+BCC55

Regards,

Richard

Posted: Mon Sep 25, 2006 9:32 am
by Antonio Linares
Richard,

Have you defined the activex control in your RC as "TActiveX" ?

Posted: Mon Sep 25, 2006 2:13 pm
by Taiwan
Hello Antonio,

Yes, I had define it as you said.

Richard

Posted: Mon Sep 25, 2006 2:16 pm
by Taiwan
Hello Antonio,

This is my Resource RC below:

Code: Select all

D_DR_WIN_TESTACTIVEX DIALOG 4, 36, 458, 263
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "ActiveX"
FONT 12, "細明體"
{
 CONTROL "", 10000, "TActiveX", 0 | WS_CHILD | WS_VISIBLE, 3, 2, 454, 260
}
Richard

Posted: Mon Sep 25, 2006 2:33 pm
by Taiwan
Hello Antonio,

I found new question below:

Code: Select all

DEFINE DIALOG oDlg RESOURCE "D_DR_WIN_TestActiveX"

         REDEFINE ACTIVEX oActiveX ID 10000 OF oDlg ;
                        PROGID "oa.oactrl.1"

         oActiveX:Do( "ShowToolBars", .t. )    ==> New add
         oActiveX:Do( "Open", "c:\計算.xls" )  ==> New add

ACTIVATE DIALOG oDlg CENTER ;
                on init ( oActiveX:Do( "ShowToolBars", .t. ),;
                            oActiveX:Do( "Open", "c:\計算.xls" ) )
If I New add two line code and get GPF occurred.
Called from ACTXPDISP(0)
Called from TACTIVEX:DO(297)
Called from TestActiveX(197)
.......

Posted: Mon Sep 25, 2006 3:51 pm
by Antonio Linares
Richard,

You can not send msgs to the activex before the dialogbox has been initialized, as the activex has not been initialized yet too.

Posted: Tue Sep 26, 2006 1:15 am
by Taiwan
Hello Antonio,

I see.
But why not appear in my Resource ActiveX? if I have not add New line.

Richard

Posted: Tue Sep 26, 2006 9:29 am
by Antonio Linares
Richard,

> But why not appear in my Resource ActiveX? if I have not add New line.

I don't understand what you mean, sorry.

Posted: Wed Sep 27, 2006 12:47 am
by Taiwan
Hello Antonio,

Let's return first message. Please review my codes.
My code use 1.DEFINE WINDOW 2.REDEFINE DIALOG

Problem is REDEFINE DIALOG .... REDEFINE ACTIVEX
Why not disappear ActiveX function?

Regards,

Richard

Posted: Wed Sep 27, 2006 6:16 am
by Antonio Linares
Richard,

Do you mean that oActiveX:Do( "Open", "c:\計算.xls" )
does not work ?

Posted: Wed Sep 27, 2006 8:49 am
by areang
Richard,

Only DEFINE WINDOW can use with ActiveX

this is same with DEFINE TIMER

TIMER CAN'T work with DIALOG

Best Regard
areang

Posted: Wed Sep 27, 2006 9:42 am
by Enrico Maria Giordano
This is not true:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oTmr

    DEFINE DIALOG oDlg

    DEFINE TIMER oTmr OF oDlg;
           INTERVAL 1000;
           ACTION TONE( 440, 1 )

    ACTIVATE DIALOG oDlg;
             ON INIT ( oTmr:hWndOwner := oDlg:hWnd,;
                       oTmr:Activate() );
             CENTER

    RELEASE TIMER oTmr

    RETURN NIL
EMG

Posted: Thu Sep 28, 2006 1:14 am
by Taiwan
Hello Antonio,
Antonio Linares wrote:Richard,

Do you mean that oActiveX:Do( "Open", "c:\計算.xls" )
does not work ?
Yes, it's not work(Disappear).

Richard

Posted: Thu Sep 28, 2006 5:41 am
by Antonio Linares
Richard,

What do you mean with "disappear" ? Does the ActiveX gets hidden ?

Posted: Fri Sep 29, 2006 7:07 am
by Taiwan
Antonio Linares wrote:Richard,

What do you mean with "disappear" ? Does the ActiveX gets hidden ?
Hello Antonio,

Look it.
DEFINE WINDOW OK.
Image

DEFINE DIALOG
REDEFINE ACTIVEX not display
Image

Richard