title: Include or forward declare a header struct in IDL for C++
body: <p>I have a header file (special.h) that includes the following struct:</p>
  
  <pre><code>typedef struct SPECIAL_STRUCT{
      UINT x;
      UINT y;
  } SPECIAL_STRUCT;
  </code></pre>
  
  <p>And I'd like to include this struct as the input parameter of a function in an IDL file that defines test interfaces (test.idl):</p>
  
  <pre><code>interface ITestInterface : IUnknown
  {        
      void* GetData(
          SPECIAL_STRUCT Special,
          UINT Data);
  };
  </code></pre>
  
  <p>What's the right way to do this? It sounds like I can do one of the following:</p>
  
  <ul>
  <li><p>According to <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa367049%28v=vs.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/aa367049%28v=vs.85%29.aspx</a>, I can "use the import directive to include data types defined in a header file." However, what's the syntax for doing that? I have tried the following:</p>
  
  <p>import "special.h" // error MIDL2025 : syntax error : expecting an interface name or DispatchInterfaceName or CoclassName or ModuleName or LibraryName or ContractName or a type specification near "DEFINE_GUID"</p></li>
  <li><p>Also according to <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa367049%28v=vs.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/aa367049%28v=vs.85%29.aspx</a>, I can "create a helper IDL file with a dummy interface that includes the header files." However, I prefer not to do this since I just need a single struct definition.</p></li>
  <li><p>I also tried forward delcaring the struct in the IDL, i.e.</p>
  
  <p>typedef struct SPECIAL_STRUCT; //error MIDL2312 : illegal syntax unless using mktyplib compatibility mode : SPECIAL_STRUCT</p>
  
  <p>struct SPECIAL_STRUCT; //error MIDL2025 : syntax error : expecting a type specification near SPECIAL_STRUCT</p></li>
  </ul>
  
  <p>I realize this might be a newbie IDL question, but I'd definitely apprecaite feedback. Thanks!</p>