Language C ( To Antonio )

Language C ( To Antonio )

Postby lailton.webmaster » Sat Jul 25, 2009 2:32 am

HB_FUNC( OLEWECREATE )
{
HWND hWndCtrl;

LoadAtl();
hWndCtrl = CreateWindowEx(
(DWORD) 0 , // nExStyle
(LPCTSTR) "AtlAxWin" , // cClsName
(LPCTSTR) hb_parc( 1 ) , // cProgId
(DWORD) WS_OVERLAPPEDWINDOW , // style
CW_USEDEFAULT , // nLeft
CW_USEDEFAULT , // nTop
0 , // nWidth
0 , // nHeight
HWND_DESKTOP , // oParent:handle
0,
0,
NULL );

hb_retnl( (long) hWndCtrl );
}


Oque yo devo hacer para que este windows seja creado dentro de
um windows passado por mi, como alterar ?

OleWeCreate(cProgId)

Atualmente es assi creio que seja algo como isto:


OleWeCreate( ownd:hWnd, progid, nleft, ntop, nwidth, nheight )

HB_FUNC( OLEWECREATE )
{
HWND hWndCtrl;

LoadAtl();
hWndCtrl = CreateWindowEx(
(DWORD) 0 , // nExStyle
(LPCTSTR) "AtlAxWin" , // cClsName
(LPCTSTR) hb_parc( 2 ) , // cProgId
(DWORD) WS_OVERLAPPEDWINDOW , // style
(INT) hb_parc( 3 ) , // nLeft
(INT) hb_parc( 4 ) , // nTop
(INT) hb_parc( 5 ) , // nWidth
(INT) hb_parc( 6 ) , // nHeight
hb_parc( 1 ) , // oParent:handle
0,
0,
NULL );

hb_retnl( (long) hWndCtrl );
}

Antonio,

estoy hacendo assim pero no sei o que estas de errado que no fica em
la wuindow ownd.

gostaria de criar algo igual ao @ 0,0 ActiveX oact .......

@ 1,1 cActive oct id progid of ownd width 300 height 400

i sobre o

Ownd:oClient = activex ?
como hacer com cActiveX ?

:?:
Last edited by lailton.webmaster on Sun Jul 26, 2009 2:41 am, edited 1 time in total.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: C++ ( To Antonio )

Postby Antonio Linares » Sat Jul 25, 2009 5:59 am

Lailton,

...
( HWND ) hb_parnl( 1 ) , // oParent:handle
...

Comentarte que esto no es C++ sino C :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: C++ ( To Antonio )

Postby lailton.webmaster » Sat Jul 25, 2009 2:41 pm

GRacias antonio
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: C++ ( To Antonio )

Postby lailton.webmaster » Sat Jul 25, 2009 2:58 pm

Antonio,
Estoy hacendo asi pero no aparece lo objeto activeX dentro del windows Ownd

o que devo hacer ?
Last edited by lailton.webmaster on Mon Jul 27, 2009 3:27 am, edited 1 time in total.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: C++ ( To Antonio )

Postby lailton.webmaster » Sat Jul 25, 2009 3:16 pm

Antonio ,

Yo alterei lo WS_OVERLAPPEDWINDOW por WS_VISIBLE pero la windows es create outside,
yo quero criar dentro dela windows semelhante la tua class tactivex.
Image
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: C++ ( To Antonio )

Postby Antonio Linares » Sat Jul 25, 2009 3:27 pm

Lailton,

You may use:

WS_CHILD | WS_VISIBLE,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: C++ ( To Antonio )

Postby lailton.webmaster » Sat Jul 25, 2009 4:50 pm

Antonio Now now show nothing ..
Last edited by lailton.webmaster on Mon Jul 27, 2009 3:28 am, edited 1 time in total.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: C++ ( To Antonio )

Postby Daniel Garcia-Gil » Sat Jul 25, 2009 5:15 pm

Hello Lailton

please try with...

Code: Select all  Expand view

hWndCtrl = CreateWindowEx(
   ( DWORD ) 0 , // nExStyle
   ( LPCTSTR ) "AtlAxWin" , // cClsName
   ( LPCTSTR ) hb_parc( 2 ) , // cProgId
   ( DWORD ) WS_CHILD | WS_VISIBLE, // style
   hb_parni( 3 ) , // nLeft
   hb_parni( 4 ) , // nTop
   hb_parni( 5 ) , // nWidth
   hb_parni( 6 ) , // nHeight
   ( HWND ) hb_parnl( 1 ) , // HWND_DESKTOP , // oParent:handle
0,
0,
NULL );
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: C++ ( To Antonio )

Postby lailton.webmaster » Sat Jul 25, 2009 6:08 pm

Perfect Daniel.

Now why oWnd:oClient:= oAct
give me ERROR ?

and you can say me how i make a function to make hide o object in C ??

exemple

oAct:Hide()

make object stay hide

can help ?

thanks os much.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: C++ ( To Antonio )

Postby Daniel Garcia-Gil » Sat Jul 25, 2009 6:21 pm

Lailton...
Change...

If ( ::hWnd := OLECREATEWIN( oWin, cProgId, nLeft, nTop, nWidth, nHeight) ) > 0

for If ( ::hWnd := OLECREATEWIN( oWin, cProgId, nLeft, nTop, nWidth, nHeight) ) != 0
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: C++ ( To Antonio )

Postby lailton.webmaster » Sat Jul 25, 2009 6:36 pm

i did it more yet I can´t use
oWnd:oClient:=oAct
ownd:oClient:=oAct:hWnd

2 show ERROR

Path and name: C:\Event\demo.exe (32 bits)
Size: 1,665,536 bytes
Time from start: 0 hours 0 mins 1 secs
Error occurred at: 07/25/09, 15:33:48
Error description: Error 16215416/3 DISP_E_MEMBERNOTFOUND: ADJCLIENT
Args:

Stack Calls
===========
Called from: source\rtl\win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Called from: => HB_EXECFROMARRAY(0)
Called from: MYACTIVEX.PRG => MYACTIVEX:ADJCLIENT(105)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:RESIZE(2078)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => SHOWWINDOW(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(935)
Called from: DEMO.PRG => MAIN(74)
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Language C ( To Antonio )

Postby Antonio Linares » Sun Jul 26, 2009 8:48 pm

Lailton,

Create the Class this way:

CLASS cActiveX FROM TControl
...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Language C ( To Antonio )

Postby lailton.webmaster » Sun Jul 26, 2009 10:18 pm

Antonio,

now show this error:

oWnd:oCLient:=oAct

Code: Select all  Expand view

Application
===========
   Path and name: C:\Event\demo.exe (32 bits)
   Size: 1,666,560 bytes
   Time from start: 0 hours 0 mins 0 secs
   Error occurred at: 07/26/09, 19:01:49
   Error description: Error BASE/1004  Class: 'NIL' has no exported method: OTOP
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => OTOP(0)
   Called from: .\source\classes\CONTROL.PRG => CACTIVEX:ADJCLIENT(256)
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:RESIZE(2078)
   Called from:  => TWINDOW:HANDLEEVENT(0)
   Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
   Called from:  => SHOWWINDOW(0)
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(935)
   Called from: DEMO.PRG => MAIN(73)
 


and

oWnd:oClient:= oAct:hWnd
Code: Select all  Expand view
Application
===========
   Path and name: C:\Event\demo.exe (32 bits)
   Size: 1,666,560 bytes
   Time from start: 0 hours 0 mins 2 secs
   Error occurred at: 07/26/09, 19:19:01
   Error description: Error BASE/1004  Class: 'NUMERIC' has no exported method: ADJCLIENT
   Args:
     [   1] = N   4653572

Stack Calls
===========
   Called from:  => ADJCLIENT(0)
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:RESIZE(2078)
   Called from:  => TWINDOW:HANDLEEVENT(0)
   Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
   Called from:  => SHOWWINDOW(0)
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(935)
   Called from: DEMO.PRG => MAIN(73)
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Language C ( To Antonio )

Postby Daniel Garcia-Gil » Sun Jul 26, 2009 10:59 pm

Lailton...

What do you return in method new?
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Language C ( To Antonio )

Postby Daniel Garcia-Gil » Sun Jul 26, 2009 11:31 pm

Lailton ...

You can see this post too

viewtopic.php?p=76632#p76632
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests