Microsoft KB Archive/138139

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

Article ID: 138139

Article Last Modified on 12/9/2003

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition

-



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.



The Limitations
  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")  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. 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. 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: KB138139

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.