Limitations of VB 3.0 as a Client When Calling a VB 4.0 Server (138139)



The information in this article applies to:

  • Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
  • Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
  • Microsoft Visual Basic Standard Edition for Windows 3.0
  • Microsoft Visual Basic Professional Edition for Windows 3.0

This article was previously published under Q138139

SUMMARY

It is possible to call an OLE server created in Visual Basic version 4.0 (both 16-bit as well as 32-bit Servers) from a Visual Basic version 3.0 client application. Note, however, that a 16-bit application cannot call a 32-bit DLL server. Therefore, if the 32-bit server is an OLE DLL server, it cannot be called. If the 32-bit server is an OLE EXE server, it can be called from a 16-bit client application.

This functionality is possible because OLE is binary compatible, which is one of the main benefits of OLE. However, there are certain limitations that must be kept in mind simply because these are features not supported in Visual Basic version 3.0.

MORE INFORMATION

The Limitations

  1. It is not possible to use early binding while creating object instances. This is because Visual Basic version 3.0 only supports late binding. In other words, the only way to create an object of type MyClass implemented by a server called MyServer is:
       Dim obj As Object
       Set Obj = CreateObject("MyServer.MyClass")
    						
  2. You cannot call in-process OLE Servers (that is, Visual Basic version 4.0 OLE DLLs) from Visual Basic version 3.0. This is because you can only create 32-bit OLE DLLs in Visual Basic version 4.0.
  3. You cannot return an array data type to Visual Basic version 3.0 from a Visual Basic version 4.0 OLE server because this is not supported in Visual Basic version 3.0.
  4. Visual Basic version 3.0 does not support rich Error information like that provided by Visual Basic version 4.0's Error Object. So, if the server raises an error, only a default error message is returned back to the Visual Basic version 3.0 client. One way to work around this is to implement your own error object in the server, and have the Visual Basic version 3.0 client call that object in the error handler for the default error message.

Modification Type:MajorLast Reviewed:12/9/2003
Keywords:KB138139