title: How to declare an arguments of type void* in IDL
body: <p>I am developing ATL project. Some interfaces contain arguments to pass the various pointers. Here is my IDL file:</p>
  
  <pre><code>import "oaidl.idl";
  import "ocidl.idl";
  [
      object,
      uuid(618E64F5-676B-4A13-A513-DE3D4097294A),
      dual,
      nonextensible,
      helpstring("IMyObject Interface"),
      pointer_default(unique)
  ]
  interface IMyObject : IDispatch{
      [id(1), helpstring("method Make")] HRESULT Make(DWORD type, LPVOID settings);
      [id(2), helpstring("method Deserialize")] HRESULT Deserialize(LPVOID dataPtr, DWORD dataSize);
  };
  [
      uuid(E57065B4-498F-4347-9ACC-A2C86A771720),
      version(1.0),
      helpstring("TestComVoid 1.0 Type Library")
  ]
  library TestComVoidLib
  {
      importlib("stdole2.tlb");
      [
          uuid(1DC2528B-EA49-4F89-BB56-B1D667379644),
          helpstring("MyObject Class")
      ]
      coclass MyObject
      {
          [default] interface IMyObject;
      };
  };
  </code></pre>
  
  <p>The first method of IMyObject constructs an object based on the type and the corresponding structure. The second method constructs an object based on binary data.</p>
  
  <p>But I get error MIDL2139 : type of the parameter cannot derive from void or void *</p>
  
  <p>In addition, I want to make a C# wrapper with IntPtr arguments to pass pointers. ("Add reference"->COM->"TestComVoid 1.0 Type Library")</p>
  
  <p>I tried to use INT_PTR instead of LPVOID, then I get int instead of IntPtr.
  I tried to use DWORD_PTR instead of LPVOID, then I get uint instead of IntPtr.
  I tried to use VARIANT instead of LPVOID, then I get Object instead of IntPtr.</p>
  
  <p>How to correctly pass pointers to these cases?</p>