You may receive the following error message:
An unhandled exception of type 'System.OverflowException' occurred
Additional information: Overflow
This problem may
occur when the following conditions are true:
- You call a method that is defined in a Microsoft Component
Object Model (COM) DLL from a Microsoft Visual C# .NET program or a Microsoft
Visual Basic .NET program.
- In the application code, the method is located after the System.Math.Asin function. The System.Math.Asin function returns Not a
This problem occurs because the new common language runtime
and the Microsoft Visual Basic 6.0 DLL or Microsoft Visual C++ DLL handle the
floating point variables inconsistently.
To resolve this problem, obtain the latest service pack for
Microsoft . NET Framework 1.0. To download the latest service pack, visit the
following Microsoft Developer Network (MSDN) Web site:http://www.microsoft.com/downloads/details.aspx?familyid=6978D761-4A92-4106-A9BC-83E78D4ABC5B&displaylang=en
has confirmed that this is a problem in the Microsoft products that are listed
in the "Applies to" section. This problem was
first corrected in Microsoft .NET Framework 1.0 Service Pack
Steps to reproduce the behavior
Create a COM DLL in Visual Basic 6.0
- Start Visual Basic 6.0.
- On the New Project dialog box, on the
New tab, click ActiveX DLL, and then click
Open. By default, a class module file that is named Class1
- Add the following code to the Class1 class module file:
Public Function Avg() As Double
Avg = 0/1
- On the File menu, click Make
Project1.dll. The Make Project dialog box
- Locate a folder to save the Project1.dll
file, and then click OK to save the file.
Create a client application
- Start Visual Studio .NET.
- On the File menu, point to
New, and then click Project. The New
Project dialog box appears.
- Click Visual C# Projects under
Project Types, and then click Console
Application under Templates.
- In the Name box, type
Client, and then click OK. By default,
a file that is named Class1.cs is created.
- Replace the existing code with the following code:
static void Main(string args)
Class1Class T = new Class1Class();
double D = Math.Asin(2);
- On the Project menu, click Add
Reference. The Add Reference dialog box
- Click Browse. The Select
Component dialog box appears.
- Locate the Project1.dll file that you created in the
"Create a COM DLL" section, click Project1.dll, and then click
- In the Add Reference dialog box, click
OK to add the DLL to your Client project.
Build and then run the project
- On the Build menu, click Build
- Press CTRL+F5 to run the application without a debugger.
The Just-In-Time Debugging dialog box appears.
- Click Yes. The Attach to
Process dialog box appears.
- Click OK.
You may notice the
behavior that is mentioned in the "Symptoms" section.
For additional information, click the
following article number to view the article in the Microsoft Knowledge Base:
Description of the standard terminology that is used to describe Microsoft software updates
information, click the following article numbers to view the articles in the
Microsoft Knowledge Base:
How to call a Visual Basic .NET assembly from Visual Basic 6.0 and call a Visual Basic COM component from Visual Basic .NET
How to use ActiveX components in Visual Studio .NET with Visual Basic .NET
Article ID: 329658 - Last Review: December 30, 2006 - Revision: 1.3
- Microsoft .NET Framework 1.0 Service Pack 2
- Microsoft .NET Framework 1.0 Service Pack 1
- Microsoft .NET Framework 1.0
|kbcominterop kbclient kbfunctions kbconsole kbbug kbfix kbqfe kbnetframe100presp3fix kbprb KB329658|Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.