Welcome Guest Search | Active Topics | Members

COM object that has been separated from its underlying RCW cannot be used. Options
unrecognize
Posted: Tuesday, January 01, 2008 12:05:49 AM
Rank: Member
Groups: Member

Joined: 11/6/2007
Posts: 10
Points: 15
Hi,
Below is my code.
Code:

#Region "Drag-drop Implementation"
    Friend Class DragDropData
        Public Pidl As Aurigma.GraphicsMill.WinControls.Pidl

        Public Sub New(ByVal itemPidl As Aurigma.GraphicsMill.WinControls.Pidl)
            Pidl = itemPidl
        End Sub
    End Class

    Private Sub ThumbNailList_ItemDrag(ByVal sender As Object, ByVal e As Aurigma.GraphicsMill.WinControls.ItemDragEventArgs) Handles ThumbnailListView1.ItemDrag
        If e.MouseButton = Windows.Forms.MouseButtons.Left Then
            Dim item As Aurigma.GraphicsMill.WinControls.ThumbnailListItem = DirectCast(e.Item, Aurigma.GraphicsMill.WinControls.ThumbnailListItem)
            DoDragDrop(New DragDropData(item.Pidl), DragDropEffects.Move)
        End If
    End Sub

    Private Sub BitmapViewerDragEnter(ByVal sender As Object, ByVal e As DragEventArgs) Handles BitmapViewerMainView.DragEnter
        If e.Data.GetData(GetType(DragDropData)) IsNot Nothing Then
            e.Effect = DragDropEffects.Move
        Else
            e.Effect = DragDropEffects.None
        End If
    End Sub

    Private Sub BitmapViewerDragDrop(ByVal sender As Object, ByVal e As DragEventArgs) Handles BitmapViewerMainView.DragDrop
        Dim myData As DragDropData = DirectCast(e.Data.GetData(GetType(DragDropData)), DragDropData)

        If myData IsNot Nothing Then
            Dim stream As System.IO.Stream = myData.Pidl.Stream
            Dim UserImage As New Aurigma.GraphicsMill.Bitmap(OpenedImage)
            Dim MaskImage As New Aurigma.GraphicsMill.Bitmap(stream)
            Dim resultImage As New Aurigma.GraphicsMill.Bitmap(UserImage.Width, UserImage.Height, Aurigma.GraphicsMill.PixelFormat.Format32bppArgb)

            Dim rf As New RectangleF(0, 0, UserImage.Width, UserImage.Height)
            Using combiner As New Combiner(UserImage, rf, rf, CombineMode.Copy, 1, InterpolationMode.HighQuality)
                combiner.ApplyMaskTransform(resultImage, MaskImage, BitmapViewerMainView.Bitmap)
            End Using

            stream.Close()
        End If

    End Sub
#End Region


For the 1st few time, it runs smoothly, but after that the Error: "COM object that has been separated from its underlying RCW cannot be used." appear.

System.Runtime.InteropServices.InvalidComObjectException was unhandled
Message="COM object that has been separated from its underlying RCW cannot be used."
Source="Aurigma.GraphicsMill.WinControls"
StackTrace:
at Aurigma.IStream.Commit(STGC grfCommitFlags)
at Aurigma.ComStreamWrapper.Close()
at Aurigma.ComStreamWrapper.Finalize()

Please help. Thanks in advance.
Alex Kon
Posted: Friday, January 04, 2008 1:36:58 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 386
Points: 403
Hello,

I have tried to reproduce the issue, but without any success. Could you submit case with whole test project for debug with a short description of the desired functionality?


Best wishes, Alex.
unrecognize
Posted: Monday, January 07, 2008 5:35:01 PM
Rank: Member
Groups: Member

Joined: 11/6/2007
Posts: 10
Points: 15
Hi Alex,
Thanks for the reply. The problem already solved.
Thank you.
Alex Kon
Posted: Monday, January 07, 2008 8:28:58 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 386
Points: 403
Hi,

Great news! $)



Best wishes, Alex.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.