Saber Metodos de un CREATEOBJECT

Re: Saber Metodos de un CREATEOBJECT

Postby Antonio Linares » Mon May 13, 2013 5:44 am

Inspeccionando "CDO.Message"

http://www.paulsadowski.com/wsh/cdo.htm

STDCALL dispatch FUNC void QueryInterface( [in] PTR, [out] PTR )
STDCALL dispatch FUNC unsigned long AddRef()
STDCALL dispatch FUNC unsigned long Release()
STDCALL dispatch FUNC void GetTypeInfoCount( [out] PTR )
STDCALL dispatch FUNC void GetTypeInfo( [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void GetIDsOfNames( [in] PTR, [in] PTR, [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void Invoke( [in] int, [in] PTR, [in] unsigned long, [in] unsigned short, [in] PTR, [out] PTR, [out] PTR, [out] PTR )
STDCALL dispatch PROPERTYGET BSTR BCC()
STDCALL dispatch PROPERTYPUT void BCC( [in] BSTR )
STDCALL dispatch PROPERTYGET BSTR CC()
STDCALL dispatch PROPERTYPUT void CC( [in] BSTR )
STDCALL dispatch PROPERTYGET BSTR FollowUpTo()
STDCALL dispatch PROPERTYPUT void FollowUpTo( [in] BSTR )
STDCALL dispatch PROPERTYGET BSTR From()
STDCALL dispatch PROPERTYPUT void From( [in] BSTR )
STDCALL dispatch PROPERTYGET BSTR Keywords()
STDCALL dispatch PROPERTYPUT void Keywords( [in] BSTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL MimeFormatted()
STDCALL dispatch PROPERTYPUT void MimeFormatted( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET BSTR Newsgroups()
STDCALL dispatch PROPERTYPUT void Newsgroups( [in] BSTR )
STDCALL dispatch PROPERTYGET BSTR Organization()
STDCALL dispatch PROPERTYPUT void Organization( [in] BSTR )
STDCALL dispatch PROPERTYGET DATE ReceivedTime()
STDCALL dispatch PROPERTYGET BSTR ReplyTo()
STDCALL dispatch PROPERTYPUT void ReplyTo( [in] BSTR )
STDCALL dispatch PROPERTYGET USERDEFINED DSNOptions()
STDCALL dispatch PROPERTYPUT void DSNOptions( [in] USERDEFINED )
STDCALL dispatch PROPERTYGET DATE SentOn()
STDCALL dispatch PROPERTYGET BSTR Subject()
STDCALL dispatch PROPERTYPUT void Subject( [in] BSTR )
STDCALL dispatch PROPERTYGET BSTR To()
STDCALL dispatch PROPERTYPUT void To( [in] BSTR )
STDCALL dispatch PROPERTYGET BSTR TextBody()
STDCALL dispatch PROPERTYPUT void TextBody( [in] BSTR )
STDCALL dispatch PROPERTYGET BSTR HTMLBody()
STDCALL dispatch PROPERTYPUT void HTMLBody( [in] BSTR )
STDCALL dispatch PROPERTYGET PTR Attachments()
STDCALL dispatch PROPERTYGET BSTR Sender()
STDCALL dispatch PROPERTYPUT void Sender( [in] BSTR )
STDCALL dispatch PROPERTYGET PTR Configuration()
STDCALL dispatch PROPERTYPUT void Configuration( [in] PTR )
STDCALL dispatch PROPERTYPUTREF void Configuration( [in] PTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL AutoGenerateTextBody()
STDCALL dispatch PROPERTYPUT void AutoGenerateTextBody( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET PTR EnvelopeFields()
STDCALL dispatch PROPERTYGET PTR TextBodyPart()
STDCALL dispatch PROPERTYGET PTR HTMLBodyPart()
STDCALL dispatch PROPERTYGET PTR BodyPart()
STDCALL dispatch PROPERTYGET PTR DataSource()
STDCALL dispatch PROPERTYGET PTR Fields()
STDCALL dispatch PROPERTYGET VARIANT_BOOL MDNRequested()
STDCALL dispatch PROPERTYPUT void MDNRequested( [in] VARIANT_BOOL )
STDCALL dispatch FUNC PTR AddRelatedBodyPart( [in] BSTR, [in] BSTR, [in] USERDEFINED, [optional] BSTR, [optional] BSTR )
STDCALL dispatch FUNC PTR AddAttachment( [in] BSTR, [optional] BSTR, [optional] BSTR )
STDCALL dispatch FUNC void CreateMHTMLBody( [in] BSTR, [defaultvalue] USERDEFINED, [optional] BSTR, [optional] BSTR )
STDCALL dispatch FUNC PTR Forward()
STDCALL dispatch FUNC void Post()
STDCALL dispatch FUNC PTR PostReply()
STDCALL dispatch FUNC PTR Reply()
STDCALL dispatch FUNC PTR ReplyAll()
STDCALL dispatch FUNC void Send()
STDCALL dispatch FUNC PTR GetStream()
STDCALL dispatch FUNC IDispatch GetInterface( [in] BSTR )
regards, saludos

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

Re: Saber Metodos de un CREATEOBJECT

Postby Antonio Linares » Mon May 13, 2013 5:48 am

Inspeccionando "Microsoft.XmlDom"

STDCALL dispatch FUNC void QueryInterface( [in] PTR, [out] PTR )
STDCALL dispatch FUNC unsigned long AddRef()
STDCALL dispatch FUNC unsigned long Release()
STDCALL dispatch FUNC void GetTypeInfoCount( [out] PTR )
STDCALL dispatch FUNC void GetTypeInfo( [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void GetIDsOfNames( [in] PTR, [in] PTR, [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void Invoke( [in] int, [in] PTR, [in] unsigned long, [in] unsigned short, [in] PTR, [out] PTR, [out] PTR, [out] PTR )
STDCALL dispatch PROPERTYGET BSTR nodeName()
STDCALL dispatch PROPERTYGET VARIANT nodeValue()
STDCALL dispatch PROPERTYPUT void nodeValue( [in] VARIANT )
STDCALL dispatch PROPERTYGET USERDEFINED nodeType()
STDCALL dispatch PROPERTYGET PTR parentNode()
STDCALL dispatch PROPERTYGET PTR childNodes()
STDCALL dispatch PROPERTYGET PTR firstChild()
STDCALL dispatch PROPERTYGET PTR lastChild()
STDCALL dispatch PROPERTYGET PTR previousSibling()
STDCALL dispatch PROPERTYGET PTR nextSibling()
STDCALL dispatch PROPERTYGET PTR attributes()
STDCALL dispatch FUNC PTR insertBefore( [in] PTR, [in] VARIANT )
STDCALL dispatch FUNC PTR replaceChild( [in] PTR, [in] PTR )
STDCALL dispatch FUNC PTR removeChild( [in] PTR )
STDCALL dispatch FUNC PTR appendChild( [in] PTR )
STDCALL dispatch FUNC VARIANT_BOOL hasChildNodes()
STDCALL dispatch PROPERTYGET PTR ownerDocument()
STDCALL dispatch FUNC PTR cloneNode( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET BSTR nodeTypeString()
STDCALL dispatch PROPERTYGET BSTR text()
STDCALL dispatch PROPERTYPUT void text( [in] BSTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL specified()
STDCALL dispatch PROPERTYGET PTR definition()
STDCALL dispatch PROPERTYGET VARIANT nodeTypedValue()
STDCALL dispatch PROPERTYPUT void nodeTypedValue( [in] VARIANT )
STDCALL dispatch PROPERTYGET VARIANT dataType()
STDCALL dispatch PROPERTYPUT void dataType( [in] BSTR )
STDCALL dispatch PROPERTYGET BSTR xml()
STDCALL dispatch FUNC BSTR transformNode( [in] PTR )
STDCALL dispatch FUNC PTR selectNodes( [in] BSTR )
STDCALL dispatch FUNC PTR selectSingleNode( [in] BSTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL parsed()
STDCALL dispatch PROPERTYGET BSTR namespaceURI()
STDCALL dispatch PROPERTYGET BSTR prefix()
STDCALL dispatch PROPERTYGET BSTR baseName()
STDCALL dispatch FUNC void transformNodeToObject( [in] PTR, [in] VARIANT )
STDCALL dispatch PROPERTYGET PTR doctype()
STDCALL dispatch PROPERTYGET PTR implementation()
STDCALL dispatch PROPERTYGET PTR documentElement()
STDCALL dispatch PROPERTYPUTREF void documentElement( [in] PTR )
STDCALL dispatch FUNC PTR createElement( [in] BSTR )
STDCALL dispatch FUNC PTR createDocumentFragment()
STDCALL dispatch FUNC PTR createTextNode( [in] BSTR )
STDCALL dispatch FUNC PTR createComment( [in] BSTR )
STDCALL dispatch FUNC PTR createCDATASection( [in] BSTR )
STDCALL dispatch FUNC PTR createProcessingInstruction( [in] BSTR, [in] BSTR )
STDCALL dispatch FUNC PTR createAttribute( [in] BSTR )
STDCALL dispatch FUNC PTR createEntityReference( [in] BSTR )
STDCALL dispatch FUNC PTR getElementsByTagName( [in] BSTR )
STDCALL dispatch FUNC PTR createNode( [in] VARIANT, [in] BSTR, [in] BSTR )
STDCALL dispatch FUNC PTR nodeFromID( [in] BSTR )
STDCALL dispatch FUNC VARIANT_BOOL load( [in] VARIANT )
STDCALL dispatch PROPERTYGET int readyState()
STDCALL dispatch PROPERTYGET PTR parseError()
STDCALL dispatch PROPERTYGET BSTR url()
STDCALL dispatch PROPERTYGET VARIANT_BOOL async()
STDCALL dispatch PROPERTYPUT void async( [in] VARIANT_BOOL )
STDCALL dispatch FUNC void abort()
STDCALL dispatch FUNC VARIANT_BOOL loadXML( [in] BSTR )
STDCALL dispatch FUNC void save( [in] VARIANT )
STDCALL dispatch PROPERTYGET VARIANT_BOOL validateOnParse()
STDCALL dispatch PROPERTYPUT void validateOnParse( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET VARIANT_BOOL resolveExternals()
STDCALL dispatch PROPERTYPUT void resolveExternals( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET VARIANT_BOOL preserveWhiteSpace()
STDCALL dispatch PROPERTYPUT void preserveWhiteSpace( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYPUT void onreadystatechange( [in] VARIANT )
STDCALL dispatch PROPERTYPUT void ondataavailable( [in] VARIANT )
STDCALL dispatch PROPERTYPUT void ontransformnode( [in] VARIANT )
STDCALL dispatch PROPERTYGET PTR namespaces()
STDCALL dispatch PROPERTYGET VARIANT schemas()
STDCALL dispatch PROPERTYPUTREF void schemas( [in] VARIANT )
STDCALL dispatch FUNC PTR validate()
STDCALL dispatch FUNC void setProperty( [in] BSTR, [in] VARIANT )
STDCALL dispatch FUNC VARIANT getProperty( [in] BSTR )
regards, saludos

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

Re: Saber Metodos de un CREATEOBJECT

Postby Antonio Linares » Mon May 13, 2013 5:51 am

Inspeccionando "iTunes.Application"

STDCALL dispatch FUNC void QueryInterface( [in] PTR, [out] PTR )
STDCALL dispatch FUNC unsigned long AddRef()
STDCALL dispatch FUNC unsigned long Release()
STDCALL dispatch FUNC void GetTypeInfoCount( [out] PTR )
STDCALL dispatch FUNC void GetTypeInfo( [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void GetIDsOfNames( [in] PTR, [in] PTR, [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void Invoke( [in] int, [in] PTR, [in] unsigned long, [in] unsigned short, [in] PTR, [out] PTR, [out] PTR, [out] PTR )
STDCALL dispatch FUNC void BackTrack()
STDCALL dispatch FUNC void FastForward()
STDCALL dispatch FUNC void NextTrack()
STDCALL dispatch FUNC void Pause()
STDCALL dispatch FUNC void Play()
STDCALL dispatch FUNC void PlayFile( [in] BSTR )
STDCALL dispatch FUNC void PlayPause()
STDCALL dispatch FUNC void PreviousTrack()
STDCALL dispatch FUNC void Resume()
STDCALL dispatch FUNC void Rewind()
STDCALL dispatch FUNC void Stop()
STDCALL dispatch FUNC PTR ConvertFile( [in] BSTR )
STDCALL dispatch FUNC PTR ConvertFiles( [in] PTR )
STDCALL dispatch FUNC PTR ConvertTrack( [in] PTR )
STDCALL dispatch FUNC PTR ConvertTracks( [in] PTR )
STDCALL dispatch FUNC VARIANT_BOOL CheckVersion( [in] int, [in] int )
STDCALL dispatch FUNC PTR GetITObjectByID( [in] int, [in] int, [in] int, [in] int )
STDCALL dispatch FUNC PTR CreatePlaylist( [in] BSTR )
STDCALL dispatch FUNC void OpenURL( [in] BSTR )
STDCALL dispatch FUNC void GotoMusicStoreHomePage()
STDCALL dispatch FUNC void UpdateIPod()
STDCALL dispatch FUNC void Authorize( [in] int, [in] PTR, [in] PTR )
STDCALL dispatch FUNC void Quit()
STDCALL dispatch PROPERTYGET PTR Sources()
STDCALL dispatch PROPERTYGET PTR Encoders()
STDCALL dispatch PROPERTYGET PTR EQPresets()
STDCALL dispatch PROPERTYGET PTR Visuals()
STDCALL dispatch PROPERTYGET PTR Windows()
STDCALL dispatch PROPERTYGET int SoundVolume()
STDCALL dispatch PROPERTYPUT void SoundVolume( [in] int )
STDCALL dispatch PROPERTYGET VARIANT_BOOL Mute()
STDCALL dispatch PROPERTYPUT void Mute( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET USERDEFINED PlayerState()
STDCALL dispatch PROPERTYGET int PlayerPosition()
STDCALL dispatch PROPERTYPUT void PlayerPosition( [in] int )
STDCALL dispatch PROPERTYGET PTR CurrentEncoder()
STDCALL dispatch PROPERTYPUT void CurrentEncoder( [in] PTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL VisualsEnabled()
STDCALL dispatch PROPERTYPUT void VisualsEnabled( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET VARIANT_BOOL FullScreenVisuals()
STDCALL dispatch PROPERTYPUT void FullScreenVisuals( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET USERDEFINED VisualSize()
STDCALL dispatch PROPERTYPUT void VisualSize( [in] USERDEFINED )
STDCALL dispatch PROPERTYGET PTR CurrentVisual()
STDCALL dispatch PROPERTYPUT void CurrentVisual( [in] PTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL EQEnabled()
STDCALL dispatch PROPERTYPUT void EQEnabled( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET PTR CurrentEQPreset()
STDCALL dispatch PROPERTYPUT void CurrentEQPreset( [in] PTR )
STDCALL dispatch PROPERTYGET BSTR CurrentStreamTitle()
STDCALL dispatch PROPERTYGET BSTR CurrentStreamURL()
STDCALL dispatch PROPERTYGET PTR BrowserWindow()
STDCALL dispatch PROPERTYGET PTR EQWindow()
STDCALL dispatch PROPERTYGET PTR LibrarySource()
STDCALL dispatch PROPERTYGET PTR LibraryPlaylist()
STDCALL dispatch PROPERTYGET PTR CurrentTrack()
STDCALL dispatch PROPERTYGET PTR CurrentPlaylist()
STDCALL dispatch PROPERTYGET PTR SelectedTracks()
STDCALL dispatch PROPERTYGET BSTR Version()
STDCALL dispatch FUNC void SetOptions( [in] int )
STDCALL dispatch FUNC PTR ConvertFile2( [in] BSTR )
STDCALL dispatch FUNC PTR ConvertFiles2( [in] PTR )
STDCALL dispatch FUNC PTR ConvertTrack2( [in] PTR )
STDCALL dispatch FUNC PTR ConvertTracks2( [in] PTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL AppCommandMessageProcessingEnabled()
STDCALL dispatch PROPERTYPUT void AppCommandMessageProcessingEnabled( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET VARIANT_BOOL ForceToForegroundOnDialog()
STDCALL dispatch PROPERTYPUT void ForceToForegroundOnDialog( [in] VARIANT_BOOL )
STDCALL dispatch FUNC PTR CreateEQPreset( [in] BSTR )
STDCALL dispatch FUNC PTR CreatePlaylistInSource( [in] BSTR, [in] PTR )
STDCALL dispatch FUNC void GetPlayerButtonsState( [out] PTR, [out] PTR, [out] PTR )
STDCALL dispatch FUNC void PlayerButtonClicked( [in] USERDEFINED, [in] int )
STDCALL dispatch PROPERTYGET VARIANT_BOOL CanSetShuffle( [in] PTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL CanSetSongRepeat( [in] PTR )
STDCALL dispatch PROPERTYGET PTR ConvertOperationStatus()
STDCALL dispatch FUNC void SubscribeToPodcast( [in] BSTR )
STDCALL dispatch FUNC void UpdatePodcastFeeds()
STDCALL dispatch FUNC PTR CreateFolder( [in] BSTR )
STDCALL dispatch FUNC PTR CreateFolderInSource( [in] BSTR, [in] PTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL SoundVolumeControlEnabled()
STDCALL dispatch PROPERTYGET BSTR LibraryXMLPath()
STDCALL dispatch PROPERTYGET int ITObjectPersistentIDHigh( [in] PTR )
STDCALL dispatch PROPERTYGET int ITObjectPersistentIDLow( [in] PTR )
STDCALL dispatch FUNC void GetITObjectPersistentIDs( [in] PTR, [out] PTR, [out] PTR )
regards, saludos

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

Re: Saber Metodos de un CREATEOBJECT

Postby Antonio Linares » Mon May 13, 2013 5:53 am

Inspeccionando "Microsoft.Update.Searcher"

STDCALL dispatch FUNC void QueryInterface( [in] PTR, [out] PTR )
STDCALL dispatch FUNC unsigned long AddRef()
STDCALL dispatch FUNC unsigned long Release()
STDCALL dispatch FUNC void GetTypeInfoCount( [out] PTR )
STDCALL dispatch FUNC void GetTypeInfo( [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void GetIDsOfNames( [in] PTR, [in] PTR, [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void Invoke( [in] int, [in] PTR, [in] unsigned long, [in] unsigned short, [in] PTR, [out] PTR, [out] PTR, [out] PTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL CanAutomaticallyUpgradeService()
STDCALL dispatch PROPERTYPUT void CanAutomaticallyUpgradeService( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET BSTR ClientApplicationID()
STDCALL dispatch PROPERTYPUT void ClientApplicationID( [in] BSTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL IncludePotentiallySupersededUpdates()
STDCALL dispatch PROPERTYPUT void IncludePotentiallySupersededUpdates( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET USERDEFINED ServerSelection()
STDCALL dispatch PROPERTYPUT void ServerSelection( [in] USERDEFINED )
STDCALL dispatch FUNC PTR BeginSearch( [in] BSTR, [in] IUnknown, [in] VARIANT )
STDCALL dispatch FUNC PTR EndSearch( [in] PTR )
STDCALL dispatch FUNC BSTR EscapeString( [in] BSTR )
STDCALL dispatch FUNC PTR QueryHistory( [in] int, [in] int )
STDCALL dispatch FUNC PTR Search( [in] BSTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL Online()
STDCALL dispatch PROPERTYPUT void Online( [in] VARIANT_BOOL )
STDCALL dispatch FUNC int GetTotalHistoryCount()
STDCALL dispatch PROPERTYGET BSTR ServiceID()
STDCALL dispatch PROPERTYPUT void ServiceID( [in] BSTR )
STDCALL dispatch PROPERTYGET VARIANT_BOOL IgnoreDownloadPriority()
STDCALL dispatch PROPERTYPUT void IgnoreDownloadPriority( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET USERDEFINED SearchScope()
STDCALL dispatch PROPERTYPUT void SearchScope( [in] USERDEFINED )
regards, saludos

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

Re: Saber Metodos de un CREATEOBJECT

Postby Antonio Linares » Mon May 13, 2013 5:55 am

Inspeccionando "WScript.Network"

STDCALL virtual FUNC HRESULT AddWindowsPrinterConnection( [in] BSTR, [defaultvalue] BSTR, [defaultvalue] BSTR )
regards, saludos

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

Re: Saber Metodos de un CREATEOBJECT

Postby Antonio Linares » Mon May 13, 2013 7:57 am

Y aqui finalmente una función que permite revisar todos los objetos OLE disponibles en el ordenador e inspeccionar el que queramos :-)

Image

Image

Aqui todo el código fuente:

adolfo.prg
Code: Select all  Expand view  RUN
// Docs: http://msdn.microsoft.com/en-us/library/cc237619.aspx

#include "FiveWin.ch"

#define  HKEY_CLASSES_ROOT       2147483648

function Main()

   local nHandle, nHandle2, n := 1
   local aValues := {}, cValue

   if RegOpenKey( HKEY_CLASSES_ROOT, "CLSID", @nHandle ) == 0
      while RegEnumKey( nHandle, n++, @cValue ) == 0
         if RegOpenKey( HKEY_CLASSES_ROOT, "CLSID\" + cValue, @nHandle2 ) == 0
            if RegQueryValue( nHandle2, "
ProgID", @cValue ) != 2
               if ! Empty( cValue )
                  AAdd( aValues, cValue )
               endif
            endif      
            RegCloseKey( nHandle2 )
         endif
      end      
      RegCloseKey( nHandle )  
   endif  

   XBROWSER ASort( aValues ) TITLE "
Available OLE classes" ;
      SELECT OleInspect( oBrw:aCols[ 1 ]:Value ) ;
      VALID MsgYesNo( "
want to end ?" )

return nil
   
function OleInspect( cProgID )

   local o, aVars, aFuncs, cFuncs := "
"

   try
      o := CreateObject( cProgID )
   catch
      MsgAlert( "
can't create the object" )
      return nil
   end  

   if GetTypeInfoCount( o:hObj ) == 1 // There is info

      if Len( aVars := GetTypeVars( o:hObj ) ) > 0
         XBROWSER ASort( aVars ) TITLE "Variables"
      endif
     
      if Len( aFuncs := GetTypeFuncs( o:hObj ) ) > 0
         XBROWSER ASort( aFuncs ) TITLE "Functions for " + cProgID
         // AEval( aFuncs, { | c | cFuncs += c + CRLF } )
         // MemoEdit( cFuncs )
      endif  
   endif

return nil

#pragma BEGINDUMP

#include <hbapi.h>
#include "c:\harbour\contrib\hbwin\hbwinole.h"

HB_FUNC( GETTYPEINFOCOUNT )
{
   IDispatch * pDisp = hb_oleParam( 1 );
   HRESULT     lOleError;
   UINT        ctinfo;
   
   lOleError = HB_VTBL( pDisp )->GetTypeInfoCount( HB_THIS( pDisp ), &ctinfo );
   
   hb_retnl( ( lOleError == S_OK ) ? ctinfo: -1 );
}    

static LPSTR WideToAnsi( LPWSTR cWide )
{
   WORD wLen;
   LPSTR cString = NULL;

   wLen = WideCharToMultiByte( CP_ACP, 0, cWide, -1, cString, 0, NULL, NULL );

   cString = ( LPSTR ) hb_xgrab( wLen );
   WideCharToMultiByte( CP_ACP, 0, cWide, -1, cString, wLen, NULL, NULL );

   return cString;
}
   
HB_FUNC( GETTYPEVARS )
{
   IDispatch * pDisp = hb_oleParam( 1 );
   ITypeInfo * pInfo;
   TYPEATTR * pta;
   int i;

   if( HB_VTBL( pDisp )->GetTypeInfo( HB_THIS( pDisp ), 0, 0, &pInfo ) != S_OK )
      return;

   if( HB_VTBL( pInfo )->GetTypeAttr( HB_THIS( pInfo ), &pta ) != S_OK )
      return;

   hb_reta( pta->cVars );

   for( i = 0; i < pta->cVars; i++ )
   {
      BSTR bsName;
      VARDESC * pVar;
      char * pszName;
   
      if( HB_VTBL( pInfo )->GetVarDesc( HB_THIS( pInfo ), i, &pVar ) != S_OK )
         break;

      if( HB_VTBL( pInfo )->GetDocumentation( HB_THIS( pInfo ), pVar->memid, &bsName, NULL, NULL, NULL ) != S_OK )
         break;

      pszName = WideToAnsi( bsName );
      hb_storvclen( pszName, strlen( pszName ), -1, i + 1 );
      hb_xfree( ( void * ) pszName );
     
      HB_VTBL( pInfo )->ReleaseVarDesc( HB_THIS( pInfo ), pVar );
   }

   HB_VTBL( pInfo )->Release( HB_THIS( pInfo ) );
}    
   
static char * GetType( unsigned int iType )
{
   char * pszType;
   
   switch( iType )
   {
      case VT_PTR:
           pszType = "PTR";
           break;
           
      case VT_ARRAY:
           pszType = "ARRAY";
           break;

      case VT_CARRAY:
           pszType = "CARRAY";
           break;

      case VT_USERDEFINED:
           pszType = "USERDEFINED";
           break;

      case VT_I2:
           pszType = "short";
           break;
           
      case VT_I4:
           pszType = "int";
           break;
           
      case VT_R4:
           pszType = "float";
           break;
           
      case VT_R8:
           pszType = "double";
           break;
           
      case VT_CY:
           pszType = "CY";
           break;
           
      case VT_DATE:
           pszType = "DATE";
           break;
           
      case VT_BSTR:
           pszType = "BSTR";
           break;
           
      case VT_DECIMAL:
           pszType = "DECIMAL";
           break;
           
      case VT_DISPATCH:
           pszType = "IDispatch";
           break;
           
      case VT_ERROR:
           pszType = "SCODE";
           break;
           
      case VT_BOOL:
           pszType = "VARIANT_BOOL";
           break;
           
      case VT_VARIANT:
           pszType = "VARIANT";
           break;
           
      case VT_UNKNOWN:
           pszType = "IUnknown";
           break;
           
      case VT_UI1:
           pszType = "BYTE";
           break;
           
      case VT_I1:
           pszType = "char";
           break;
           
      case VT_UI2:
           pszType = "unsigned short";
           break;
           
      case VT_UI4:
           pszType = "unsigned long";
           break;
           
      case VT_I8:
           pszType = "__int64";
           break;
           
      case VT_UI8:
           pszType = "unsigned __int64";
           break;
           
      case VT_INT:
           pszType = "int";
           break;
           
      case VT_UINT:
           pszType = "unsigned int";
           break;
           
      case VT_HRESULT:
           pszType = "HRESULT";
           break;
           
      case VT_VOID:
           pszType = "void";
           break;
           
      case VT_LPSTR:
           pszType = "char *";
           break;
           
      case VT_LPWSTR:
           pszType = "wchar *";
           break;

      default:
           pszType = "Error";
           break;              
   }
   return pszType;
}  

static char * GetFuncKind( unsigned int iType )
{
   char * pszType;
   
   switch( iType )
   {
      case FUNC_PUREVIRTUAL:
           pszType = "virtual";
           break;

      case FUNC_STATIC:
           pszType = "static";
           break;
           
      case FUNC_DISPATCH:
           pszType = "dispatch";
           break;
           
      default:
           pszType = "error";
           break;
   }
   
   return pszType;
}                    

static char * GetInvKind( unsigned int iType )
{
   char * pszType;
   
   switch( iType )
   {
      case INVOKE_FUNC:
           pszType = "FUNC";
           break;

      case INVOKE_PROPERTYGET:
           pszType = "PROPERTYGET";
           break;
           
      case INVOKE_PROPERTYPUT:
           pszType = "PROPERTYPUT";
           break;
           
      case INVOKE_PROPERTYPUTREF:
           pszType = "PROPERTYPUTREF";
           break;    
           
      default:
           pszType = "error";
           break;
   }
   
   return pszType;
}                    

static char * GetCallConv( unsigned int iType )
{
   char * pszType;
   
   switch( iType )
   {
      case CC_CDECL:
           pszType = "CDECL";
           break;

      case CC_PASCAL:
           pszType = "PASCAL";
           break;
           
      case CC_STDCALL:
           pszType = "STDCALL";
           break;
           
      default:
           pszType = "error";
           break;
   }
   
   return pszType;
}                    

static char * GetParamType( USHORT iType )
{
   char * pszType = "error";
   
   if( iType & PARAMFLAG_NONE )
      pszType = "";
     
   if( iType & PARAMFLAG_FIN )
      pszType = "[in]";
     
   if( iType & PARAMFLAG_FOUT )
      pszType = "[out]";

   if( iType & PARAMFLAG_FLCID )
      pszType = "[lcid]";

   if( iType & PARAMFLAG_FRETVAL )
      pszType = "[retval]";

   if( iType & PARAMFLAG_FOPT )
      pszType = "[optional]";

   if( iType & PARAMFLAG_FHASDEFAULT )
      pszType = "[defaultvalue]";

   if( iType & PARAMFLAG_FHASCUSTDATA )
      pszType = "[custom]";
   
   return pszType;
}                    
   
HB_FUNC( GETTYPEFUNCS )
{
   IDispatch * pDisp = hb_oleParam( 1 );
   ITypeInfo * pInfo;
   HRESULT     lOleError;
   TYPEATTR * pta;
   int i;

   if( HB_VTBL( pDisp )->GetTypeInfo( HB_THIS( pDisp ), 0, 0, &pInfo ) != S_OK )
   {
      hb_ret();
      return;
   }  

   if( HB_VTBL( pInfo )->GetTypeAttr( HB_THIS( pInfo ), &pta ) != S_OK )
   {
      hb_ret();
      return;
   }  

   hb_reta( pta->cFuncs );

   for( i = 0; i < pta->cFuncs; i++ )
   {
      BSTR bsName;
      FUNCDESC * pfd;
      char * pszName;
      char * pszType;
      char buffer[ 700 ];
      int n;
   
      if( HB_VTBL( pInfo )->GetFuncDesc( HB_THIS( pInfo ), i, &pfd ) != S_OK )
         break;

      if( HB_VTBL( pInfo )->GetDocumentation( HB_THIS( pInfo ), pfd->memid, &bsName, NULL, NULL, NULL ) != S_OK )
         break;

      pszName = WideToAnsi( bsName );

      sprintf( buffer, "%s %s %s %s %s(", GetCallConv( pfd->callconv ),
               GetFuncKind( pfd->funckind ), GetInvKind( pfd->invkind ),
               GetType( pfd->elemdescFunc.tdesc.vt ), pszName );
     
      for( n = 0; n < pfd->cParams; n++ )
      {
         if( n != 0 )
            strcat( buffer, ", " );
         else
            strcat( buffer, " " );  
         
         strcat( buffer, GetParamType( pfd->lprgelemdescParam[ n ].paramdesc.wParamFlags ) );
         strcat( buffer, " " );
         strcat( buffer, GetType( pfd->lprgelemdescParam[ n ].tdesc.vt ) );
         
         if( n == pfd->cParams - 1 )
            strcat( buffer, " " );
      }    

      strcat( buffer, ")" );
      hb_storvclen( buffer, strlen( buffer ), -1, i + 1 );
      hb_xfree( ( void * ) pszName );
      HB_VTBL( pInfo )->ReleaseFuncDesc( HB_THIS( pInfo ), pfd );
   }

   HB_VTBL( pInfo )->Release( HB_THIS( pInfo ) );
}    

#pragma ENDDUMP


He ampliado el comando XBROWSER de FWH para que admita VALID:
Code: Select all  Expand view  RUN
#xcommand XBROWSER [<uData>] ;
             [ TITLE <cTitle> ] ;
             [ <autosort:AUTOSORT> ] ;
             [ SETUP <fnSetUp> ] ;
             [ COLUMNS <aCols,...> ] ;
             [ SELECT <fnSelect> ] ;
             [ <excel: CALC> ];
             [ <fastedit: FASTEDIT> ];
             [ VALID <uValid> ] ;
      => ;
         XBrowse( [<uData>], [<cTitle>], [<.autosort.>], ;
            [\{|oBrw|<fnSetUp>\}], [\{<aCols>\}], ;
            [\{|oBrw,oCol|<fnSelect>\}],!<.excel.>, <.fastedit.>, [\{|oBrw|<uValid>\}] )


y modificado asi su código:
Code: Select all  Expand view  RUN
function XBrowse( uData, cTitle, lAutoSort, bSetUp, aCols, bSelect, lExcel, lFastEdit, bValid )

   ...

   ACTIVATE DIALOG oDlg ;
      ON INIT FitSizes( oBrw, bInit ) ;
      VALID If( ! Empty( bValid ), Eval( bValid ), .T. )
regards, saludos

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

Re: Saber Metodos de un CREATEOBJECT

Postby Antonio Linares » Mon May 13, 2013 8:07 am

regards, saludos

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

Re: Saber Metodos de un CREATEOBJECT

Postby cnavarro » Mon May 13, 2013 9:04 am

Antonio
Esto es ya el complemento que estaba buscando
Muchas gracias
Saludos
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Saber Metodos de un CREATEOBJECT

Postby Antonio Linares » Mon May 13, 2013 9:07 am

He encontrado una clase OLE que tiene variables (y no tiene métodos):

local o := CreateObject( "OldFont." )
regards, saludos

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

Re: Saber Metodos de un CREATEOBJECT

Postby Antonio Linares » Mon May 13, 2013 9:12 am

Puede ser que en el futuro podamos obtener alguna información adicional en base a este ejemplo:

http://www.adp-gmbh.ch/win/tlb/
regards, saludos

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

Re: Saber Metodos de un CREATEOBJECT

Postby Adolfo » Mon May 13, 2013 1:23 pm

Antonio

Gracias nuevamente, he revisado los obj com disponibles, y hay unos que ni siquiera sabia que existian.
Por ej. los de CorelDraw y los de Photoshop.

Voy a instalar Sketchup y DraftSight, que son 2 CAD absolutamente gratuitos y que leen archivos DWG, a ver que tan factibles son de usar a traves de CreateObject, mi intencion es solo poder leer, mostrar e imprimir cada dwg a traves de mi aplicacion, ya que el diseño de los originales se haran en CAD 12. Con eso no debo instalar autocad en cada pc y centralizo su creacion.

Gracias.. hay harto para jugar

Desde Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Saber Metodos de un CREATEOBJECT

Postby Adolfo » Mon May 13, 2013 1:42 pm

Actualizo.

DraftSight, bueno, completo, leyo los DWG de una, pero No es un COM
Sketchup... muy basico, intuitivo, y si es un OBJ COM, pero muy pocos metodos, al parecer INVOKE y QUERYINTERFACE podrian hacer la pega

STDCALL dispatch FUNC unsigned long AddRef()
STDCALL dispatch FUNC unsigned long Release()
STDCALL dispatch FUNC void GetIDsOfNames( [in] PTR, [in] PTR, [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void GetTypeInfo( [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void GetTypeInfoCount( [out] PTR )
STDCALL dispatch FUNC void Invoke( [in] int, [in] PTR, [in] unsigned long, [in] unsigned short, [in] PTR, [out] PTR, [out] PTR, [out] PTR )
STDCALL dispatch FUNC void QueryInterface( [in] PTR, [out] PTR )

Probare a ver que pasa, pero si solo es para leer, mostrar e imprimir, puede que sirva.

Saludos
Desde Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Saber Metodos de un CREATEOBJECT

Postby lucasdebeltran » Mon May 13, 2013 1:56 pm

Antonio,

Una utilidad fantástica, enhorabuena.

Una duda, ¿por qué xBrowse requiere freeimage.dll?. No estás usando ninguna imagen.

Un saludo
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: Saber Metodos de un CREATEOBJECT

Postby RenOmaS » Mon May 13, 2013 10:11 pm

Buenas a todos.

Seria posible saberr el nombre de fichero origem.
Saludos/regards
RenOmaS

skype: americo.balboa
User avatar
RenOmaS
 
Posts: 205
Joined: Fri Oct 07, 2005 5:07 pm

Re: Saber Metodos de un CREATEOBJECT

Postby Antonio Linares » Tue May 14, 2013 8:02 am

Adolfo,

Todos las classes OLE proporcionan unos métodos básicos:

La clase inicial es IUnknown y proporciona estos métodos:
AddRef(), QueryInterface() y Release(). Que basicamente sirven para: incrementar el contador de uso, crear un objeto IDispatch para interrogar al objeto y destruir el objeto.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms680509(v=vs.85).aspx

A continuación están los métodos de la Clase IDispatch que aporta:
GetTypeInfoCount(), GetTypeInfo(), GetIDsOfNames() y Invoke().

http://msdn.microsoft.com/es-es/library/windows/desktop/dd318520(v=vs.85).aspx

En tu ejemplo, solo estas listando los métodos de estas dos clases contenidas en el objeto, por lo que el objeto en si no ofrece nada excepto esa funcionalidad básica. Espero que esta explicación ayude a entender mejor los objetos OLE :-)
regards, saludos

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

PreviousNext

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 61 guests