Deploying/Registering device-side ActiveX controls and COM Dlls
VS2005 has project types for creating MFC based ActiveX controls and MFC/ATL based COM dlls for smart devices. One of the errors users run into with these projects is that of deployment or registration failing with error 0x8007007e. One can be sure to encounter this error if the following conditions are met.
- Project dll is dynamically linked to ATL or MFC libraries
- "Register output" project property is true.
- ATL or MFC libraries (dlls) are not deployed to device or deployed under project folder on device
What is the reason for the error 0x8007007e?
Registration of Dlls is done by device side agent (conmanclient2.exe) using LoadLibrary() WinCE API. This API looks for dependent libraries in the directory where conmanclient2.exe is present and in "\Windows" directory. Therefore, registration fails.
How to get around this error?
Copy the required dlls on which project depends and dynamically linked to "\Windows" directory on device. Instead of manually copying, these dlls could be added as additional files to project with target deployment location as "\Windows" so that these get deployed along with the project. If any of the dependent dlls are COM dlls and need registration, this could be done manually using regsvrce.exe utility. To reduce deployment delays, after deploying these dependent dlls for the first time set the "Copy to output directory" property of the file to "Do not copy".
My project is dynamically linked to ATL/MFC dlls. What dlls I should copy to device and where can I find them?
Required ATL/MFC dlls in case of English locale are msvcr80.dll, atl80.dll, msvcr80d.dll, mfc80ud.dll. These could be found under "\Program Files\Microsoft Visual Studio 8\VC\ce\Dll" directory. One has to select the dlls matching the device cpu (armv4, armv4i, mips etc) and locale.