DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 20 Aug 2007 19:57:04 GMT,    posted on: microsoft.public.dotnet.framework.interop        back       

Thread Index
  1    Jim
          2    Jim Zhang
          3    Jim Zhang
          4    James Zhang


How to unload an assembly from OCX?   
I have an OCX which interop a C# assembly. C# assembly needs to callback OCX in a method by parameter pointing to this OCX.
It works in the first time load. If I reload OCX, OnInitDialog() won't be called and app is hanged on.
If I don't pass this OCX as parameter to the assembly, second time reload is ok.

Any thoughts?

From http://www.developmentnow.com/g/21_2007_8_0_0_0/dotnet-framework-interop.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Date:Mon, 20 Aug 2007 19:57:04 GMT   Author:  

Re: How to unload an assembly from OCX?   
The problem is that how to clean the COM object in assembly since this
is like two ways Interop.

If I use "ref object" parameter in assembly, I don't need to clean it in
assembly. After OCX is unloaded, it should go away with OCX. 
But the host process is still there(OCX and assembly are leaving there
too?), when reloading OCX, OCX pointer should send to assembly again.
But don't know why OCX's constructor get called, then OCX get unloaded
(other OCX memory get corrupted)?


*** Sent via Developersdex http://www.developersdex.com ***
Date:Wed, 22 Aug 2007 13:26:09 -0700   Author:  

Re: How to unload an assembly from OCX?   
The problem is that how to clean the COM object in assembly since this
is like two ways Interop.

If I use "ref object" parameter in assembly, I don't need to clean it in
assembly. After OCX is unloaded, it should go away with OCX. 
But the host process is still there(OCX and assembly are leaving there
too?), when reloading OCX, OCX pointer should send to assembly again.
But don't know why OCX's constructor get called, then OCX get unloaded
(other OCX memory get corrupted)?



*** Sent via Developersdex http://www.developersdex.com ***
Date:Wed, 22 Aug 2007 13:28:14 -0700   Author:  

how to clean the COM object in assembly?   
The problem is that how to clean the COM object in assembly since this is like two ways Interop.

If I use "ref object" parameter in assembly, I don't need to clean it in assembly. After OCX is unloaded, it should go away with OCX. 
But the host process is still there(OCX and assembly are leaving there too?), when reloading OCX, OCX pointer should send to assembly again. But don't know why OCX's constructor get called, then OCX get unloaded (other OCX memory get corrupted)?


EggHeadCafe - .NET Developer Portal of Choice 
http://www.eggheadcafe.com
Date:Wed, 22 Aug 2007 13:29:52 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us