473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

aximp of shdocvw.dll -> problem with ShellExecute

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.
----------------------------------------------------------------------------
---------------

Nov 15 '05 #1
3 5441
<ciach>
try to use
aximp with /source option
rename shdocvw.dll
compile axshdocvw.cs
i don't try it but mayby it works
pozdrawiam

--
Selvin - Przemek Sulikowski
se****@osadkowski.com.pl
Nov 15 '05 #2
Wiktor,

The following is mentioned in the documentation for AXIMP.EXE, and I
think it applies to your situation:

Running Aximp.exe over the ActiveX Control shdocvw.dll will always create
another file named shdocvw.dll in the directory from which the tool is run.
If this generated file is placed in the Documents and Settings directory, it
causes problems for Microsoft Internet Explorer and Windows Explorer. When
the computer is rebooted, Windows looks in the Documents and Settings
directory before the system32 directory to find a copy of shdocvw.dll. It
will use the copy it finds in Documents and Settings and attempt to load the
managed wrappers. Internet Explorer and Windows Explorer will not function
properly because they rely on the rendering engine in the version of
shdocvw.dll located in the system32 directory. If this problem occurs,
delete the copy of shdocvw.dll in the Documents and Settings directory and
reboot the computer.

What I would recommend doing is using AXIMP.EXE to generate your
wrappers. Then, use ILDASM do disassemble the wrappers for both. Once you
have that, you can recompile the IL for ShDocVw.dll (the one that AXIMP
generated) into another assembly with a different name. Then, you should be
able to do the same with the IL for AxShDocVw.dll, adding a reference to the
new dll that you just compiled. You should then be able to have these in
your directory and use them no problem.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Wiktor Zychla" <ie****@microsoft.com.no.spam> wrote in message
news:uS****************@TK2MSFTNGP10.phx.gbl...
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.
-------------------------------------------------------------------------- -- ---------------

Nov 15 '05 #3
> What I would recommend doing is using AXIMP.EXE to generate your
wrappers. Then, use ILDASM do disassemble the wrappers for both. Once you have that, you can recompile the IL for ShDocVw.dll (the one that AXIMP
generated) into another assembly with a different name. Then, you should be able to do the same with the IL for AxShDocVw.dll, adding a reference to the new dll that you just compiled. You should then be able to have these in
your directory and use them no problem.

Hope this helps.


big thanks to you both, especially to you, Nicholas. your trick works
perfectly. I am amazed.

Regards,
Wiktor
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Moi | last post by:
Hello, I used AxImp on one ActiveX I've written (VC++6), and I'm trying to use the generated assemblies in VB. Net. it seems that the underlying ocx is not created when I'm calling the...
2
by: Or Lavy | last post by:
Hi there, As mentioned in message "aximp of shdocvw.dll -> problem with ShellExecute" posted before, aximp creates two files: AxSHDocVW.dll SHDocVW.dll The second has the same name as the...
1
by: Joachim | last post by:
Hello, I use aximp to create assemblys for a ocx file. My problem is, that I wan't to rename the 2 dll files that are created. The out paramter only rename the AX*.dll file and not the other...
1
by: Brett | last post by:
I'm trying to save a webpage in the IE object (SHDocVw) via save as "web page complete". Using this code: Me.IE_Inst.ExecWB(SHDocVw.OLECMDID.OLECMDID_SAVEAS,...
3
by: Jay A. Moritz | last post by:
I have an application that loads IE and iterates through web pages to retrieve information from the page then activates specific controls to retrieve the next page and iterate through that page for...
0
by: John Olbert | last post by:
I am trying to use a number of Vb6 and Vcp6 ActiveX controls in various Vs2005 C# Windows Form programs. I am trying to use Aximp.exe on the Ocx file and to take the generated Dll's and add them...
9
by: madushan | last post by:
hi all , I try to generate .cs file from AxInterop.SHDocVw.dll by using the bellow command C:\Documents and Settings\malik\Desktop\Debug>aximp out:AxInterop.SHDocVw.dll /source but then bellow...
1
by: madushan | last post by:
hi all, once i try to generate .cs file by using the aximp.exe tool it gives the error the command I used: C:\Documents and Settings\malik\Desktop\tt>aximp SHDocVw.dll...
5
by: SQACSharp | last post by:
I'm trying to automate an action in Internet Explorer.... I'm trying to click an image that open a popup menu. The html code of the iimage look like like <img blabla..OnClick="ShowMenu()"/> I...
1
by: Anil Gupte | last post by:
The following code works in VB.Net 2003, but not in 2005 While webBrowserTemp.ReadyState <SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE Application.DoEvents() End While I tried dim WState as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.