Article ID: 183164 - Last Review: November 18, 2003 - Revision: 2.0 FIX: For..Each Loop in ActiveX Component Causes ErrorsThis article was previously published under Q183164 On This PageSYMPTOMS
When using an ActiveX DLL created in Visual Basic, you may receive one of
the following errors if the ActiveX component contains a For..Each loop
that iterates through a Visual Basic collection:
Run-time error '48': Error in loading DLL
-or-
Run-time error '-2147319765 (8002802b)': Automation Error This problem occurs when a For..Each loop is executed in an ActiveX DLL. For..Each loops elsewhere do not exhibit this problem. CAUSE
This problem typically occurs after calling the DLL at least twice. The
first call into the DLL does not execute code that uses a For..Each loop
but the second call does. The error occurs during the second call. See the
"Steps to Reproduce Behavior" section below for more information.
RESOLUTION
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem has been corrected
in Microsoft Visual Basic 6.0. NOTE: If your DLL is running in a multi-threaded environment, you must still complete the steps provided in the following article in the Microsoft Knowledge Base: 186273
(http://support.microsoft.com/kb/186273/EN-US/
)
BUG: AV Running VB-Built Component in Multi-Threaded Environment
MORE INFORMATIONSteps to Reproduce Behavior
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
178777
(http://support.microsoft.com/kb/178777/EN-US/
)
: PRB: ASP Returns "Error in Loading DLL" with VB Component
APPLIES TO
| Article Translations
|

Back to the top
