Solved

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

Posted on 2006-06-23
1
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
ID: 16972252
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

752 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