title: DllImport on c#
body: <p>How do I access the functions of a C++ DLL in C#</p>
  
  <p>Here are the prototypes from the DLL:</p>
  
  <pre><code>NOMANGLE int CCONV SSPSendCommand (SSP_COMMAND * cmd, SSP_COMMAND_INFO * sspInfo);
  NOMANGLE int CCONV OpenSSPComPort (SSP_COMMAND * cmd);
  NOMANGLE int CCONV OpenSSPComPort2 (SSP_COMMAND * cmd);
  NOMANGLE int CCONV OpenSSPComPortUSB (SSP_COMMAND * cmd);
  NOMANGLE int CCONV CloseSSPComPort (void);
  NOMANGLE int CCONV CloseSSPComPort2 (void);
  NOMANGLE int CCONV CloseSSPComPortUSB (void);
  NOMANGLE int CCONV DownloadFileToTarget (char * szFilename, int cPort, unsigned char sspAddress);
  NOMANGLE long CCONV GetRamDownloadStatus (RAM_UPDATE_STATUS * rmData);
  NOMANGLE int CCONV SetPortCloseOption (unsigned int md);
  NOMANGLE int CCONV OpenCCTComPort (int PortNumber);
  NOMANGLE int CCONV CloseCCTComPort (void);
  NOMANGLE int CCONV CCTSendPacket (unsigned char * pkt, unsigned char * length);
  </code></pre>
  
  <p>In C# I am attempting this:  </p>
  
  <pre><code>[DllImport ("ITLSSPProc.dll")]
  private extern static IntPtr SSP_COMMAND ();
  
  [DllImport ("ITLSSPProc.dll")]
  private static extern int OpenSSPComPort (SSP_COMMAND smd);
  </code></pre>
  
  <p>But it is giving me an error. What am I doing wrong? Thanks in advance</p>