Need help with an IActiveDesktop / Shell32 problem

Hi all,

I'm having a frustrating problem creating the ActiveDesktop object off Shell32.dll. Here's the code I'm using (distilled to essentials):

Private CLSID_ActiveDesktop As New Guid("75048700-EF1F-11D0-9888-006097DEACF9")

Private _Instance As IActiveDesktop

Public Sub New()

Dim t As Type

Dim obj As Object

t = Type.GetTypeFromCLSID(CLSID_ActiveDesktop)

obj = Activator.CreateInstance(t)

_Instance = CType(obj, IActiveDesktop)

End Sub

The line:

obj = Activator.CreateInstance(t)

fails with the error: "Retrieving the COM class factory for component with CLSID {75048700-EF1F-11D0-9888-006097DEACF9} failed due to the following error: 8007007e." 0x8007007e = File Not Found. This same code works on another computer (both WinXP Pro, service pack level may be different). I've also tried P/Invoke-ing CoCreateInstance directly; I get the same error. OleView.exe gives the same error. Examining the registry, all the required values appear to be in place.

Anybody have any tips how I might get some more informative troubleshooting info

John



Answer this question

Need help with an IActiveDesktop / Shell32 problem

  • techuser08

    I have InProcServer32 keys for shell32.dll that are both REG_EXPAND_SZ and REG_SZ. If the value contains %SystemRoot%, the type should be REG_EXPAND_SZ. Your default value may have been messed up by some crappy install program, possibly even adding a trailing space or something. Try putting it back to REG_EXPAND_SZ and %SystemRoot% by hand...


  • gr8mind

    OK, this one's STRANGE.

    I changed the InProcServer32 default value for the ActiveDesktop CoClass from "%SystemRoot%\system32\SHELL32.dll" to "C:\WINDOWS\system32\SHELL32.dll" and it works!

    I wonder if somehow the data type of that value got changed from REG_EXPAND_SZ to REG_SZ I know I'm grasping at straws here, but it's all I can come up with. %SystemRoot% is still defined (and correct). Can default values even be REG_EXPAND_SZ

    John


  • Aaron Sulwer

    The error indicates that LoadLibrary failed, sure sounds like c:\windows\system32\shell32.dll is missing. I couldn't completely analyze your code, where did you get the definition for IActiveDesktop It is not present in the type library embedded in shell32.dll



  • Need help with an IActiveDesktop / Shell32 problem