|
|
- .NET 2.0 runtime
- ComUtilities.dll registration
- Building ComUtilities in VS 2008
- Click Once
- Registeration-Free COM
- csExWBDLMan.dll registeration
ComUtilities COM library
ComUtilities.dll is written in VC++ 8.0 (2005) using ATL 8.0 (ATL is not included in the Express edition) and is statically linked to ATL. This control is a replacement for the csExWBDLMan.dll library which was written in VC++ 6.0 using ATL 3.0. In the future, any additional features will be added to this library.
Before opening the solution or running the demo using ComUtilities.dll
- Running Vista, please make sure that you are logged in as admin and running the regsvr32.exe as admin
- ComUtilities.dll depends on CRT. This can be resolved either by adding C++ feature to your VS installation or installing Microsoft Visual C++ 2005 Redistributable Package
- Copy ComUtilities.dll located in the Release sub folder to your system directory
- Register ComUtilities.dll using regsvr32.exe, then Open the solution
Example: Assuming the system dir path is C:\windows\system32\
regsvr32.exe C:\windows\system32\ComUtilities.dll
To eliminate dependencies on ATL8.dll, go to "Project->ComUtilities Properties". When "ComUtilities Property Page" is displayed, expand "Configuration Properties" node and select "General". In the right pane, change "Use of ATL" option to "Static Link to ATL" choice. Apply changes, and rebuild solution. By default, all ComUtilities builds use "Static Link to ATL" choice.
Building ComUtilities in VS 2008
- Remove IUri and IInternetProtocolEx interface definitions from ComUtilities.idl
- In stdafx.h, change define WIN32_IE 0x0600 to define WIN32_IE 0x0700
- Rebuild the project
Warning D9035
To remove warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release. Go to Project menu->ComUtilities Properties, in the ComUtilities Proprty Pages, select the C/C++ node in the tree then in the right pane change "Detect 64-bit Portability Issues" to No.
Click Once
ComUtilities project properties is set to embed the manifest file withiin the output. This may cause problems when deployed using click once. To change this setting, go to "Project->ComUtilities Properties". When "ComUtilities Property Page" is displayed, expand "Configuration Properties" node, then expand "Manifest Tool" and select "Input and Output". In the right pane, change "Embed Manifest" option to No. Apply changes, and rebuild solution.
Registeration-Free COM
Using "Isolated" property, we can eliminate the need to register csExWBDLMan component. Please note that the COM component still requires registeration in the developement machine.
Limitation: Requires XP and up
In Soulution Explorer expand csEXWB project, under References locate CSEXWBDLMANLib entry, select it. Under properties find and set the Isolated property to true. Now rebuild the control and DemoApp (Use Release), exit the IDE, unregister the COM component with a command such as; Assuming the system dir path is C:\windows\system32\
regsvr32.exe /U C:\windows\system32\csExWBDLMan.dll
Now run the DemoApp.exe (Release version).
For further information, please refer to:
Escape DLL Hell Simplify App Deployment with ClickOnce and Registration-Free COM
The Limitations of Reg-Free COM
csExWBDLMan COM library
csExWBDLMan is written in VC++ 6.0 using ATL 3.0. It is compiled with minimum dependencies, i.e. no MFC, std::, CString. To recompile, you need to Copy AuxCrt.cpp file from csExWB\COM_Component_Source_Binaries\AtlAux\Shared to the VC++6 ATL\Include\ directory.
The library is used to allow the client to employ the IDownloadManager implementation of csExWBDLMan library. In addition, the library implements the PassthroughAPP package by Igor Tandetnik, which enables the client to intercept all HTTP and HTTPS request and responses. The last functionality offered by the library is the ability to set any of the available windows hooks with the option to cancel a call. This functionality is used to stop dialogs launched using the showModelessDialog() and showModalDialog() methods. The library can be used in any other project that needs to set a global windows hook or view HTTP and HTTPS headers, as long as a valid window handle is supplied.
Before opening the solution or running the demo, you need to register this library
- Copy csExWBDLMan.dll located in the csExWB\COM_Component_Source_Binaries\ReleaseMinDependency sub folder to your system directory
- Register csExWBDLMan.dll using regsvr32.exe
- Open the solution
Example: Assuming the system dir path is C:\windows\system32\
regsvr32.exe C:\windows\system32\csExWBDLMan.dll
Sign in to add a comment

Registration-free COM is awesome! I was having a ton of problems, well a few at least, getting exceptions about the COM class not being registered and this is just so much nicer, I don't have to worry about it anymore (I hope!).
argh!!
i tried the registration prescription above but regsvr32 tells me "loaded but dllRegisterServer failed 0x80020009" (vista32)
Here is the solution, posted by mehrhat (DOH!!)
The error that you refer to in wiki page (0x80020009 = Exception occurred) could be caused by lack of permissions in vista.
Are you logged in as an admin? Are you running regsvr32 as an admin?
MH Yes that did it. DOH!! (allPrograms..CommandPrompt?..RunAsAdministrator?)
THANKS!!!
MH, does the control require IE 7? Or is it version-independent? I'm having some troubles with ppl who are using earlier versions of IE, but it may be my own code.
murray.logan,
It requires version 6 and up. Tested under Win2000/XP home/pro IE6/7 - Vista32 IE7. What kink of troubles?
Very nice work! What parts of this are .NET 2.0 dependent--I have a .NET 1.1 application that I'd like to see if I can get at least portions of this working in.
scotru,
I can not offer any advise in regard to .NET 1.1. I started using C# after 2.0 release.
MH
Hi, I got many errors related to "HANDLE_PTR". I have VC++ 6.0 installed. Do I need to include any SDK to comple the code for csExWBDLMan ?
Thanks, WK Compiling... csDLMan.cpp C:\work\csExWB\COM_Component_Source_Binaries?\ProtocolImpl?.h(122) : error C2061: syntax error : identifier 'HANDLE_PTR' C:\work\csExWB\COM_Component_Source_Binaries?\ProtocolImpl?.inl(207) : error C2061: syntax error : identifier 'HANDLE_PTR' C:\work\csExWB\COM_Component_Source_Binaries?\ProtocolImpl?.inl(212) : error C2065: 'dwReserved' : undeclared identifier C:\work\csExWB\COM_Component_Source_Binaries?\csDLMan.cpp(384) : error C2065: 'CreateURLMonikerEx' : undeclared identifier C:\work\csExWB\COM_Component_Source_Binaries?\csDLMan.cpp(384) : error C2065: 'URL_MK_UNIFORM' : undeclared identifier C:\work\csExWB\COM_Component_Source_Binaries?\csDLMan.cpp(1038) : error C2065: 'BINDSTATUS_CONTENTDISPOSITIONATTACH' : undeclared identifier C:\work\csExWB\COM_Component_Source_Binaries?\csDLMan.cpp(1038) : warning C4018: '==' : signed/unsigned mismatch csExWBDLMan.cpp C:\work\csExWB\COM_Component_Source_Binaries?\ProtocolImpl?.h(122) : error C2061: syntax error : identifier 'HANDLE_PTR' C:\work\csExWB\COM_Component_Source_Binaries?\ProtocolImpl?.inl(207) : error C2061: syntax error : identifier 'HANDLE_PTR' C:\work\csExWB\COM_Component_Source_Binaries?\ProtocolImpl?.inl(212) : error C2065: 'dwReserved' : undeclared identifier
Hi,
You need the last PSDK which was compatible with VC++ 6 from here: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
MH
Hi MH,
Thanks for the suggestion. I installed Win2k3 PSDK 2003 as you suggested. Most of the errors were resolved except the "unresolved external symbol impInternetCrackUrlW@16". Can you help me out?
Thanks, -WK
Linking...
UrlParts?.obj : error LNK2001: unresolved external symbol impInternetCrackUrlW@16 ReleaseUMinDependency/csExWBDLMan.dll : fatal error LNK1120: 1 unresolved externals Error executing link.exe.Hi,
You need to add Urlmon.lib and wininet.lib to the linker included libraries.
MH
Hi MH,
I got the csExWBDLMan.dll compiled! Thanks for your help.
-WK
Im trying to compile the dll in VS2005, and I get the following errors.
Any thoughts?
The reason I want to compile this myself, is I'm planning on changing the initial arguments to the BINDINFO to turn off Cookies so that I may manage them in my own memory space. This is due to me wanting to run multiple versions of the control in their own "sandbox" within a single application.
Error 7 error C2352: 'ATL::CComDynamicUnkArray::GetUnknown?' : illegal call of non-static member function c:\sandbox\superbrowser\csexwb\testversion\atlcpimplmt.h 157 Error 8 error C2352: 'ATL::CComDynamicUnkArray::GetCookie?' : illegal call of non-static member function c:\sandbox\superbrowser\csexwb\testversion\atlcpimplmt.h 205 Error 9 error C2352: 'ATL::CComDynamicUnkArray::GetUnknown?' : illegal call of non-static member function c:\sandbox\superbrowser\csexwb\testversion\atlcpimplmt.h 157 Error 10 error C2352: 'ATL::CComDynamicUnkArray::GetCookie?' : illegal call of non-static member function c:\sandbox\superbrowser\csexwb\testversion\atlcpimplmt.h 205
Concerning the above comment, I can get it compiled by calling GetCookie? off of the m_vec object, which is declared of type CComDynamicUnkArray.
Would there be any problems that this may cause? I'm just going to assume for now that the GetCookie? function used to be static but is now an instance method.
samhaink,
I assume that you are referring to csExWBDLMan.dll, as ComUtilities?.dll was build using VC++8 (VS2005).
csExWBDLMan will not compile under VS2005 without major modifications. That's why I decided to rewrite the component in VC++8 rather than importing csExWBDLMan into VC++8.
Regards,
MH
OK, unloaded the csExWBDLMan dll and compiled the ComUtilities? library without issue and did a regsvr32 on it.
When I followed the instructions to convert the csExWB C# project, Im getting an error on the delagate for:
Error 1 No overload for 'dl_FileDownloadEx?' matches delegate 'ComUtilitiesLib?.IUtilManEvents_FileDownloadExEventHandler?' C:\sandbox\superbrowser\csExWB\csExWB\cEXWB.cs 5092 42 csExWB
If I check the signatures, they are different. Is this a miss in the convert instructions or did I miss something?
namespace ComUtilitiesLib? {
}vs.
void dl_FileDownloadEx?(int dlUID, string sURL, string sFilename, string sExt, string sExtraHeaders, string sRedirURL, ref bool SendProgressEvents?, ref bool bStopDownload, ref string sPathToSave)
There is an extra string ( sFileSize )in the delegate but not in the implementation. Just add and do nothing with the variable?
You are using version 1.0.0.3 of the csExWB C# project, please download the latest version (1.0.0.7) from http://code.google.com/p/csexwb2/downloads/list
Thank you very much for your help.
This is quite a bit of awesome code. I had implemented some of the low level features that your component contains( IAuthenticate ) and was shuddering to think of how much more I would need to do, but having discovered your implementation really made my day.
:)