If CF really has problems calling it via COM, you would be better off wrapping the ActiveX as a C# DLL and registering it under Enterprise Services as a COM+ object.  Then you call that COM+ wrapper directly from CF.  There’s still a marshalling penalty, but it’s a significantly smaller penalty than using a WS call.  Plus, you don’t have all of the nasty WS security and data type issues.

 

This requires digitally signing your assembly and setting the following attributes in your AssemblyInfo file

[assembly: AssemblyDelaySign(false)]

[assembly: AssemblyKeyFile("..\\..\\MyKey.snk")]

 

And using the following namespaces in your class:

using System.EnterpriseServices;

using System.Runtime.InteropServices;

 

Then setting the attribute to generate stubs on your C# class:

[ClassInterface(ClassInterfaceType.AutoDual)] public class MyWrapperClass

 

This will create a dll that can be registered under COM+ using the “regsvcs” command in your .NET bin directory.

Here’s a much more complete reference:

http://msdn.microsoft.com/library/default.asp?url="">

 

Hope this helps,

Roland Collins


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Schreck, Thomas (PPC)
Sent: Thursday, February 12, 2004 10:52 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Off Topic - CFMX and ActiveX

 

That makes sense.  I’m picking up this task from a colleague that’s left the company.  I’ve been tasked with writing a C# webservice that will call an ActiveX object.  The C# webservice is supposed to take the results of ActiveX and convert them into something CFMX can work with (array, struct, xml).  My predecessor could not get CFMX to work with ActiveX, so my boss wants me to introduce a C# webservice as middle man between ActiveX and CFMX.  My boss was explaining that ActiveX was returning multiple results and CFMX can not handle it.  I’m thinking this is overkill, but I am not experienced with ActiveX and am taking a C# class next week.  Anyways, any advice/help on this would be appreciated.

 

Thanks -

 

Tom Schreck

817-252-4900

[EMAIL PROTECTED]

 

I have not failed.  I've found 10,000 ways that won't work.

 

- Thomas Edison

 


From: Dawson, Michael [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 9:14 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Off Topic - CFMX and ActiveX

 

Do you mean CFMX with COM objects?  Remember that CFMX will only work with objects that do not display or require user input.  You can only use COM or ActiveX objects that are meant for non-interactive use.

 


From: Schreck, Thomas (PPC) [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 9:09 AM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Off Topic - CFMX and ActiveX

Does anyone know of a tutorial on how to get CFMX to work with ActiveX?

 

Thanks -

 

Tom Schreck

817-252-4900

[EMAIL PROTECTED]

 

I have not failed.  I've found 10,000 ways that won't work.

 

- Thomas Edison

 

Reply via email to