?
Solved

What does "Imports System.Runtime.InteropServices" mean

Posted on 2007-03-19
2
Medium Priority
?
515 Views
Last Modified: 2010-04-14
I'm trying to use a snippet of code from a solution that I found here:
http://www.experts-exchange.com/Programming/Languages/.NET/Q_21739204.html
I’m not sure I understand what kind form this is.

The project only comes-up with two warnings:
Unused local variable: 'size'.

And:

Variable 'class' is passed by reference before it has been assigned a value. A null reference exception could result at runtime.

I will deal with those warning in another thread but what does this line mean:
Imports System.Runtime.InteropServices
0
Comment
Question by:Delta526
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Jason Evans earned 2000 total points
ID: 18752827
Hi there.

Basically, System.Runtime.InteropServices is used when you want to interact with the Windows API eg with declaring functions for API interactions:

 <DllImport("User32", False, CallingConvention.Cdecl, CharSet.Unicode)> _
  Public Shared Function SomeWinAPIFunction() As IntPtr

(note: don't use the above code copy-and-paste style since I just typed it off the top of my head - it could be incorrect!, but you get the idea.)

You also use this namespace if you want to do COM-based development with components written in, say, VB6 or VC++ 6 as en example.

There are many classes and interfaces to be found in this namespace which help a developer interact with COM components.

Jas.
0
 

Author Comment

by:Delta526
ID: 18753585
Thank you Jas,

Could this be one of the reasons the my findwindow API application does not work in VB.NET:
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22454660.html
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question