Search code examples
c++visual-studio-2008activexwindows-ce

Unable to reload ActiveX control in Windows CE 6


I am developing an ActiveX control targeted at Windows CE 6 (on a Motorola Workabout Pro 4, if specifying helps). I have stage one working, in the sense that I can compile in Visual Studio, and have deploy using a simple CAB file.

However, I am finding it very hit and miss as to whether I can update the control on the device. If I perform a clean rebuild (ensuring that all intermediary files are removed beforehand) and redeploy the CAB file, I find that any changes aren't reflected in the deployed code: The output is unchanged, both in IE on the device, and when connecting and debugging via the Visual Studio 2008. Secondly, any breakpoints that I have added in the debugger no longer hit.

If I manually replace the dll file, this still has no effect. Even stranger, the control still continues to work if I completely remove the dll!

I'm a bit of a beginner when it comes to WinCE and ActiveX development, so any hints as to what I am missing here would be greatly appreciated!


Solution

  • In this instance, my problem was that I was failing to correctly register my dll with COM.

    The simplest solution was for me to change the CAB file so that the the dll self-registered. In my case, this was done by changing a parameter in the CAB file properties for the dll in Visual Studio. This results in <parm name="SelfRegister" /> being added to the CAB _setup.xml file:

    ...
    <characteristic type="%CE2%" translation="install">
      <characteristic type="MakeDir" /> 
      <characteristic type="output.dll" translation="install">
        <characteristic type="Extract">
          <parm name="Source" value="OUPUT~1.002" /> 
          <parm name="SelfRegister" />
        </characteristic>
      </characteristic>
    </characteristic>
    ...