FIX: Returning Empty Array from ActiveX EXE Fails with SP2
Article ID: 177090
Article Last Modified on 11/18/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
This article was previously published under Q177090
SYMPTOMS
You receive an error when you use the Array function to return an empty
variant array from an out-of-process ActiveX Component (ActiveX EXE):
Run-time error '5':
Invalid Procedure Call or Argument
This error occurs only after the installation of Visual Studio 97 Service
Pack 2.
RESOLUTION
There are several workarounds to this problem:
- Use an in-process ActiveX Component (ActiveX DLL).
-or-
- Implement error handling in the client application.
-or-
- Instead of returning an empty array, return Array(vbNull).
Note that this will actually return an array that has one element.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Basic
6.0.
Additional query words: kbVBp500bug kbVBp600fix kbVBp kbdsd kbDSupport KBACTIVEX KBSERVER
Keywords: kbbug kbfix KB177090