ToleAuto / OleWevent

ToleAuto / OleWevent

Postby lailton.webmaster » Sun Aug 16, 2009 2:58 am

SomeOne can help solve this problem...

It´OK.
Code: Select all  Expand view
#include "Fivewin.ch"
function main()
 public ownd, oOle
 public left:=0, Top:=0, Right:=0, Bottom:=0
 define window ownd
 oOle:=ToleAuto():new("Codejock.CommandBars.13.0.0")
 cToolA:=oOle:Invoke("Add","ToolBar", 0)
 cToolB:=oOle:Invoke("Add","ToolBar", 0)
 cToolC:=oOle:Invoke("Add","ToolBar", 0)
 OleInvoke(cToolB,"GetWindowRect",@Left, @Top, @Right, @Bottom)
 Activate Window oWnd
Return nil


Now trying use ToleWevent...

Code: Select all  Expand view
#include "Fivewin.ch"
function main()
 public ownd, oOle
 public left:=0, Top:=0, Right:=0, Bottom:=0
 define window ownd
 oOle:=oleWevent():new(oWnd,"Codejock.CommandBars.13.0.0")
 uOle:=oOle:oOle // <-- here is ToleAuto create in class OleWevent
 cToolA:=uOle:Invoke("Add","ToolBar", 0)
 cToolB:=uOle:Invoke("Add","ToolBar", 0)
 cToolC:=uOle:Invoke("Add","ToolBar", 0)
 OleInvoke(cToolB,"GetWindowRect",@Left, @Top, @Right, @Bottom) // error this line
 Activate Window oWnd
Return nil


Link Class ToleEvent:
http://www.redstarsoft.com.br/oOle.rar
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: ToleAuto / OleWevent

Postby Antonio Linares » Sun Aug 16, 2009 6:31 am

Lailton,

> OleInvoke(cToolB,"GetWindowRect",@Left, @Top, @Right, @Bottom) // error this line

What error do you get ?
regards, saludos

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

Re: ToleAuto / OleWevent

Postby lailton.webmaster » Sun Aug 16, 2009 3:39 pm

Antonio,

Image

I can´t understand because give me this erro. :?
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: ToleAuto / OleWevent

Postby Antonio Linares » Sun Aug 16, 2009 5:13 pm

Lailton,

Are you using Harbour or xHarbour ?

If Harbour, is it current SVN version ?
regards, saludos

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

Re: ToleAuto / OleWevent

Postby lailton.webmaster » Sun Aug 16, 2009 5:20 pm

Antonio,

yo uso somiente XHARBOUR

estoy con:
Fivewin 902 y xHarbour 1.1.0 + Bcc55

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

Re: ToleAuto / OleWevent

Postby Antonio Linares » Sun Aug 16, 2009 7:42 pm

Lailton,

If you remove "@" from this line:

OleInvoke(cToolB,"GetWindowRect",@Left, @Top, @Right, @Bottom)

do you still get the GPF ?
regards, saludos

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

Re: ToleAuto / OleWevent

Postby Antonio Linares » Sun Aug 16, 2009 7:53 pm

Lailton,

Please add this code to your PRG and try it again:
Code: Select all  Expand view

function OleInvoke( hObj, cMethod, ... )

#ifndef __XHARBOUR__
   return __ObjSendMsg( TOleAuto():New( hObj ), cMethod, ... )
#else  
   local aParams := hb_aParams()

   aParams[ 1 ] = TOleAuto():New( hObj )

   return hb_execFromArray( @__ObjSendMsg(), aParams )  
#endif

function OleSetProperty( hObj, cPropName, uValue )

return __ObjSendMsg( TOleAuto():New( hObj ), "_" + cPropName, uValue )

function OleGetProperty( hObj, cPropName )

return __ObjSendMsg( TOleAuto():New( hObj ), cPropName )
 
regards, saludos

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

Re: ToleAuto / OleWevent

Postby lailton.webmaster » Sun Aug 16, 2009 8:18 pm

Antonio,

Erro when i try compile...

Code: Select all  Expand view
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
OleWEvents0.c:
xHarbour Compiler build 1.1.0 (SimpLex) (Rev. 6195)
Copyright 1999-2008, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'DEMO.PRG'...

DEMO.PRG(18) Error E0030  Syntax error: "syntax error at '...'"

DEMO.PRG(23) Error E0004  LOCAL declaration follows executable statement

2 errors

No code generated
 


i need add someone include ?

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

Re: ToleAuto / OleWevent

Postby Antonio Linares » Sun Aug 16, 2009 8:23 pm

It seems as your xHarbour version does not support "...", more recent builds support it.

Just for a test, please replace "..." with "u1, u2, u3, u4"
regards, saludos

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

Re: ToleAuto / OleWevent

Postby lailton.webmaster » Sun Aug 16, 2009 8:27 pm

Antonio,

This erro now
Code: Select all  Expand view
Application
===========
   Path and name: C:\oOle\demo.exe (32 bits)
   Size: 1,662,976 bytes
   Time from start: 0 hours 0 mins 0 secs
   Error occurred at: 08/16/09, 17:26:21
   Error description: Error TOleAuto/-1  Invalid argument to contructor!: TOLEAUTO:NEW
   Args:
     [   1] = O   Object

Stack Calls
===========
   Called from:  => THROW(0)
   Called from: source\rtl\win32ole.prg => TOLEAUTO:NEW(373)
   Called from: DEMO.PRG => OLEINVOKE(25)
   Called from: DEMO.PRG => MAIN(12)
 


demo.prg
Code: Select all  Expand view
#include "Fivewin.ch"

function main()

 public ownd, oOle
 public Rb
 public left:=0, Top:=0, Right:=0, Bottom:=0
 define window ownd color 0,0
 oOle:=OleWEvent():new(ownd,"Codejock.CommandBars.13.0.0",0,0,oWnd:nRight,oWnd:nBottom)
 cToolA:=oOle:Add("ToolBar", 0)
 cToolB:=oOle:Add("ToolBar", 0)

 OleInvoke(cToolB,"GetWindowRect",@Left, @Top, @Right, @Bottom) // error this line
  // <-- error this line yet, toolbar is created OK more oleinvoke give me erro.
 Activate Window oWnd

Return nil

function OleInvoke( hObj, cMethod, u1, u2, u3, u4 )
return __ObjSendMsg( TOleAuto():New( hObj ), cMethod, u1, u2, u3, u4 )

function OleSetProperty( hObj, cPropName, uValue )
return __ObjSendMsg( TOleAuto():New( hObj ), "_" + cPropName, uValue )

function OleGetProperty( hObj, cPropName )
return __ObjSendMsg( TOleAuto():New( hObj ), cPropName )
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: ToleAuto / OleWevent

Postby Antonio Linares » Sun Aug 16, 2009 10:36 pm

Lailton,

Use it this way:

OleInvoke( cToolB:hObj, "GetWindowRect",@Left, @Top, @Right, @Bottom)
regards, saludos

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

Re: ToleAuto / OleWevent

Postby lailton.webmaster » Sun Aug 16, 2009 10:53 pm

Antonio,

Code: Select all  Expand view
Application
===========
   Path and name: C:\oOle\demo.exe (32 bits)
   Size: 1,662,976 bytes
   Time from start: 0 hours 0 mins 0 secs
   Error occurred at: 08/16/09, 19:53:55
   Error description: Error 16507216/3  DISP_E_MEMBERNOTFOUND: GETWINDOWRECT
   Args:
     [   1] = N   0
     [   2] = N   0
     [   3] = N   0
     [   4] = N   0

Stack Calls
===========
   Called from: source\rtl\win32ole.prg => TOLEAUTO:GETWINDOWRECT(0)
   Called from:  => __OBJSENDMSG(0)
   Called from: DEMO.PRG => OLEINVOKE(22)
   Called from: DEMO.PRG => MAIN(14)


PRG
Code: Select all  Expand view
#include "Fivewin.ch"

function main()

 public ownd, oOle
 public Rb
 public left:=0, Top:=0, Right:=0, Bottom:=0
 define window ownd color 0,0
 oOle:=OleWEvent():new(ownd,"Codejock.CommandBars.13.0.0",0,0,oWnd:nRight,oWnd:nBottom)

 cToolA:=oOle:Add("ToolBar", 0)
 cToolB:=oOle:Add("ToolBar", 0)

 OleInvoke( cToolB:hObj, "GetWindowRect",@Left, @Top, @Right, @Bottom)

 Activate Window oWnd

Return nil

function OleInvoke( hObj, cMethod, ua1, ua2, ua3, ua4 )
return __ObjSendMsg( TOleAuto():New( hObj ), cMethod, ua1, ua2, ua3, ua4 )

function OleSetProperty( hObj, cPropName, uValue )
return __ObjSendMsg( TOleAuto():New( hObj ), "_" + cPropName, uValue )

function OleGetProperty( hObj, cPropName )
return __ObjSendMsg( TOleAuto():New( hObj ), cPropName )
 


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

Re: ToleAuto / OleWevent

Postby Antonio Linares » Sun Aug 16, 2009 11:06 pm

Please try this with both FWH TActiveX and your Class:

MsgInfo( cToolB:cClassName )

Lets see if they are the same object class.
regards, saludos

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

Re: ToleAuto / OleWevent

Postby lailton.webmaster » Sun Aug 16, 2009 11:23 pm

OleWevent -> 16467048:ADD
TactiveX -> 16439752

Code: Select all  Expand view
#include "Fivewin.ch"
function main()
 public ownd, oOle
 public left:=0, Top:=0, Right:=0, Bottom:=0
 define window ownd color 0,0
// oOle:=OleWEvent():new(ownd,"Codejock.CommandBars.13.0.0",0,0,oWnd:nRight,oWnd:nBottom)
 oOle:=TactiveX():New(ownd,"Codejock.CommandBarsFrame.13.0.0")
 cToolA:=oOle:Do("Add","ToolBar",0)
 cToolB:=oOle:Do("Add","ToolBar",0)
 cToolB:GetWindowRect(@Left, @Top, @Right, @Bottom) // <-- funciona bem
 MsgInfo( cToolB:cClassName )

 Activate Window oWnd

Return nil

/*
function OleInvoke( hObj, cMethod, ua1, ua2, ua3, ua4 )
return __ObjSendMsg( TOleAuto():New( hObj ), cMethod, ua1, ua2, ua3, ua4)

function OleSetProperty( hObj, cPropName, uValue )
return __ObjSendMsg( TOleAuto():New( hObj ), "_" + cPropName, uValue )

function OleGetProperty( hObj, cPropName )
return __ObjSendMsg( TOleAuto():New( hObj ), cPropName )
*/


I can´t understand why i need use "Codejock.CommandBars.13.0.0" in OleWevent and
"Codejock.CommandBarsFrame.13.0.0" in TactiveX

if i use "Codejock.CommandBarsFrame.13.0.0" in OleWevent give me erro.. and if
i use "Codejock.CommandBars.13.0.0" in TactiveX give me erro.. :? :cry:
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: ToleAuto / OleWevent

Postby Antonio Linares » Sun Aug 16, 2009 11:32 pm

Lailton,

> if i use "Codejock.CommandBarsFrame.13.0.0" in OleWevent give me erro..

What error is it ?
regards, saludos

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 102 guests