views:

488

answers:

1

I readed on a forum that the "Next Desktop Background" command in Windows Aero Slideshow feature calls the stobject.dll file. So I runned the dumpbin to check wheter I could se an exported method to call:

Microsoft Visual Studio 9.0\VC\bin\dumpbin.exe /EXPORTS
     Windows\System32\stobject.dll
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.
Dump of file C:\Windows\System32\stobject.dll
File Type: DLL
Section contains the following exports for stobject.dll
00000000 characteristics
49EE914D time date stamp Wed Apr 22 00:38:53 2009
    0.00 version
       1 ordinal base
       2 number of functions
       2 number of names
ordinal hint RVA      name
      1    0 00001A28 DllCanUnloadNow
      2    1 000059A9 DllGetClassObject
Summary
    1000 .data
    2000 .reloc
   1A000 .rsrc
   1A000 .text

I guess if I P/Invoke one of those methods it won't work. What do I do?

+2  A: 

those two exports are standard COM exports, you would have to figure out which COM interface to use and call them in the normal COM way (If you have Visual Studio, you could run the OLE/COM Object Viewer on the dll and look at its type library if it has one)

Anders
---------------------------OLE/COM Object Viewer---------------------------IMoniker::BindToObject failed on the file moniker created from ( "C:\Windows\System32\stobject.dll" ).Bad extension for file MK_E_INVALIDEXTENSION ($800401E6)---------------------------OK ---------------------------
Jader Dias
---------------------------OLE/COM Object Viewer---------------------------LoadTypeLib( C:\Windows\System32\stobject.dll ) failed.Error loading type library/DLL. TYPE_E_CANTLOADLIBRARY ($80029C4A)---------------------------OK ---------------------------
Jader Dias
I couldn't realize how to find this library by name or guid. Opening the file in the OLE/COM Object viewer threw the exceptions above. Trying to reference it directly in a Visual Studio Project threw another exception. The bounty goes to who shows the steps I should take.
Jader Dias
---------------------------Microsoft Visual Studio---------------------------A reference to 'C:\WINDOWS\system32\stobject.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.---------------------------OK ---------------------------
Jader Dias
I finally found it on the OleViewer, and I could also drag and drop the dll to it. It exposes a few interfaces. Not sure how to proceed.
Jader Dias