druzus wrote: > > Log Message: > ----------- > 2010-05-26 00:03 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) > * harbour/contrib/hbwin/Makefile > + harbour/contrib/hbwin/hbolesrv.c > + added inproc OLE server implementation. It allows to create > OLE/ACTIVEX > COM server in Harbour. Such OLE server allows can be used by > programs > written in any languages supporting OLE automation (also in other > Harbour applications) >
Thank you for this great contribution once again. Here is my Vouch32 ActiveX Server code compiled with xhb.com: ------------------------------------------- //-------------------------------------------------------------------// //-------------------------------------------------------------------// //-------------------------------------------------------------------// // // Vouch32 Active-X Dll // //-------------------------------------------------------------------// //-------------------------------------------------------------------// //-------------------------------------------------------------------// #pragma BEGINDUMP #define CLS_Name "Vouch32.Vouch.1" #define CLS_ID "{1F6C0963-1581-498a-9035-E75A0F546CA5}" const char *g_RegTable[][3] = { //format is {key, value name, value } { "CLSID\\" CLS_ID, 0, CLS_Name }, { "CLSID\\" CLS_ID "\\InprocServer32", 0, (const char*) -1 }, { "CLSID\\" CLS_ID "\\InprocServer32", "ThreadingModel", "Apartment" }, { "CLSID\\" CLS_ID "\\ProgId", 0, CLS_Name }, { CLS_Name, 0, CLS_Name }, { CLS_Name "\\CLSID", 0, CLS_ID } }; BOOL IsExportedSymbol( PHB_DYNS pDyn ) { if( pDyn->pSymbol >= symbols && pDyn->pSymbol <= symbols + ( sizeof( symbols ) / sizeof( HB_SYMB ) ) ) { return TRUE; } return FALSE; } PHB_SYMB OleServerSymbols( USHORT *puiSymbols ) { *puiSymbols = (USHORT) ( sizeof( symbols ) / sizeof( HB_SYMB ) ); return symbols; } #pragma ENDDUMP //-------------------------------------------------------------------// REQUEST HB_GT_NUL //-------------------------------------------------------------------// #define DLL_PROCESS_ATTACH 1 #define DLL_PROCESS_DETACH 0 //-------------------------------------------------------------------// PROCEDURE DllMain( hInstance, nReason ) Local Instance := hInstance SWITCH nReason CASE DLL_PROCESS_ATTACH Vwn_OutputDebugString( "Dll Loaded." ) EXIT CASE DLL_PROCESS_DETACH Vwn_OutputDebugString( "Dll UNloaded." ) EXIT DEFAULT Vwn_OutputDebugString( "UNEXPECTED nReaon in DllMain!" ) END RETURN //-------------------------------------------------------------------// FUNCTION CreateInstance() LOCAL oOleServer := Vouch32ActiveX() ErrorBlock( {|e| Break( e ) } ) Return oOleServer //-------------------------------------------------------------------// Procedure GtSys() Return //-------------------------------------------------------------------// #include "hbclass.ch" #include "common.ch" #include 'fileio.ch' //-------------------------------------------------------------------// CLASS Vouch32ActiveX METHOD Vouch32Miscll() METHOD Vouch32SetClientConsole() METHOD Vouch32ServerPath() METHOD Vouch32SetLicenseKey() 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 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() //-------------------------------------------------------------------// Though I can makeout from olesrv1.prg how to convert, can you quicky tell me how I construct the hash array to populate method calls as objects on ole instance ? ----- 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-tp5100733p5100880.html Sent from the harbour-devel mailing list archive at Nabble.com. _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour