IE Print compand in .net does not work when running from program files app folder

VertisMedia
VertisMedia used Ask the Experts™
on
I have narrowed down an issue that is really really interesting. With IE6 installed our application works just fine. It will use the .ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT2 command just fine while running from the program files installed location. Once Installing IE7 or greater our application will not fire the .ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT2 command or the AxSHDocVw.AxWebBrowser.PrintDocument(opt) comand or mshtml.IHTMLDocument2.execCommand("Print", ShowUI, Nothing) will not fire from within the program files folder in the installed application directory. IT does work from visual studio in any mode. It does work from any other folder.  I have a much smaller application that works anywhere but it also does not work in that folder it works in a sub folder but not that folder.

c:\program files\app\code\app.exe NOT WORKING
c:\program files\app\code\testapp.exe NOT WORKING
c:\program files\app\code\test\testapp.exe WORKING
c:\dev\test\testapp.exe WORKING
c:\dev\app\code\app.exe WORKING
c:\dev\app\code\app.exe Visual Studio WORKING
c:\dev\app\code\app.exe Visual Studio Debug WORKING
c:\dev\app\code\app.exe Visual Studio Relese WORKING

Something is blocking the brint funtionality from working from within that folder after IE7 is installed.
Im at a loss.

I have a included the print code I'm basing my print code off of. This is also the appliciton that I used to test and prove that it is all from that one folder. that it does not work. I also have a link to another thread that had the same issue but he did not realize that the issue was connected to his folder and not visual studio which i also thought for some time.....

So please any help would be great.

http://www.codeproject.com/KB/printing/printhml.aspx

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=2903298&SiteID=1
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
I think I might have found it. I went through and systematicly removed all the third party dll's in that folder and found that the ieframe.dll file version 7.00.6000.16674 (vista_gdr.080415-1732) even though not used by this code was affecting the code indirectly. One of the inter ops being called from or the .net system code being called used it and because IE7 uses a new one or different one it was causing an issue with the current one in that folder...... Holly f what a bugger to fix.  please let me know what you think and or why and how this could have happened. This seams like a Microsoft compat issue righ? I have attached the dll for those who want to test or see this issue.
ieframe.dll.zip
VertisMedia,
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial