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: Wed, 18 Jul 2007 19:49:08 -0700,    posted on: microsoft.public.dotnet.framework.interop        back       

Thread Index
  1    Feldaspar


COM object that has been seperated from it's underlying RCW cannot be used   
Hi,

I have created a .net control and I have made it com visible and I am
consuming it from within Visual Objects code. But i get the following
error when calling the CreateDisplay() method:

COM object that has been seperated from it's underlying RCW cannot be
used.

It seems to happen when i try to change some viewable element of the
control. In this case I am trying to change the background colour.
Anyone have any ideas to try?
---

Here is my class:

    [ComVisible(true)]
    [Guid("4afe0275-1eb1-4d1c-b4b1-c0c795d76d1f")]
    [ProgId("Thing.Photo.CurrentPhotoDisplay.5")]
    [ComDefaultInterface(typeof(ICurrentPhotoDisplay))]
    [ClassInterface(ClassInterfaceType.None)]
    [ComSourceInterfaces(typeof(ICurrentPhotoDisplay))]
    public class CurrentPhotoDisplay : Control,ICurrentPhotoDisplay
    {
        private PhotoDisplay CurrentPhoto;

        public CurrentPhotoDisplay()
        {
            InitializeComponent();
        }

        private void InitializeComponent()
        {
           ...............
        }

        public void CreateDisplay(int ID)
        {
            MessageBox.Show(ID.ToString());
            BackColor = Color.Black; ///ERROR HAPPENS HERE
        }

        [ComRegisterFunction]
        public static void RegisterClass(string key)
        {
            .........
        }

        [ComUnregisterFunction]
        public static void UnregisterClass(string key)
        {
           ............
        }

    }
Date:Wed, 18 Jul 2007 19:49:08 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


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