You receive an "System.ArgumentException" exception on a Microsoft Windows 98 operating system when you set the CurrentInputLanguage property (814740)
The information in this article applies to:
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
- the operating system: Microsoft Windows 98
SYMPTOMSYou set the CurrentInputLanguage property of the InputLanguage class in a console application or in a class library application.
Your application does not show a form or a message box before it sets the
property.
When you run your application on a
Microsoft Windows 98 operating system, you receive the following
exception: System.ArgumentException: This
inputLanguage is not recognized by the system. Parameter name: value at
System.Windows.Forms.InputLanguage.set_CurrentInputLanguage(InputLanguage
value) CAUSEWhen you set the CurrentInputLanguage property in your application, .NET runtime calls the ActivateKeyBoardLayout method in User32.dll.
This method requires OLE to be initialized. ActivateKeyBoardLayout returns a null handle because OLE is not initialized for the
current thread.
Therefore, you receive an
exception when you run the application on a Windows 98 operating system.
RESOLUTIONTo resolve the problem as it is described in the "More Information" section
of this article, follow these steps:
- In the Main procedure of Class1, add
the following statement before the
InputLanguage.CurrentInputLanguage property.
Microsoft Visual Basic .NET or Microsoft Visual Basic 2005 Code'Initializes the OLE
Application.DoEvents() Microsoft Visual C# .NET Code//Initializes the OLE
Application.DoEvents(); - On the Build menu, click Build
Solution.
- In Solution Explorer, expand Setup1.
- Right-click Primary output from
ConsoleApplication1, and then click
Remove.
- Install the setup project on the destination
computer.
STATUS This
behavior is by design.REFERENCESFor more information, visit the following MSDN Web sites:
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbprb kbsetup kbDeployment kbForms kbWindowsForms kbInput KB814740 kbAudDeveloper |
---|
|