Solved

Can a static .Net class or method be called from COM?

Posted on 2006-06-23
1
227 Views
Last Modified: 2010-04-16
Hello,

I have a C++ Com app that accesses some C# code through a Com Callable Wrapper.  Currently all of the public methods needed by the C++ are also declared in interfaces so that they can be seen from the C++.  This is all fine.  The problem is that I would like to have a static class (or method if needed) that I want to access from the C++.  I cannot declare these static classes or methods in an interface because they do not allow the static keyword.  Will this static class still be accessible from the C++ code, or am I going to have to choose to have the C# stuff not be static?

Thanks,
Tim
0
Comment
Question by:Tim_Heldberg
1 Comment
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
Comment Utility
COM does not support static methods

http://msdn2.microsoft.com/en-us/ms182198.aspx

So you're going to have to make it non-static.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now