Visual Basic Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘microsoft visual c’

“Differences Between Visual Basic .NET and Visual C# .NET” white paper is available

Symptoms
This article points to the “Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET” white paper.
Resolution
Because of the previous differences between Visual Basic and C/C++, many developers assume incorrectly about the capabilities of Visual Basic .NET. Many Visual Basic developers think that Visual C# is a more powerful language than Visual Basic. In other words, Visual Basic developers assume that you can do many things in Visual C# that you cannot do in Visual Basic .NET, just as there are many things that you can do in C/C++ but cannot do in Microsoft Visual Basic 6.0 or earlier. This assumption is incorrect.
Although there are differences between Visual Basic .NET and Visual C# .NET, both are first-class programming languages that are based on the Microsoft .NET Framework, and they are equally powerful. Visual Basic .NET is a true object-oriented programming language that includes new and improved features such as inheritance, polymorphism, interfaces, and overloading. Both Visual Basic .NET and Visual C# .NET use the common language runtime. There are almost no performance issues between Visual Basic .NET and Visual C# .NET. Visual C# .NET may have a few more “power” features such as handling unmanaged code, and Visual Basic .NET may be skewed a little toward ease of use by providing features such as late binding. However, the differences between Visual Basic .NET and Visual C# .NET are very small compared to what they were in earlier versions.
The “Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET” white paper describes some of the differences between Visual Basic .NET and Visual C# .NET. However, remember that the .NET Framework is intended to be language independent. When you must select between Visual Basic .NET and Visual C# .NET, decide primarily based on what you already know and what you are comfortable with. It is easier for Visual Basic 6.0 developers to use Visual Basic .NET and for C++/Java programmers to use Visual C# .NET. The existing experience of a programmer far outweighs the small differences between the two languages.
No matter which language you select based on your personal preference and past experience, both languages are powerful developer tools and first-class programming languages that share the common language runtime in the .NET Framework.
The following file is available for download from the Microsoft Download Center:

Collapse this imageExpand this image
Download the “Differences between Microsoft Visual Basic .NET and Microsoft Visual C# .NET” white paper package now.(http://download.microsoft.com/download/6/3/5/6354bf47-c597-4029-89e9-2495e7539ab9/vbcsharpwp.exe)Release Date: June 18, 2002
For more information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591?(http://support.microsoft.com/kb/119591/)How to obtain Microsoft support files from online servicesMicrosoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

BUG: When You Remove Visual C# .NET an Error May Occur If You Try to Install Visual Studio Tools for Office

Symptoms
When you try to install Microsoft Visual Studio Tools for the Microsoft Office System on a computer with Microsoft Visual Basic .NET Standard 2003 installed, you may receive the following error message:

Setup cannot detect the required version of Visual Studio .NET on this computer.Before you install this product, you must install a matching regional version of Visual Studio .NET 2003 or Visual Basic .NET 2003 Standard.
Resolution
This error may occur if all the following conditions are sequentially true:Visual Basic .NET Standard 2003 is installed on the computer.Microsoft Visual C# .NET Standard 2003 is installed onthe computer.Visual C# .NET Standard 2003 isremoved.You try to installVisual Studio Tools for Office.

BUG: “Old format or invalid type library” error when automating Excel

Symptoms
If you automate Microsoft Excel with Microsoft Visual Basic .NET, Microsoft Visual C# .NET, or Microsoft Visual C++, you may receive the following error when calling certain methods:

Error: 0×80028018 (-2147647512)
Description: Old Format or Invalid Type Library
Resolution
You receive this error calling an Excel method when the following conditions are true: The method requires an LCID (locale identifier). You run an English version of Excel. However, the regional settings for the computer are configured for a non-English language. If the client computer runs the English version of Excel and the locale for the current user is configured for a language other than English, Excel will try to locate the language pack for the configured language. If the language pack is not found, the error is reported.

“Differences Between Visual Basic .NET and Visual C# .NET” white paper is available

Symptoms
This article points to the “Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET” white paper.
Resolution
Because of the previous differences between Visual Basic and C/C++, many developers assume incorrectly about the capabilities of Visual Basic .NET. Many Visual Basic developers think that Visual C# is a more powerful language than Visual Basic. In other words, Visual Basic developers assume that you can do many things in Visual C# that you cannot do in Visual Basic .NET, just as there are many things that you can do in C/C++ but cannot do in Microsoft Visual Basic 6.0 or earlier. This assumption is incorrect.
Although there are differences between Visual Basic .NET and Visual C# .NET, both are first-class programming languages that are based on the Microsoft .NET Framework, and they are equally powerful. Visual Basic .NET is a true object-oriented programming language that includes new and improved features such as inheritance, polymorphism, interfaces, and overloading. Both Visual Basic .NET and Visual C# .NET use the common language runtime. There are almost no performance issues between Visual Basic .NET and Visual C# .NET. Visual C# .NET may have a few more “power” features such as handling unmanaged code, and Visual Basic .NET may be skewed a little toward ease of use by providing features such as late binding. However, the differences between Visual Basic .NET and Visual C# .NET are very small compared to what they were in earlier versions.
The “Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET” white paper describes some of the differences between Visual Basic .NET and Visual C# .NET. However, remember that the .NET Framework is intended to be language independent. When you must select between Visual Basic .NET and Visual C# .NET, decide primarily based on what you already know and what you are comfortable with. It is easier for Visual Basic 6.0 developers to use Visual Basic .NET and for C++/Java programmers to use Visual C# .NET. The existing experience of a programmer far outweighs the small differences between the two languages.
No matter which language you select based on your personal preference and past experience, both languages are powerful developer tools and first-class programming languages that share the common language runtime in the .NET Framework.
The following file is available for download from the Microsoft Download Center:

Collapse this imageExpand this image
Download the “Differences between Microsoft Visual Basic .NET and Microsoft Visual C# .NET” white paper package now.(http://download.microsoft.com/download/6/3/5/6354bf47-c597-4029-89e9-2495e7539ab9/vbcsharpwp.exe)Release Date: June 18, 2002
For more information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591?(http://support.microsoft.com/kb/119591/)How to obtain Microsoft support files from online servicesMicrosoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

PRB: “System.Messaging.MessageQueueException” Error Message When You Run the MessageQueue.Send Method MSDN Sample Code or When You Run the MessageQueue.Receive Method MSDN Sample Code

Symptoms
When you run the sample code that appears on certain Microsoft Developer Network (MSDN) Web sites, you may receive the following error message:

An unhandled exception of type ‘System.Messaging.MessageQueueException’ occurred in system.messaging.dll
Additional information: External component has thrown an exception.The following MSDN Web sites are affected:
MessageQueue.Send Method
http://msdn2.microsoft.com/en-us/library/system.messaging.messagequeue.send(vs.71).aspx(http://msdn2.microsoft.com/en-us/library/system.messaging.messagequeue.send(vs.71).aspx)
MessageQueue.Send Method (Object)
http://msdn2.microsoft.com/en-us/library/aa329510(VS.71).aspx(http://msdn2.microsoft.com/en-us/library/aa329510(VS.71).aspx)
MessageQueue.Send Method (Object, MessageQueueTransaction)
http://msdn2.microsoft.com/en-us/library/aa329511(VS.71).aspx(http://msdn2.microsoft.com/en-us/library/aa329511(VS.71).aspx)
MessageQueue.Receive Method
http://msdn2.microsoft.com/en-us/library/system.messaging.messagequeue.receive(vs.71).aspx(http://msdn2.microsoft.com/en-us/library/system.messaging.messagequeue.receive(vs.71).aspx)
MessageQueue.Receive Method (MessageQueueTransaction)
http://msdn2.microsoft.com/en-us/library/aa329505(VS.71).aspx(http://msdn2.microsoft.com/en-us/library/aa329505(VS.71).aspx)
MessageQueue.Receive Method (TimeSpan, MessageQueueTransaction)
http://msdn2.microsoft.com/en-us/library/aa329508(VS.71).aspx(http://msdn2.microsoft.com/en-us/library/aa329508(VS.71).aspx)
Resolution
The sample code that appears on these MSDN Web sites contains the following code that may cause you to receive the System.Messaging.MessageQueueException error message.
Microsoft Visual Basic .NET

myQueue.Send(“My Message Data.”, New _MessageQueueTransaction())Microsoft Visual C# .NET

myQueue.Send(“My Message Data.”, newMessageQueueTransaction());Microsoft Visual C++ .NET

myQueue->Send(S”My Message Data.”, new MessageQueueTransaction());You receive the error message because the call to the myQueue.Send method uses a MessageQueueTransaction object without starting a transaction. Additionally, even if you start a transaction before calling the myQueue.Send method, your application may wait indefinitely to receive the sent message. However, your application does not receive a sent message unless the corresponding transaction is committed.
Note The MessageQueue.Send(Object, MessageQueueTransaction) method applies only to transactional queues. Therefore, you receive the error message that is mentioned in the “Symptoms” sectiononly if you use transactional queues.

List of bugs that are fixed in Visual Studio .NET 2003 Service Pack 1

Symptoms
Microsoft Visual Studio .NET version 2003 Service Pack 1 (SP1) contains fixes for many bugs that have been documented in the Microsoft Knowledge Base (KB). This article lists these KB articles.
The list contains links to articles about Microsoft ASP.NET and Web Forms, Microsoft Visual Basic .NET, Microsoft Visual C# .NET, Microsoft Visual C++ .NET, Microsoft Visual J# .NET, Microsoft Visual Studio .NET, and Microsoft Visual Studio for Devices.
Resolution
This article contains a list of Microsoft Knowledge Base (KB) articles that describe bugs that are fixed in Microsoft Visual Studio .NET 2003 SP1.
To obtain Visual Studio .NET 2003 SP1, visit the following Microsoft Download Center Web site:
http://www.microsoft.com/downloads/details.aspx?familyid=69d2219f-ce82-46a5-8aec-072bd4bb955e(http://www.microsoft.com/downloads/details.aspx?familyid=69d2219f-ce82-46a5-8aec-072bd4bb955e)To see a complete list of updates for Visual Studio .NET products and for Microsoft .NET Framework products, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/vstudio/aa718693.aspx(http://msdn2.microsoft.com/en-us/vstudio/aa718693.aspx)