BCX COM Interface

OBJECT storage class used by BCX COM functions.


BCX definition:

 TYPE OBJECT
  p_unknown AS IUnknown PTR
  pObjects[COM_STACK_SIZE] AS VARIANT 
  pName[COM_STACK_SIZE][128] AS TCHAR
  pStatus AS BOOL
  ipointer as int 
 END TYPE

C/C++ definition:


 typedef struct _OBJECT
  {
   IUnknown*  p_unknown;
   VARIANT    pObjects[COM_STACK_SIZE];
   TCHAR      pName[COM_STACK_SIZE][128];
   BOOL       pStatus;
   int        ipointer;
  }OBJECT, *LPOBJECT;

 

Example:

 
 BCX_SHOW_COM_ERRORS(TRUE)
 
 DIM app AS Object
 SET app = CREATEOBJECT("Excel.Application")
 
 app.workbooks.add
 app.visible = true
 app.ActiveSheet.Cells(3,1).Value="Hello"
 app.ActiveSheet.Cells(4,1).Value="From BCX"
 app.ActiveSheet.Cells(5,1).Value="Console program!"
 
 DIM temp_var$ 
 
 temp_var$ = app.ActiveSheet.Cells(3,1).Value
 MSGBOX temp_var$, "value of cell(3,1)", 4096
 
 MSGBOX "BCX COM Example!" & CRLF$ _
 & "Using Office automation to manipulate Excel." & CRLF$ _
 & "Program will close Excel in 1 second.","finished!", 4096
 SLEEP(1000)
 app.activeworkbook.saved = true
 app.quit
 SET app = Nothing

For more examples of the BCX COM functions see the COM folder in the Files section of the BCX Group on Yahoo.

Related topics:  CreateObject | Set Nothing | List of all COM Interface Functions