Creating ActiveX component for Pocket PC

R

rene.goris

We are trying to develop an ActiveX Control for the Pocket PC...

HTML code for installing and calling object:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Test Cab</title>
</head>
<body>
<a href="MyObjCab.cab">Install CAB file</a>
<script language="jscript">
try
{
var objParser = new ActiveXObject("MyObj.MyClass");
alert (objParser.MyString);
}
catch (ex)
{
alert("Error message: " + ex.message + "\n\nError
number: " + ex.number);
}
</script>
</body>
</html>


The C Source code:

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace MyObj
{
[GuidAttribute("D959E687-11FF-4c49-88B6-C64FF7CF5E74")]
[ComVisible(true)]

public class MyClass
{
private string myString = "Hello World";

public string MyString
{
get { return myString; }
set { myString = value; }
}

}
}

The problem is that after installing (goes well, component visible in
configuration/add remove programs) we get an error:

Error message: Automation server can't create object
Error code: -2146827859

Please help!


Greetings,


Rene
 
N

Nicholas Paldino [.NET/C# MVP]

Rene,

Well, .NET doesn't support creating ActiveX controls, so you should be
doing this in an unmanaged language, like VB6 or VC++.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top