Hello Przemek
Below is the converted code which registers itself successfully.
---------------------------------------------
#define CLS_Name "Vouch32.Vouch.1"
#define CLS_ID "{1F6C0963-1581-498a-9035-E75A0F546CA5}"
//-------------------------------------------------------------------//
PROCEDURE DllMain()
WIN_OleServerInit( CLS_ID, CLS_Name, {|| Vouch32ActiveX():new() }, .t. )
RETURN
//-------------------------------------------------------------------//
ANNOUNCE GT_SYS
REQUEST HB_GT_GUI_DEFAULT
//-------------------------------------------------------------------//
#include "hbclass.ch"
#include "common.ch"
#include 'fileio.ch'
#define MAX_KEYS 25
#translate F_LEN(<n>) => FSEEK(<n>, FS_SET, FS_END)
#translate F_BOF(<n>) => FSEEK(<n>, FS_SET)
#translate F_MOVE(<n>) => FSEEK(<n>, FS_SET, FS_RELATIVE)
//-------------------------------------------------------------------//
CLASS Vouch32ActiveX
METHOD new()
METHOD Vouch32Miscll( nMode )
METHOD Vouch32SetClientConsole()
METHOD Vouch32ServerPath()
METHOD Vouch32SetLicenseKey( cKey )
METHOD Vouch32PrintServer()
METHOD Vouch32CommServer()
METHOD Vouch32GraphicsServer()
METHOD Vouch32TapiServer()
METHOD Vouch32SmsServer()
METHOD Vouch32SmtpServerT() // Tip Based SMTP Server
METHOD Vouch32PopServerT() // Tip Based POP Server
METHOD Vouch32FtpServerT()
METHOD Vouch32ReportServer()
METHOD Vouch32ReportColumn()
METHOD Vouch32PdfServer()
METHOD Vouch32FtpServerI() VIRTUAL
METHOD Vouch32HttpServerI() VIRTUAL
METHOD Vouch32PopServerS() VIRTUAL
METHOD Vouch32ShellServer() VIRTUAL
METHOD Vouch32UtilityServer()
ENDCLASS
//-------------------------------------------------------------------//
METHOD new() CLASS Vouch32ActiveX
RETURN Self
//-------------------------------------------------------------------//
METHOD Vouch32SetClientConsole() CLASS Vouch32ActiveX
Return V32SetClient( .t. )
//-------------------------------------------------------------------//
METHOD Vouch32ServerPath() CLASS Vouch32ActiveX
Local c
c := Vwn_GetModuleFileName( Vwn_GetModuleHandle() )
c := substr( c,1,rat( '\',c )-1 )
Return c
//-------------------------------------------------------------------//
METHOD Vouch32SetLicenseKey( cKey ) CLASS Vouch32ActiveX
VouchSetLicKey( cKey )
Return Self
//-------------------------------------------------------------------//
METHOD Vouch32PrintServer() CLASS Vouch32ActiveX
Return V32PrintPreview()
//-------------------------------------------------------------------//
METHOD Vouch32CommServer() CLASS Vouch32ActiveX
Return V32CommServer()
//-------------------------------------------------------------------//
METHOD Vouch32GraphicsServer() CLASS Vouch32ActiveX
Return V32Charts()
//-------------------------------------------------------------------//
METHOD Vouch32TapiServer() CLASS Vouch32ActiveX
#ifndef __NOTAPI__
Return V32Tapi()
#else
Return NIL
#endif
//-------------------------------------------------------------------//
METHOD Vouch32SmsServer() CLASS Vouch32ActiveX
Return V32Sms()
//-------------------------------------------------------------------//
METHOD Vouch32PopServerT() CLASS Vouch32ActiveX
Return V32PopServerT()
//-------------------------------------------------------------------//
METHOD Vouch32SmtpServerT() CLASS Vouch32ActiveX
Return V32SmtpServerT()
//-------------------------------------------------------------------//
METHOD Vouch32FtpServerT() CLASS Vouch32ActiveX
Return V32FtpServerT()
//-------------------------------------------------------------------//
METHOD Vouch32ReportServer() CLASS Vouch32ActiveX
Return V32PrintReport()
//-------------------------------------------------------------------//
METHOD Vouch32ReportColumn() CLASS Vouch32ActiveX
Return V32ReportColumn()
//-------------------------------------------------------------------//
METHOD Vouch32Miscll( nMode ) CLASS Vouch32ActiveX
Local xVal
do case
case nMode == 9045
xVal := V320000001()
endcase
Return xVal
//-------------------------------------------------------------------//
METHOD Vouch32PdfServer() CLASS Vouch32ActiveX
Return V32PdfServer()
//-------------------------------------------------------------------//
METHOD Vouch32UtilityServer()
Return V32UtilityServer()
//-------------------------------------------------------------------//
But the problem is when I am accessing its methods as such:
Function Main()
Local oGraph, oServer
if !( CreateVouch32( @oServer ) )
Return nil
endif
oGraph := oServer:Vouch32GraphicsServer() /* IT IS OK HERE */
oGraph:Create() /* RTE - See Below */
oGraph:Destroy()
Return nil
FUNCTION CreateVouch32( @oServer )
TRY
oServer := GetActiveObject( cServer )
CATCH
TRY
oServer := CreateObject( cServer )
CATCH
alert( ValToPrg( "ERROR! " + cServer + " not avialable. [" +
Ole2TxtError()+ "]" ) )
Return .f.
END
END
return .t.
------------------------------------------
Error BASE/1004 Message not found: VOUCH32ACTIVEX:EVAL
Called from __ERRRT_SBASE(0) Server
Called from VOUCH32ACTIVEX:ERROR(0) nication
Called from (b)HBOBJECT(0) ial Communication II
Called from VOUCH32ACTIVEX:MSGNOTFOUND(0)
Called from (b)EVAL(0) SMTP Server
Error BASE/1004 Message not found: VOUCH32ACTIVEX:EVAL
Called from __ERRRT_SBASE(0) t Generator
Called from VOUCH32ACTIVEX:ERROR(0) rver
Called from (b)HBOBJECT(0)
Called from VOUCH32ACTIVEX:MSGNOTFOUND(0)
Called from (b)EVAL(0)
Error BASE/1004 Message not found: VOUCH32ACTIVEX:EVAL
Called from __ERRRT_SBASE(0)
Called from VOUCH32ACTIVEX:ERROR(0)
Called from (b)HBOBJECT(0)
Called from VOUCH32ACTIVEX:MSGNOTFOUND(0)
Called from (b)EVAL(0)
-------------------------------------------------------------------------
VOUCH32ACTIVEX:EVAL method is not there,
and actually it is not there.
It is really quick compile and test phase, and hence
is prone to few mistakes. I did not read your predeeding message yet.
-----
enjoy hbIDEing...
Pritpal Bedi
http://hbide.vouch.info/
--
View this message in context:
http://harbour-devel.1590103.n2.nabble.com/SF-net-SVN-harbour-project-14593-trunk-harbour-tp5100733p5101237.html
Sent from the harbour-devel mailing list archive at Nabble.com.
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour