title: Using DLL import/Declare in VB.NET with parameter types not used by .NET
body: <p>I am working on a project where I have to import a DLL file into a VB project that was created a few years back. The DLL was created in C++, and looks like:</p>
  
  <pre><code>void CoordinateConversionService::convert( SourceOrTarget::Enum sourceDirection, SourceOrTarget::Enum targetDirection, CoordinateTuple* sourceCoordinates, Accuracy* sourceAccuracy, CoordinateTuple&amp; targetCoordinates, Accuracy&amp; targetAccuracy )
  </code></pre>
  
  <p>I am an intern at my job, and I haven't had to use this yet, so my understanding is extremely limited, along with my usage of VB (I'm a C++/C# guy). Here are a few questions:</p>
  
  <p>1) Looking at Dllimport, it seems like the last part outside of the parameters is a return type. Example code from another site:</p>
  
  <pre><code>&lt;DllImport("advapi32.dll")&gt; _
    Public Function GetUserName( _
       ByVal lpBuffer As StringBuilder, _
       ByRef nSize As Integer) As Boolean
  </code></pre>
  
  <p>Is "As Boolean" the return type? If so, I tried using "Sub" and it says "Keyword does not name a type." Hence why I looked into declare, because it seems I CAN return void/sub as a return type.</p>
  
  <p>2) Trying to use the types "CoordinateTuple" and "Accuracy" give me problems, saying that they aren't defined. How do I get around this since I don't think I can really define them, and what about the fact that they're pointers? Also - I cannot modify the C++ code in any way, so what I have is what I have.</p>