I discovered that with this syntax, I would get a compile error:
importlib("MSADDNDR.dll");
The error given would be:
error MIDL2337 : unsatisfied forward declaration : _IDTExtensibility2 [ Coclass '_Extension' ]
But that's a lie, kind of. Looking earlier in the output, we see this:
warning MIDL2015 : failed to load tlb in importlib: : MSADDNDR.dll
So, if we change the attribute to include the full path:
importlib("C:\Program Files (x86)\Common Files\Designer\MSADDNDR.dll");
It will now compile correctly.... but... this is referencing a 32-bit DLL. Suppose I want to cross compile? So I specify /amd64
option to the MIDL. This still compiles successfully. I cannot find any documentation that may suggest that using full path to a potentially wrong bitness DLL for importlib
would cause problems.
Can anyone else confirm or deny if there are potential problems or if there might be a better approach to avoid embedding full path?
Interestingly, when I load the generated .tlb
file in the oleview
, the full path aren't there anymore; which suggests this is an non-issue but I'd like to make sure that is so.