I want to try this new csExWB class out. But I do not see a clear path on how to encorporate it into a hello-world like project. If one has say a VS2010 hello-world project, where thet made a simple form-based app that had the WebBrowser control in it. What would one have to do to use csExWB instead of the WebBrowser control?
I figure in the form_Load method, one would instantiate an instance of the csExWB class and pass the WebBrowser control to it, so the csExWB class could override it, but I do not see anything in csExWB to do this.
Also, what would one add as a reference to the hello-world project? Would they add a reference to csExWB.dll? What about Interop.CSEXWBDLMANLib.dll? Would one need to add that as well. Also, what about that csExWBDLMan.dll?
First of all csExWB must have been a monumental effort and Mike deserves enormous credit for his oevre ....
It is possible to incorporate csExWB into one's own project, but it requires some tenanicty. I had an application which included a WebBrowser control (effectively this is IE) and had got almost to the completion of my project when I git a problem which I could not overcome (downloading a file without the irritating "File Download" pop-up"). After 2 weeks of frustration I decided the only answer was a webbrowser like csExWB which does (I think) everything WebBrowser/IE does ... but also with a 'silent' and 'automatic' (or at least semi-automatic) file download capability. Perfect.
I did hit a few glitches though:
1. My original application had to be changed to build from 'Any CPU' down to 'X86'
2. I had to get the DemoApp working completely and then .... very slowly ... take components out of it until I had a barebones frmMain form which was JUST the browser window.
3. Could not get this barebones browser to work with 'Visible = false' (it just doesn't seem to want to 'go') so I reduced the browser window down to Size = (0,0) as a workaround )
4. Had to register the CSEXWBLDMANLib.dll library in the C:\Windows\SysWOW64 directory rather than C:\Windows\System32 before the program would build
5. Had to hack IN code to delete csExWB browser cookies and cache entries before I could get 'consistent' access to my target website
Apart from that, lots more grey hairs and many wrinkles, everything in my application is a thousand times better than using WebBrowser/IE
Hey folks! I got it encorporated. Here is what I had to do!
I had a VS2010 hello-world app. The app added the csExWB.dll and csExWBDLMANLib.dll as references. Supposedly this should also take care of registering csExWBDLMANLib.dll, albeit in my test, I had already manually run RegSvr32 on it ahead of time.
In my app, I added the old WebBrowser, so I could have something to work with the GUI of VS2010's form editor, and I named it "WebBrowser_Main".
Then I simply declared a cEXWB in my app's main form as a data member;
public csExWB.cEXWB cEXWB_This = null;
And in the MyForm's Constructor I instatiated it as such:
then in the MyForm_Load I added the event handler like this:
public void MyForm_Load(object objSender, EventArgs EventArgs_Param)
cEXWB_This.BeforeNavigate2 += new csExWB.BeforeNavigate2EventHandler(cEXWB_This_BeforeNavigate2);
cEXWB_This.NavigateComplete2 += new csExWB.NavigateComplete2EventHandler(cEXWB_This_NavigateComplete2);
cEXWB_This.DocumentComplete += new csExWB.DocumentCompleteEventHandler(cEXWB_This_DocumentComplete);
cEXWB_This.ProgressChange += new csExWB.ProgressChangeEventHandler(cEXWB_This_ProgressChange);
I am using VS2010 SP1 and my project is set to .NET 4, x86.
I did as above, and I have a refernce to C:\Users\Brian Hart\Dropbox\Downloads\C#\csEXWB\csExWB\DemoApp\bin\Debug\csExWB.dll and C:\Users\Brian Hart\Dropbox\Downloads\C#\csEXWB\csExWB\DemoApp\bin\Debug\Interop.CSEXWBDLMANLib.dll in my project.
My project is a Windows Forms project.
When I build the project, it builds ok.
When I run the project, it gets to the Application.Run() call in my Program class and then throws a FileNotFoundException. Details are below:
System.IO.FileNotFoundException was unhandled
Message=Could not load file or assembly 'Interop.CSEXWBDLMANLib, Version=18.104.22.168, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
FileName=Interop.CSEXWBDLMANLib, Version=22.214.171.124, Culture=neutral, PublicKeyToken=null
FusionLog==== Pre-bind state information ===
LOG: DisplayName = Interop.CSEXWBDLMANLib, Version=126.96.36.199, Culture=neutral, PublicKeyToken=null
LOG: Appbase = file:///C:/Users/Brian Hart/Dropbox/Documents/Visual Studio 2010/Projects/xyLOGIX/Desktop Apps/iCloudCalendar/iCloudCalendar/bin/Debug/
LOG: Initial PrivatePath = NULL
<h1>Calling assembly : csExWB, Version=188.8.131.52, Culture=neutral, PublicKeyToken=null.</h1>
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Brian Hart\Dropbox\Documents\Visual Studio 2010\Projects\xyLOGIX\Desktop Apps\iCloudCalendar\iCloudCalendar\bin\Debug\iCloudCalendar.vshost.exe.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/Brian Hart/Dropbox/Documents/Visual Studio 2010/Projects/xyLOGIX/Desktop Apps/iCloudCalendar/iCloudCalendar/bin/Debug/Interop.CSEXWBDLMANLib.DLL.
LOG: Attempting download of new URL file:///C:/Users/Brian Hart/Dropbox/Documents/Visual Studio 2010/Projects/xyLOGIX/Desktop Apps/iCloudCalendar/iCloudCalendar/bin/Debug/Interop.CSEXWBDLMANLib/Interop.CSEXWBDLMANLib.DLL.
LOG: Attempting download of new URL file:///C:/Users/Brian Hart/Dropbox/Documents/Visual Studio 2010/Projects/xyLOGIX/Desktop Apps/iCloudCalendar/iCloudCalendar/bin/Debug/Interop.CSEXWBDLMANLib.EXE.
LOG: Attempting download of new URL file:///C:/Users/Brian Hart/Dropbox/Documents/Visual Studio 2010/Projects/xyLOGIX/Desktop Apps/iCloudCalendar/iCloudCalendar/bin/Debug/Interop.CSEXWBDLMANLib/Interop.CSEXWBDLMANLib.EXE.
at iCloudCalendar.Program.get_MainWindow() in C:\Users\Brian Hart\Dropbox\Documents\Visual Studio 2010\Projects\xyLOGIX\Desktop Apps\iCloudCalendar\iCloudCalendar\Program.cs:line 12
at iCloudCalendar.Program.Main() in C:\Users\Brian Hart\Dropbox\Documents\Visual Studio 2010\Projects\xyLOGIX\Desktop Apps\iCloudCalendar\iCloudCalendar\Program.cs:line 23
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String args)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
I have copied the csExWBDLMan.dll file to the C:\Windows\SysWOW64 and ran regsvr32.exe on it and everything. Why is this exception throwing and how do I fix it?
Then I opened up the Add New Reference dialog box, clicked the COM tab and then clicked the csExWBDLMan entry in the list, clicked Add, hit build and worked! Previously, I had added the reference to the Interop.csExWBDLMan.dll file which does not actually work.
Last Visit: 31-Dec-99 18:00 Last Update: 2-Jul-15 5:26