Re: Calling CreateDispatch to create Word Instance

Tech-Archive recommends: Speed Up your PC by fixing your registry



Thanks SvenC. So is there any way of Launching a word application when the
DLL is loaded in the memory, other than making the function call from the
application which loads this DLL? If there is no other way, then I have to
change the application which loads my DLL to invoke the word launching
function before invoking any other function of my DLL. I thought of avoiding
this step. But it seems..couldn't be done. I have read about the restrictions
of calling some functions from InitInstance of DLL. If I invoke the word
launching function in the DLL from the application which loads this DLL, the
user of the application will feel the latency of word application being
launched. This DLL is written in such a way, it will maintain the same
instance until the application which loads this DLL is closed. So for the
first time, when user invokes this word launching function, there will be
latency...So inorder to hide this latency when the user invokes the specific
functionality, I thought of launching the word application at the DLL load
time...Any suggestions are welcomed...

Pranav



"SvenC" wrote:

Hi Pranav,

for the typo. This code is inside DLL Constructor and this DLL is loaded
by
another application. I have checked the process list, once the
CreateDispatch
Statement gets hung. I couldn't see Winword.exe in the list. But when the
same set of code is put in a separate DLL function and call it from other
member function (except the constructor or InitInstance.), word could be
launched. When I try to call the same function from the
constructor/initInstance it gets hung. My sample code looks like this

My guess is that your code running in the constructor of InitInstance of
your CWinApp derived class will make it run in the context of DllMain.

You are quite restricted in what you can do in DllMain. See remarks:

http://msdn.microsoft.com/en-us/library/ms682583(VS.85).aspx

So you have to change your design that you use COM only at later
times, e.g. when a function of your dll gets called.

--
SvenC


.



Relevant Pages

  • Re: Manifests and requestedExecutionLevel
    ... launching a second .exe at Medium MIC. ... injecting a DLL into Explorer and sending a ... private message to the DLL to get it to launch an app with Medium MIC. ...
    (microsoft.public.vc.mfc)
  • Re: Write-once with DLL shared memory
    ... > that there was no Shared section in my Release version of the DLL. ... > launching the Debug version, I was launching the Release version, which ... > destination process did see the flag being set, ... -Software Consultant (Embedded systems and Real Time Controls) ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Calling CreateDispatch to create Word Instance
    ... DLL is loaded in the memory, other than making the function call from the ... application which loads this DLL? ... launching function in the DLL from the application which loads this DLL, ... latency...So inorder to hide this latency when the user invokes the specific ...
    (microsoft.public.vc.mfc)
  • Re: Dialog in DLL wont launch
    ... What type of DLL is it? ... either put the resource in resource chain or set the ... The code snippet for launching the dialog is as follows: ... Where do I plug the DLL's instance handle in so that the dialog can find ...
    (microsoft.public.vc.mfc)
  • Re: Execution detail of Asp.net
    ... page in another temp dir. ... then loads them. ... > compiles the page to a dll in a temp dir, and loads the page (again a ...
    (microsoft.public.dotnet.framework.aspnet)