HighTechTalks DotNet Forums  

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

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss COM object that has been seperated from it's underlying RCW cannot be used in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Feldaspar
 
Posts: n/a

Default COM object that has been seperated from it's underlying RCW cannot be used - 07-18-2007 , 09:57 PM






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)
{
............
}

}


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.