Register for COM interop disabled in VS 2008

T

Timothy Dean

When I create a new Class Library project in Visual Studio 2008, go in to
the project settings under build at the bottom, the "Register for COM
Interop" check box is disabled. If I go into Application settings, and
check the output type, it is Class Library. If I do the same thing in VS
2005, the "Register for COM Interop" check box is enabled. What am I
missing?

Can I create a C# COM server using the compact framework that I can call
from C++ through COM? Thanks.

Timothy Dean
 
C

Chris Tacke, eMVP

EE hosting is not supported, so you cannot create a managed COM component
with the Compact Framework in any tool.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
T

Timothy Dean

What is EE hosting? When I create a smart device project using VS 2005,
create a class library, and go to build settings, the "Register for COM
interop" is enabled. Any idea why? I have no problem creating a C++ COM
server that I can call from a C# smart device project. What I need to do
now is create a C# COM dll that I can call from C++ on the device. This is
not possible? Thanks.

Timothy Dean
 
C

Chris Tacke, eMVP

EE Hosting is the ability of a native assembly to start up thge execution
ngine under which the managed component would run. This doesn't exist in
the CF and never has - it's one of the major limitations remaining.

Why you could select "register for COM interop" on device projects in VS '05
would simply be a bug. I guarantee that you never could actually have used
the generated object for COM.

Until the CF team sees fit to give us Hosting, this is just not a use case
that can be done. There's not even a hack or kludge to get it to work.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
T

Timothy Dean

Wow, that is a limitation. I have a mobile application in C++ that supports
many barcode scanners. If I run into a manufacturer that only provides a
..NET API, I am in trouble, right? Any ideas on how to do that without COM?
That means you can't write an activeX control in .NET either, right?
Thanks.

Timothy Dean
 
C

Chris Tacke, eMVP

That means you can't write an activeX control in .NET either, right?

Correct. Native code in the CF simply cannot call into managed code unless
the managed code is in a process started by a managed application. So you
can pass a managed callback to a native DLL and it can make the call, or a
native app can post a message or queue an item and the managed side can get
it, but there is simply no way to host a managed assembly in a native app.

If an OEM provides a .NET-only API (unlikey I would suspect) you're probably
not sunk. There's no way they're writing a driver, and unlikely they're
doing any hardware access in native code (for the very same reason you can't
do this), so they'll likey have a native shim that they're calling in to.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 

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