Using COM/ActiveX in BCX

Limitations:

  1. The length of a COM OBJECT name is not allowed to exceed 64 characters.
  2. An OBJECT cannot be declared or used in a user defined TYPE.
  3. CREATEOBJECT is not capable of creating a remote OBJECT.
    
     CREATEOBJECT("Excel.Application","\\at_net_pc1")
    
    
    is illegal.
  4. Do NOT use names for variables that you may have already assigned to global COM object variables.
  5. Named arguments are not supported.
  6. Do not use the & concatenation operand on the same line as an OBJECT variable. The BCX COM parser cannot properly parse, for example, this
    
     app.server = "my" & "server" & somevar$ 
    
    
    so instead, use something like this
    
     myvar$ = "my" & "server" & somevar$ 
     app.server = myvar$
    
    

$COM_ON and $COM_OFF directives

Purpose: The default setting in the BCX translator is $COM_ON which specifies that COM procedures are used in the code being translated. $COM_OFF indicates that that COM procedures are not being used in the code being translated.


Syntax:

 $COM_ON or $COM_OFF

Parameters:

  • None

When any BCX COM interface procedure is invoked, the translator automatically adds the following define to the output C code.


#ifndef _WIN32_DCOM
#define _WIN32_DCOM
#endif

Check out the following links to run-time procedures that BCX provides for working with COM/ActiveX objects:

How to


All products mentioned in this manual and/or in program samples are trademarks of their respective owners.