ActiveX question?

User avatar
Taiwan
Posts: 218
Joined: Fri Oct 07, 2005 1:55 am
Location: Taipei, Taiwan
Contact:

ActiveX question?

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Richard,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Taiwan
Posts: 218
Joined: Fri Oct 07, 2005 1:55 am
Location: Taipei, Taiwan
Contact:

Post by Taiwan »

Hello Antonio,

Yes, I had define it as you said.

Richard
User avatar
Taiwan
Posts: 218
Joined: Fri Oct 07, 2005 1:55 am
Location: Taipei, Taiwan
Contact:

Post 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
User avatar
Taiwan
Posts: 218
Joined: Fri Oct 07, 2005 1:55 am
Location: Taipei, Taiwan
Contact:

Post 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)
.......
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Taiwan
Posts: 218
Joined: Fri Oct 07, 2005 1:55 am
Location: Taipei, Taiwan
Contact:

Post by Taiwan »

Hello Antonio,

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

Richard
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Taiwan
Posts: 218
Joined: Fri Oct 07, 2005 1:55 am
Location: Taipei, Taiwan
Contact:

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Richard,

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

Antonio Linares
www.fivetechsoft.com
areang
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Post 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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post 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
User avatar
Taiwan
Posts: 218
Joined: Fri Oct 07, 2005 1:55 am
Location: Taipei, Taiwan
Contact:

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Richard,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Taiwan
Posts: 218
Joined: Fri Oct 07, 2005 1:55 am
Location: Taipei, Taiwan
Contact:

Post 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
Post Reply