use shell extension .dll out of an .exe (wrapper?)

Hi,
I have a little question, hope somebody can help.

So let's start:
I have a .dll that's normally used as a shell extension. It adds a fuctionality to windows explorers context menu. (a dialog pops up and tell's something about the internal file version).

Now I want to write an executable that exactly does the same by using the dll. starts up the dialog. the argv[1] should be used to specify the file which is (as an extension) the clicked one.

Normally a dll. exports a function to call with LoadLibrary and getProcAdress.

Thats the Exported Functions of the dll:
DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer

Which one to call?
How the Shell calls the DialogBox?
Is there a regestry key, where the 'call' is specified?
Is it possible to call the shell extension dialog from the .exe?

ThX
drax

Comments

  • : Hi,
    : I have a little question, hope somebody can help.
    :
    : So let's start:
    : I have a .dll that's normally used as a shell extension. It adds a fuctionality to windows explorers context menu. (a dialog pops up and tell's something about the internal file version).
    :
    : Now I want to write an executable that exactly does the same by using the dll. starts up the dialog. the argv[1] should be used to specify the file which is (as an extension) the clicked one.
    :
    : Normally a dll. exports a function to call with LoadLibrary and getProcAdress.
    :
    : Thats the Exported Functions of the dll:
    : DllCanUnloadNow
    : DllGetClassObject
    : DllRegisterServer
    : DllUnregisterServer
    :
    : Which one to call?
    : How the Shell calls the DialogBox?
    : Is there a regestry key, where the 'call' is specified?
    : Is it possible to call the shell extension dialog from the .exe?
    :
    : ThX
    : drax

    You shouldn't call any of the exported functions. Those are functions belonging the the COM-subsystem. This means that you shouldn't even LoadLibrary the dll, but instead, instantiate a COM-class which exposes the methods you need.
    Now this may be an entirely new subject for you, so I advise to learn more about COM.
    If you search the registry from HKEY_CLASSES_ROOT for the dll, you will probably find it somewhere, which means the dll is 'registered' as a COM-server. (hence the exported DllRegisterServer-method. This one is used by the Regsvr32 utility to register dll's as COM-servers. Guess what DllUnregisterServer does...).


    Greets,
    Eric Goldstein
    http://www.gvh-maatwerk.nl


  • Thanks,
    I gonna have a look on COM Server, and give a feedback if i'm closer to the solution.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories