Creating Desktop Lnk - How to access IWshRuntimeLibrary (w/ command-line compiler)

  • Thread starter Thread starter mattapt
  • Start date Start date
M

mattapt

I've found plenty of examples on how to use IWshRuntimeLibrary in C#
in order to create a desktop link (or shortcut) to an application.

However, how is it that I can use this in my application? I've seen
references to how to do this using the IDE, but I'm doing this
strictly from the command-line.

I've heard that this comes from wshom.ocx, but I'm not sure how this
all works together so that my program will compile with the "using
IWshRuntimeLibrary;" code.

Thanks.
 
mattapt,

If you are using an OCX (which means you are using an ActiveX control),
then you can use the AXIMP utility to create an interop assembly that you
can call from managed code.

If you are using a COM object, then you can use the TLBIMP utility to
create a managed wrapper for the objects in the COM server/TLB.

Hope this helps.
 
Thanks for the tip.

Is this basically what is done behind the scenes when using the IDE?
Is this going to give me access to IWshRuntimeLibrary?
 
Ok, I figured it out.

Use TLBIMP on the wshom.ocx to create IWshRuntimeLibrary.dll

When building, include in the command-line the following

/r:<your path here>\IWshRuntimeLibrary.dll

Thanks much Nicholas!
 
Back
Top