473,686 Members | 2,233 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

COM Interop Static Classes

Is it possible to expose a static class to COM?

Thanks

Alan
Dec 21 '05 #1
2 3729
Sure, if it's a public class I don't see why not.
"Alan Roberts" wrote:
Is it possible to expose a static class to COM?

Thanks

Alan

Dec 21 '05 #2
Alan,
Is it possible to expose a static class to COM?


No, a static class can't be instantiated and it only has static
methods that can't be called through COM interop.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Dec 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4360
by: Joanna Carter \(TeamB\) | last post by:
Following on from the other discussion, I have to just check something out with reference to disposal of resources held in static fields. I have a Persistence Framework that is 'globally accessible'. In Delphi, I would use a class of static methods to enforce the singleton, and I added static fields to hold things like the database connections, etc. This worked fine in Delphi because we have unit initialisation/finalisation sections...
9
20569
by: Chuck Cobb | last post by:
I am creating some static classes with static methods and static variables, but I have a question: What is the lifetime of static classes and static variables? Is there any risk that these items might be garbage collected if they're not used for a period of time? For example: public static class test { static Collection<string> coll;
4
2365
by: thomson | last post by:
Hi All, Can any one tell me the demerits of using static classes in Web Application,what is the scope of this kind of class Thanks in Advance Thomson
4
1489
by: JC | last post by:
Suppose an ASP.Net project contains a public static class with public methods and members that are used throughout the application. Of course being static, there is only copy of the class within the application. Now suppose two users access the Web site simultaneously. Does each user see his/her own single copy of the static class, or do they share the class, thus creating a problem that can only be solved if one use blocks the other...
1
1385
by: BLUE | last post by:
I know it's a stupid question but... I want to use a class that represents the current user of my application, another one that reads position from a GPS receiver and another one that reads RFID tags from a reader. I don't want to create a new user each time a log in appens (only one login at a time: mobile device) and I do not want to create a new object each time I read position or a tag, so it's right to use static classes and to update...
1
1261
TRScheel
by: TRScheel | last post by:
Platform: Windows Vista Language: ASPX / C# I am trying to make a business library for where I work, and I have everything figured out and done except for the ObjectDataSource portion. If any of you have used the ObjectDataSource, it binds to a static (you could bind it to a class that isnt static, but then the values and items within that class are lost after a different page load) class that has a select, update, delete, and insert...
6
1579
by: Smithers | last post by:
In consideration of a "Utilities" class that contains methods intended to be used amongst multiple projects... Is there any general consensus on whether such a class should be static? I have traditionally and somewhat thoughtlessly created these sorts of classes as static... but now that I'm refactoring a number of apps written over the past few years I'd like to make a good decision on this particular issue. And yes - I know there is...
4
3303
by: Rene | last post by:
Hi, I was wondering if anyone could tell me why extension methods must be declared on static classes. I mean, why not allowing them to be declared as static methods in regular instance classes? In case you are wondering, I am only curious to find out the reason for this limitation. I don't really have a need to declare extension method on non static classes. I am just curious.
9
267
by: puzzlecracker | last post by:
It looks like static classes can have non-static member classes -- does it make sense what I just wrote? If not, let me illustrate it: public static class Foo{ private struct Bar{ } }
0
8586
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8936
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8772
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7603
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6442
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.