
Class not registered when doing COM interop
You are absolutely correct. I created a new project in
C#, made the
references and placed your code in the form load. I got the same error.
BTW, The typelib shows it being supported in VB6 and you can make a
reference to it without error.
Checked in the registry and it isn't in there. So I guess if I pushed on it
hard enough in VB6, I'd get an error as well.
Sounds like its either a bug in the Shell32.dll or its been neutereed to
abate hackers.
HTH
Quote:
> I have been grappling with how to use functions from
> dll's. The classic example used is the messagebox which
> works very easily. I am trying to use a function from the
> shell32.dll. When I try to access the functin I get a
> class not registered error. I have included a very small
> example of what I am trying to do. I am at a loss for
> what I am doing wrong. Any help would be appreicated.
> // Added reference Shell32.dll to project
> using System;
> using System.Runtime.InteropServices;
> using Shell32;
> public class MyShellLink
> {
> [DllImport("Shell32.dll")]
> public static extern void Resolve(int fFlags);
> public MyShellLink()
> {
> }
> public void getLink()
> {
> IShellLinkDual isld;
> isld = new ShellLinkObjectClass();
> isld.Resolve(0);
> }
> }
> // When the application reaches the new
> ShellLinkObjectClass line
> // the following error is generated
> "COM object with CLSID { xxxxxxxxxxxxxxx} is either
> not valid or not registered.
> Thanks
> T.Fox