Limitations of VB 3.0 as a Client When Calling a VB 4.0 Server

ID: Q138139


The information in this article applies to:
  • Microsoft Visual Basic Professional and Enterprise Editions, 32-bit only, for Windows, version 4.0
  • Microsoft Visual Basic Standard and Professional Editions for Windows, version 3.0


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.


Additional query words: 4.00 inproc inprocess vb4win vb432

Keywords :
Version : WINDOWS:3.0,4.0
Platform : WINDOWS
Issue type :


Last Reviewed: January 25, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.