ActiveX VB with xHarbour

Postby areang » Sat Aug 19, 2006 12:20 am

Antonio.

oWnd:setText( "Use JcFrames from CoolControls.ocx" )

oFrames := Framesx():New( oWnd,,10,20,200,200 )

@100,100 BUTTON "Save" size 60,20 of oWnd pixel action MsgAlert("Save")
-> This Button draw on area oFrames, when I clicked "Save" button still no action.

By the way !
This is my first class to learn more class with OCX, but to hard for me.
I want to try with own function to draw the frames.

Thank Antonio for help.

Best Regard
Areang
areang
 
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Postby Antonio Linares » Sat Aug 19, 2006 12:29 am

Areang,

You should change Method HandleEvent() in Class TActiveX and check if WM_COMMAND value is received when the button is clicked.
regards, saludos

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

Postby areang » Sat Aug 19, 2006 12:57 am

Antonio,

Is this that you mean ?

METHOD OnEvent( nEvent, aParams, pParams ) CLASS TActiveX

local nAt := AScan( ::aEvents, { | aEvent | aEvent[ 2 ] == nEvent } )
local cEvent := If( nAt != 0, ::aEvents[ nAt ][ 1 ], "" )

if ! Empty( ::bOnEvent )
Eval( ::bOnEvent, If( ! Empty( cEvent ), cEvent, nEvent ), aParams, pParams )
endif

return nil

Antonio,

Can you give me information about this :

1. I have xHB from xHarbour.com patrick mask, Is your there too ?
2. I used xBuildW for my compiler.
3. Can I use the others compiler ?
4. When I used BCC55 or MSVC to many errors.

Please help me ! :(

Many Thanks again.

Best Regard
Areang
areang
 
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Postby areang » Sat Aug 19, 2006 3:14 am

_,

Yes I Can see on TRMChartX class.

This is not handle event for the control of windows, just for drawing.

Is'nt it ? :lol:


Thanks
Best Regard
Areang
areang
 
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Postby Antonio Linares » Sat Aug 19, 2006 6:58 am

Areang,

> 1. I have xHB from xHarbour.com patrick mask, Is your there too ?

FWH is fully compatible with Harbour, xHarbour and xHarbour.com

> 3. Can I use the others compiler ?

Yes,

> 4. When I used BCC55 or MSVC to many errors.

What errors do you get ?
regards, saludos

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

Postby areang » Sun Aug 20, 2006 7:53 am

Antonio,

Please Help me !

1. I used xHB and xBuildW compiler, no Activex.lib get error :


Application
===========
Path and name: D:\NewHarbour\OCX\codejock\test.exe (32 bits)
Size: 1,546,240 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 08/20/06, 14:46:13
Error description: Error BASE/1004 Class: 'NUMERIC' has no exported method: HWND
Args:

Stack Calls
===========
Called from: => HWND(0)
Called from: TActiveX.prg => TACTIVEX:NEW(0)
Called from: TActiveX.prg => CREATEACTIVEX(184)
Called from: TActiveX.prg => TACTIVEX:NEW(0)
Called from: test.prg => MAIN(13)


2. I used xHB and xBuildW compiler, with Activex.lib from xHB\lib still error :

Application
===========
Path and name: D:\NewHarbour\OCX\codejock\test.exe (32 bits)
Size: 1,534,976 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 08/20/06, 14:51:47
Error description: Error BASE/7001 EmbedObject failed!: __CREATEACTIVEX
Args:
[ 1] = N 1640128
[ 2] = C Codejock.CommandBarsFrame.10.2
[ 3] = N -4
[ 4] = U

Stack Calls
===========
Called from: => THROW(0)
Called from: TActiveX.prg => TACTIVEX:NEW(59)
Called from: test.prg => MAIN(13)


Thanks
Best Regard
Areang
areang
 
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Postby Antonio Linares » Sun Aug 20, 2006 8:00 am

Areang,

Use this at the top of your main PRG:

REQUEST TACTIVEX
regards, saludos

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

Postby areang » Sun Aug 20, 2006 10:17 am

Antonio,
:cry: my eye tires is empty for this.

--> Please Help me, to understand ActiveX viewed by Oleview:
[
uuid(555E8FCC-830E-45CC-AF00-A012D5AE7451),
version(10.1),
helpstring("Xtreme CommandBars ActiveX Control 10.1"),
helpfile("SymbolReference.chm"),
helpcontext(0x000004d1),
custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 83951780),
custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1145655562)

]
library XtremeCommandBars




IF !IsActiveX( "{555E8FCC-830E-45CC-AF00-A012D5AE7451}" )
--> it's good.
ENDIF

Can I call :
oCommandBars = TActiveX():New( oWnd, "{555E8FCC-830E-45CC-AF00-A012D5AE7451}" )
or
oCommandBars = TActiveX():New( oWnd, "XtremeCommandBars.CommandBarsFrame" )

oCommandBars:SetSize( 200, 100 )

// Set RibbonBar = CommandBars.AddRibbonBar("The Ribbon")
oRibbonBar = oCommandBars:Do( "AddRibbonBar", "The Ribbon" )

// Set TabWrite = RibbonBar.InsertTab(0, "Writ&e")
oTabWrite = OleInvoke( oRibbonBar, "InsertTab", 0, "Writ&e" )

// TabWrite.Id = ID_TAB_WRITE
OleSetProperty( oTabWrite, "Id", ID_TAB_WRITE )

// Set GroupClipborad = TabWrite.Groups.AddGroup("&Clipboard", ID_GROUP_CLIPBOARD)
oGroups = OleGetProperty( oTabWrite, "Groups" )
oGroupClipborad = OleInvoke( oGroups, "AddGroup", "&Clipboard", ID_GROUP_CLIPBOARD )

// A numeric value different from zero shows that it is a valid handle

MsgInfo( oGroupClipborad )

ACTIVATE WINDOW oWnd

--> Get error :
pplication
===========
Path and name: D:\NewHarbour\codejock\test.exe (32 bits)
Size: 1,543,680 bytes
Time from start: 0 hours 0 mins 1 secs
Error occurred at: 08/20/06, 17:14:39
Error description: Error BASE/7001 EmbedObject failed!: __CREATEACTIVEX
Args:
[ 1] = N 854254
[ 2] = C XtremeCommandBars.CommandBarsFrame
[ 3] = N -4
[ 4] = U

Stack Calls
===========
Called from: => THROW(0)
Called from: TActiveX.prg => TACTIVEX:NEW(59)
Called from: test.prg => MAIN(53)

System
======
CPU type: Intel(R) Pentium(R) 4 CPU 2.66GHz 2666 Mhz
Hardware memory: 511 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Compiler version: xHarbour build 0.99.61 Intl. (SimpLex)
Windows version: 5.1, Build 2600 Service Pack 2

Windows total applications running: 0

Variables in use
================
Procedure Type Value
==========================
THROW
Param 1: O Class: ERROR
Local 1: U
Local 2: N 0
TACTIVEX:NEW
Param 1: N 854254
Param 2: C "XtremeCommandBars.CommandBarsFrame"
Local 1: N -4
Local 2: U
Local 3: O Class: TACTIVEX
Local 4: O Class: ERROR
Local 5: U
Local 6: U
MAIN
Local 1: O Class: TWINDOW
Local 2: U
Local 3: U
Local 4: U
Local 5: U
Local 6: U
Local 7: U
Local 8: U

Linked RDDs
===========
DBF
DBFFPT
DBFNTX
DBFBLOB

DataBases in use
================

Classes in use:
===============
1 HBCLASS
2 HBOBJECT
3 TWINDOW
4 TBRUSH
5 TFONT
6 TOLEAUTO
7 TACTIVEX
8 ERROR
9 TREG32

Memory Analysis
===============
125 Static variables

Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes


Areang :cry:
areang
 
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Postby Antonio Linares » Sun Aug 20, 2006 11:05 am

Areang,

Have you placed REQUEST TACTIVEX at the top of your main PRG ?

Are you using xHarbour builder ?
regards, saludos

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

Postby areang » Sun Aug 20, 2006 11:12 am

Antonio,


REQUEST TACTIVEX

#include "FiveWin.ch"

#define ID_TAB_WRITE 5004
#define ID_GROUP_CLIPBOARD 5001

function Main()

local oWnd, oCommandBars, oRibbonBar, oTabWrite, oGroups, oGroupClipborad

LOCAL cOriginal, cDestination

IF !IsActiveX( "{555E8FCC-830E-45CC-AF00-A012D5AE7451}" )

MsgAlert("Not Active")

cOriginal := "commandbars.ocx"
cDestination := GetSysDir() + "\commandbars.ocx"

IF !File( cOriginal )
MsgAlert(cOriginal+" file not found")
RETURN NIL
ENDIF

if !File((cDestination))
Copy File &cOriginal TO &cDestination
endif

if File((cDestination))
WinExec( "REGSVR32 " + cDestination + " /s" )
else
MsgAlert("File "+cDestination+" Not Found")
return nil
endif


IF !IsActiveX( "{555E8FCC-830E-45CC-AF00-A012D5AE7451}" )
MsgInfo( "Error to Register "+cOriginal+" File" )
return nil
ENDIF
else
MsgAlert("Is Active")
endif

DEFINE WINDOW oWnd

// Begin XtremeCommandBars.CommandBars CommandBars


// oCommandBars = TActiveX():New( oWnd, "{555E8FCC-830E-45CC-AF00-A012D5AE7451}" )

oCommandBars = TActiveX():New( oWnd, "XtremeCommandBars.CommandBarsFrame" )

oCommandBars:SetSize( 200, 100 )

// Set RibbonBar = CommandBars.AddRibbonBar("The Ribbon")
oRibbonBar = oCommandBars:Do( "AddRibbonBar", "The Ribbon" )

// Set TabWrite = RibbonBar.InsertTab(0, "Writ&e")
oTabWrite = OleInvoke( oRibbonBar, "InsertTab", 0, "Writ&e" )

// TabWrite.Id = ID_TAB_WRITE
OleSetProperty( oTabWrite, "Id", ID_TAB_WRITE )

// Set GroupClipborad = TabWrite.Groups.AddGroup("&Clipboard", ID_GROUP_CLIPBOARD)
oGroups = OleGetProperty( oTabWrite, "Groups" )
oGroupClipborad = OleInvoke( oGroups, "AddGroup", "&Clipboard", ID_GROUP_CLIPBOARD )

// A numeric value different from zero shows that it is a valid handle

MsgInfo( oGroupClipborad )

ACTIVATE WINDOW oWnd

return nil


Areang
areang
 
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Postby Antonio Linares » Sun Aug 20, 2006 11:46 am

Areang,

Are you using xHarbour builder ?
regards, saludos

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

Postby areang » Mon Aug 21, 2006 5:14 am

Antonio,

I used xBuildW from xHarbour.com

Areang
areang
 
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Postby Antonio Linares » Mon Aug 21, 2006 7:18 am

Areang,

"XtremeCommandBars.CommandBarsFrame" is a very complex ActiveX.

We would suggest you to start with easier ones, and try with this one later on.
regards, saludos

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

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 85 guests