It has been awhile since I did this in ASP.NET 1.1/Windows Mobile 2003 for
PIE, and it wasn't the most elegant, but it went something like this...
There was no straightforward support for ActiveX controls in PIE.
ActiveX controls must be pre-installed on the PDA, cannot be "pulled" from
the IIS server at runtime
What I was trying to do: Start a program on the PDA from PIE, which was the
main user interface. The program controlled sensor associated with the PDA's
CF slot. I could not start the program directly from PIE, but I could invoke
an ActiveX control that could then launch/configure the sensor. The sensor
returned results back to IIS via a web service (and not back through PIE).
You can reference an ActiveX control that is already present on the PDA in a
Panel/DeviceSpecific/Choice construct, as follows
<mobile:Panel id="pnlLaunchRFIDReader" runat="server">
<mobile:DeviceSpecific id="dspFrmLaunchReader" runat="server">
<Choice Filter="supportsJavaScript"
Xmlns="http://schemas.microsoft.com/mobile/html32template">
<ContentTemplate>
<SCRIPT language="javascript">
var launcher = new ActiveXObject("MyControl.MyObject");
// if the ActiveX control is already in PDA memory, it is used. No
danger of "newing" up numerous instances of the control.
// the form "command" elements are set in the .aspx page's
code-behind file, and initialize the ActiveX control's properties
launcher.action = window.frmLaunchReader.cmdAction.value;
launcher.actor = window.frmLaunchReader.cmdCareprovider.value;
launcher.scansteps = window.frmLaunchReader.cmdScanTaskStart.value;
launcher.subid = window.frmLaunchReader.cmdSubid.value;
launcher.serverip = window.frmLaunchReader.cmdServerip.value;
// clear the forms "command" elements to reduce UI clutter
window.frmLaunchReader.cmdAction.value = "";
window.frmLaunchReader.cmdCareprovider.value = "";
window.frmLaunchReader.cmdScanTaskStart.value = "";
window.frmLaunchReader.cmdSubid.value = "";
window.frmLaunchReader.cmdServerip.value = "";
// call a method in the ActiveX control
var result = launcher.LaunchManagedApp();
</SCRIPT>
</ContentTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:Panel>
I hope this helps.
> I am working on a a web page using VS 2003 and the ASP.NET Mobile Controls
> and which will be viewed only on Pocket Internet Explorer 2003 (on an O2 XDA
> IIi).
steveg - 11 Jan 2006 14:28 GMT
> It has been awhile since I did this in ASP.NET 1.1/Windows Mobile 2003 for
> PIE, and it wasn't the most elegant, but it went something like this...
>
> There was no straightforward support for ActiveX controls in PIE.
[snip]
Thanks for the info. It raises some thoughts with me. At the moment my
ActiveX does not set it's own height/width so there may be issues 'new'ing it
but if my call into MS Support doesn't get anywhere, I'll change the ActiveX
and see how it displays using 'new'