Installing activex control on to mobile device

Hi,

I'm trying to install and register a ActiveX control written in C# for CF 2.0. I created a smart device cab project and added the primary output of the ActiveX control project to the setup. I then copy the files (.cab, .inf) to the device and ran them but I still recieve Automation errors when trying to create this object in PIE using JScript.

Any help would be appreciated. Thanks.




Answer this question

Installing activex control on to mobile device

  • xplosiv_1

    Perhaps it would be better to consume it on a server I mean, it may be fine to run some script which handles menus in browser based application, but consuming WS might be a bit too much.



  • samssb

    I’m pretty sure you can't write AX controls in C# on NETCF since there's no hosting support.



  • rwbogosian

    It does not, actually. It only covers one scenario - managed application passes managed class as COM interface to native DLL so native code could use it.

    You probably missed some limitations like these (3 relevant in your case):

    · Using an assembly registration tool, such as Regasm.exe, for COM clients to use a managed component as a COM class.

    · Activating managed types from COM.

    · Hosting the runtime from native code.



  • Kalvis

    This article on MSDN states otherwise, but it does not explain deploying the ActiveX object.

    http://msdn2.microsoft.com/en-us/library/kfzsfkz3.aspx



  • exBK

    This is what the .cab project inf looks like:

    [Version]
    Signature="$Windows NT$"
    Provider="Default Company Name"
    CESignature="$Windows CE$"

    [CEStrings]
    AppName="FmcPdaAxInstall"
    InstallDir=%CE1%\%AppName%

    [Strings]
    Manufacturer="Default Company Name"

    [CEDevice]
    VersionMin=4.0
    VersionMax=5.99
    BuildMax=0xE0000000

    [DefaultInstall]
    CEShortcuts=Shortcuts
    AddReg=RegKeys
    CopyFiles=Files.Common1,Files.Common2

    [SourceDisksNames]
    1=,"Common1",,"C:\Projects\Greenville\PDA Apps\FmcPdaAx\FmcPdaAx\bin\Debug\"
    2=,"Common2",,"C:\Projects\Greenville\PDA Apps\FmcPdaAx\FmcPdaAx\obj\Debug\"

    [SourceDisksFiles]
    "FmcPdaAx.tlb"=1
    "FmcPdaAx.dll"=2

    [DestinationDirs]
    Shortcuts=0,%CE2%\Start Menu
    Files.Common1=0,"%InstallDir%"
    Files.Common2=0,"%InstallDir%"

    [Files.Common1]
    "FmcPdaAx.tlb","FmcPdaAx.tlb",,0

    [Files.Common2]
    "FmcPdaAx.dll","FmcPdaAx.dll",,0


    [Shortcuts]

    [RegKeys]



  • Christian Hecht

    That's not what article says:

    From TFA:

    The following interoperability with native code is not supported by the .NET Compact Framework:

    • Using an assembly registration tool, such as Regasm.exe, for COM clients to use a managed component as a COM class.

    • Activating managed types from COM.

    • Hosting the runtime from native code.

    • Hosting ActiveX controls. The .NET Compact Framework does not support the AxHost class and you cannot use Microsoft Visual Studio 2005 and the designer to parent an ActiveX control to your managed form. However, given the COM interop support in .Net Compact Framework, the infrastructure exists to build your own ActiveX container host.

    • Initializing COM to use single-threaded apartments.

    • Auto generating class interfaces. You must wrap the functionality you’d like to expose to native code in an explicit interface.

    • Auto generating GUIDs. You must give each interface an explicit guid in order to expose it to native code.

    Notice items #2 and #3



  • MetroMunkee

    Thanks guys. It looks like I'm going to try to consume any web services from PIE using the MSXML activex object instead of an intermediate managed (CFNET) active x control.

  • Installing activex control on to mobile device