hi,
i try some ActiveX Sample and saw CLASS TActiveX in c:\fwh\source\classes\activex.prg
there is a Function ActXEvents() but i can't find it
HB_FUNC( ACTXEVENTS )
{
LPWSTR pW = AnsiToWide( ( char * ) hb_parc( 1 ) );
ITypeInfo * ptinfo;
ITypeLib * ptlib;
IUnknown * pUnk = hb_oleParam( 2 );
IProvideClassInfo2 * ppci2;
GUID guid;
if( LoadTypeLib( pW, &ptlib ) != S_OK )
{
hb_xfree( pW );
return;
}
else
hb_xfree( pW );
if( ! pUnk->QueryInterface( IID_IProvideClassInfo2,
( void ** ) &ppci2 ) == S_OK )
return;
ppci2->GetGUID( GUIDKIND_DEFAULT_SOURCE_DISP_IID, &guid );
ppci2->Release();
if( ptlib->GetTypeInfoOfGuid( guid, &ptinfo ) == S_OK )
{
FUNCDESC * pfdesc;
BSTR bsName;
LPSTR cName;
LPWSTR pW2;
TYPEATTR * ptattr;
ptinfo->GetTypeAttr( &ptattr );
hb_reta( 0 );
for( WORD w = 0; w < ptattr->cFuncs; w++ )
{
PHB_ITEM pSubarray = hb_itemArrayNew( 2 );
PHB_ITEM pName, pItem;
ptinfo->GetFuncDesc( w, &pfdesc );
ptinfo->GetDocumentation( pfdesc->memid, &bsName, NULL, NULL, NULL );
cName = WideToAnsi( bsName );
hb_arraySet( pSubarray, 1, hb_itemPutC( NULL, cName ) );
hb_arraySet( pSubarray, 2, hb_itemPutNL( NULL, pfdesc->memid ) );
hb_arrayAdd( hb_param( -1, HB_IT_ANY ), pSubarray );
hb_xfree( cName );
ptinfo->ReleaseFuncDesc( pfdesc );
hb_itemRelease( pSubarray );
}
}
else
MessageBox( 0, "can't read types from ActiveX", "error", 0 );
}
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 86 guests