473,569 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.NET CLR 1.1 does not release the COM object reference.

We have a project in .NET 1.1 , some of the .NET methods take COM
interface reference pointer as a parameter, somehow we have to call
Marshal.Release ComObject to release the COM Object, otherwise the COM
object will never get release, Even we call gc.Collect()

But the same code compiles in .NET 2.0 works without the
Marshal.Release ComObject. (Unfortunately the project is supposed to
run on .NET 1.1.)

Is this a known problem? What is the remedy besides
Marshal.Release ComObject? (We know it is dangerous to call
Marshal.Release ComObject since we do not have total control of the COM
interface pointer )

Thanks in advance.
John

May 16 '07 #1
2 1236
As far as i know, this is 'the' solution.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
https://www.microsoft.com/MSPress/books/10933.aspx
OWC Black Book www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
<jo*****@gmail. comwrote in message
news:11******** **************@ q23g2000hsg.goo glegroups.com.. .
We have a project in .NET 1.1 , some of the .NET methods take COM
interface reference pointer as a parameter, somehow we have to call
Marshal.Release ComObject to release the COM Object, otherwise the COM
object will never get release, Even we call gc.Collect()

But the same code compiles in .NET 2.0 works without the
Marshal.Release ComObject. (Unfortunately the project is supposed to
run on .NET 1.1.)

Is this a known problem? What is the remedy besides
Marshal.Release ComObject? (We know it is dangerous to call
Marshal.Release ComObject since we do not have total control of the COM
interface pointer )

Thanks in advance.
John

May 17 '07 #2
>Is this a known problem? What is the remedy besides
>Marshal.Releas eComObject? (We know it is dangerous to call
Marshal.Releas eComObject since we do not have total control of the COM
interface pointer )
The rules for COM reference counting are very well defined.

http://msdn2.microsoft.com/en-us/library/ms692481.aspx
>>
Thanks in advance.
John


Jun 4 '07 #3

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

Similar topics

3
4437
by: WinstonSmith | last post by:
Hello everyone, I got a problem about GC when creating large fields (some MB), set reference to null and call GC.Collect. Not all virtual mem is released. Situation improved in .net 1.1 but not in a full satisfying way. Has anyone a solution to handle large object in safe code? (Unsafe mem management works, but has serious disadvantages...
10
4272
by: Rich | last post by:
Hello, I have not been working with ASP for too long at this time and am not real familiar with a lot of things about ASP. I have searched for articles on the following question but not come up with any definite answers. I would like to know if it is possible to use GetObject in order to read/write data between an ASP and an activeX...
4
16568
by: Mullin Yu | last post by:
as subject. i instantiate a COM object at my c# application like below IDMObjects.Library oLib = new IDMObjects.LibraryClass(); should i need to close it or set it to nothing/null to release resources. e.g. oLib = null
17
2665
by: Hazz | last post by:
In this sample code of ownerdraw drawmode, why does the '(ComboBox) sender' line of code need to be there in this event handler? Isn't cboFont passed via the managed heap, not the stack, into this cboFont_DrawItem event handler? Why does it need to be cast? -hazz ,................. cboFont.Items.AddRange(FontFamily.Families); } private...
9
8547
by: Frank Rizzo | last post by:
I understand the basic premise: when the object is out of scope or has been set to null (given that there are no funky finalizers), executing GC.Collect will clean up your resources. So I have a basic test. I read a bunch of data into a dataset by using a command and a data adapter object, .Dispose(ing) as I go. The moment the data is in...
51
3896
by: Tony Sinclair | last post by:
I'm just learning C#. I'm writing a program (using Visual C# 2005 on WinXP) to combine several files into one (HKSplit is a popular freeware program that does this, but it requires all input and output to be within one directory, and I want to be able to combine files from different directories into another directory of my choice). My...
6
9126
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++ project. I then add a class library, and add a reference to this project in the first project. When I do a release build, I see the following in the...
4
1742
by: johnxhc | last post by:
We have a project in .NET 1.1 , some of the .NET methods take COM interface reference pointer as a parameter, somehow we have to call Marshal.ReleaseComObject to release the COM Object, otherwise the COM object will never get release, Even we call gc.Collect() But the same code compiles in .NET 2.0 works without the...
10
8139
by: Hendri Adriaens | last post by:
Hi, I'm trying to automate the creation of an excel file via COM. I copied my code below. I read many articles about how to release the COM objects that I create. The code below runs just fine and excel is closed. But there are some commented lines: //xlSeries.XValues = xlWs.get_Range("B2", "B4"); // makes com objects, but which...
0
7700
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...
0
8125
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...
1
7676
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...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
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...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
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...

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.