W
Wiktor Zychla
I have a problem I cannot solve.
My application hosts IE activex control. I follow the standard procedure: I
just aximp shdocvw.dll. Note that this gives you two files: axshdocvw.dll
and shdocvw.dll.
And there comes the problem. I reference the libraries from my project. For
this to work, I put the libraries in the same directory as the application.
Now, from my code I try to ShellExecute to a link (to show it in a new
window):
Process p = new Process();
p.StartInfo.FileName = http://www.google.com;
p.Start();
this, of course, does not work: the ShellExecute method uses the ShdocVw.dll
that is in the current directory (the imported one) instead of the proper
one (I had spent 3 hours until I've realized that)!
this is how I tried to solve the problem:
1. aximp to another name than shdocvw does not work (if you run aximp
/out:blah then only the first imported dll is renamed to blah.dll. the
shdocvw.dll is still shdocvw.dll!)
2. renaming the shdocvw.dll manually and modiify the references does not
work (the runtime cries about missing interfaces when trying to show a form
with hosted explorer component).
3. moving the imported shdocvw.dll to another directory is not an option,
the library should be in the same directory as the main module.
Now, I am stuck. I have no idea why aximp creates TWO libraries and why one
of them MUST be named shdocvw.dll, just like the original one. I have no
idea how, then, use ShellExecute that would use proper shdocvw.dll.
Thanks form your help,
Wiktor Zychla
----------------------------------------------------------------------------
---------------
steps to reproduce my problem:
1. aximp shdocvw.dll gives you axshdocvw.dll and shdocvw.dll.
2. put imported axshdocvw.dll and shdocvw.dll in a directory and create a
new application.
3. put a code into the application:
....
Process p = new Process();
p.StartInfo.FileName = http://www.google.com;
p.Start();
you get an error because the ShellExecute inside p.Start() uses the
shdocvw.dll from the current directory (the Exception.Message is
misleading).
4. remove shdocvw.dll from the current directory. run the application. it
works ok.
My application hosts IE activex control. I follow the standard procedure: I
just aximp shdocvw.dll. Note that this gives you two files: axshdocvw.dll
and shdocvw.dll.
And there comes the problem. I reference the libraries from my project. For
this to work, I put the libraries in the same directory as the application.
Now, from my code I try to ShellExecute to a link (to show it in a new
window):
Process p = new Process();
p.StartInfo.FileName = http://www.google.com;
p.Start();
this, of course, does not work: the ShellExecute method uses the ShdocVw.dll
that is in the current directory (the imported one) instead of the proper
one (I had spent 3 hours until I've realized that)!
this is how I tried to solve the problem:
1. aximp to another name than shdocvw does not work (if you run aximp
/out:blah then only the first imported dll is renamed to blah.dll. the
shdocvw.dll is still shdocvw.dll!)
2. renaming the shdocvw.dll manually and modiify the references does not
work (the runtime cries about missing interfaces when trying to show a form
with hosted explorer component).
3. moving the imported shdocvw.dll to another directory is not an option,
the library should be in the same directory as the main module.
Now, I am stuck. I have no idea why aximp creates TWO libraries and why one
of them MUST be named shdocvw.dll, just like the original one. I have no
idea how, then, use ShellExecute that would use proper shdocvw.dll.
Thanks form your help,
Wiktor Zychla
----------------------------------------------------------------------------
---------------
steps to reproduce my problem:
1. aximp shdocvw.dll gives you axshdocvw.dll and shdocvw.dll.
2. put imported axshdocvw.dll and shdocvw.dll in a directory and create a
new application.
3. put a code into the application:
....
Process p = new Process();
p.StartInfo.FileName = http://www.google.com;
p.Start();
you get an error because the ShellExecute inside p.Start() uses the
shdocvw.dll from the current directory (the Exception.Message is
misleading).
4. remove shdocvw.dll from the current directory. run the application. it
works ok.