1

I'm trying to write some MIDL in visual studio to define an interface I want to play with for some windows runtime research. The interface I want to use has some methods that take IStorageItem and IStorageFolder parameters, and I noticed these were defined in windows.storage.idl (from the Microsoft SDK). However when I import this idl into mine I get the following errors:

C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\windowscontracts.idl(5) : error MIDL2025 : syntax error : expecting an interface name or DispatchInterfaceName or CoclassName or ModuleName or LibraryName or ContractName or a type specification near "namespace"    
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\windowscontracts.idl(7) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation

Note that I have tried newer version of the SDK (right up to the latest) with the same results (and before hitting this error midl happily processes lots of other winrt idl files).

Can anyone shed some light on this problem and how I might fix it? I don't really want to manually define the storage interfaces since they look fiddly to do!

1 Answers1

0

I had a similar problem and resolved it by passing an additional parameter to midl:

midl [input] /winrt
zawuza
  • 854
  • 12
  • 16