PRB: Early Binding Fails with Out-Of-Process OLE Servers (137094)



The information in this article applies to:

  • Microsoft Visual Basic Standard Edition for Windows 4.0
  • Microsoft Visual Basic Professional Edition for Windows 4.0
  • Microsoft Visual Basic Enterprise Edition for Windows 4.0

This article was previously published under Q137094

SYMPTOMS

When performing early binding on an out-of-process OLE server class, you might expect the Visual Basic 4.0 compiler to detect references made to invalid methods or properties. Yet, sometimes such invalid references are ignored by the compiler and are only detected at run time.

CAUSE

There are two probable causes for this problem:

  • Improper declaration of object variable. For early binding to work, you must declare your object variable as follows:
          Dim MyObjectVar As New MyServer.MyClass
    						
    If you use the following, early binding will not work:
          Dim MyObjectVar As Object
    						
    -or-

  • Compile On Demand option is set on. Click Options on the Tools menu, and click the Advanced tab. The Compile On Demand option must be set to false for the compiler to detect references made to invalid methods or properties in the server class.

STATUS

This behavior is by design.

Modification Type:MajorLast Reviewed:11/18/2003
Keywords:kbprb KB137094