Creating an IShellLink in .NET
COM
1
Posts
1
Posters
4
Views
1
Watching
-
Why is it that this native code works to create an IShellLink object:
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&psl);
But this managed code throws "COM Error: Class not registered"
var Link = new Shell32.ShellLinkObject();
In the C# project I have a reference to Shell32. I'm on Windows 10 x64 and I have the C# project set to build for "Any CPU". So what's the problem here?
The difficult we do right away... ...the impossible takes slightly longer.