I am trying to solve the doc to pdf conversion a开发者_Go百科s described here.
Since there is no a Delphi component (with source code) that creates pdf from doc, I was wondering how it is possible to "register the COM at runtime".
I AM NOT USING AN INSTALLER, I just deploy the exe. So the idea was to simply put the ActiveX dll in the resources and register it at program startup (or the first time I need to use it). Anyway for sure this will give problems in Vista or 7... Can anyone suggest how this can be accomplished?
Keep in mind that I want to keep deployemnt super easy = replace an exe.
COMMENT: Of course If there was a Delphi component for doing this I would have no problem since that functionality would already be there in the exe.
Vista and later support Non-admin ActiveX control (or per user ActiveX control): http://msdn.microsoft.com/en-us/library/dd433049(VS.85).aspx
You can also use Registration Free Com by specifying the dependancy in the exe's manifest. Some links:
Generate manifest files for registration-free COM http://msdn.microsoft.com/en-us/magazine/cc188708.aspx
Usually EXE OLE servers ships with standard command line switch /RegServer - try to start exe with this one
Will you consider a commercial component? If so, the BoxedApp SDK will let you do exactly what you are describing in your question (and more) , without having to worry about UAC or anything else. It works great with Delphi and .NET.
It comes with a Delphi sample on how to run a flash movie by bundling the Flash OCX and registering it at runtime.
精彩评论