Visual Studio 2010!

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.
ADVERTISEMENT
ADVERTISEMENT

 

DevSource.com: Your Source for Visual Studio on Facebook
ADVERTISEMENT
Calling .Net Classes from Visual Basic 6
By Peter Aitken

Rate This Article: Add This Article To:

Calling .Net Classes from Visual Basic 6 - ' Compiling Your Wrapper '
( Page 3 of 4 )

Compiling and Registering Your Wrapper

The source code for the needed wrapper is simple. Unfortunately, compiling and using it is not quite as easy.

On the bright side, it can be done using batch files from the command line, and you do not even need Visual Studio to do so, just the .Net Software Development Kit which is a free download from Microsoft. You start by opening a command prompt and specifying the path to the SDK executables. You can type these commands in manually at the prompt or combine them in a batch file; the latter is certainly more convenient for regular use. Here's the command to set the required path:

path=%path%;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;
  C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin

This assumes that you have installed the SDK in the default location.

Next, you need a strong name key pair. Signing an assembly with a strong name is a requirement that ensures the data integrity and authenticity of an assembly, and also ensures that it has a unique name in the global assembly cache. You create a strong name key pair using sn.exe, the Strong name utility that is part of the .Net SDK. The syntax is:

sn -k filename

By custom, the .snk extension is used, so you might enter:

sn -k sgkey.snk



 
 
>>> More Using Microsoft Visual Studio Articles          >>> More By Peter Aitken