Hi
This might not make any difference, but try removing the brackets, i.e.
trashCategory.RelocateClass delclass
instead of
trashCategory.RelocateClass (delclass)
Brian
> -----Original Message-----
> From: "G�ntsch, Alexander" [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 4:09 PM
> To: 'Rose Forum'
> Subject: (ROSE) RelocateClass (was: Deleting a RoseItem)
>
> Hello,
>
> I'd like to forbid to create new classes in certain cases. I've tried to
> do this by deleting the class after a newModelElement event but rose
> crashes. That is somewhat comprehensible because I have to delete the
> RoseItem of which afterwards a pointer might still be used. Now I try a
> "softer" solution, i. e. I try to relocate the class in a sort of
> trashcan.
> The trashcategory is properly initialized (global), as well as the
> delclass. But still the RelocateClass doesn't work. The class is
> afterwards just in the same category where it was created.
>
> Anyone knowing a solution?
>
>
> Public Sub OnNewModelElement(objRoseApp As RoseApplication, objItem As
> RoseItem)
> Dim retval As Boolean
> Dim modellname As String
>
> interneAenderung = True
>
> 'MsgBox "NewModelElement"
> 'MsgBox "Neuer Item " + objItem.Name
>
> If aktuelleAnsicht <> ANSICHT.MODELL Then
> Dim delclass As RoseClass
> Dim res As VbMsgBoxResult
> Dim res2 As Boolean
>
> res = MsgBox("Bitte wechseln Sie zum Anlegen neuer Klassen in die
> Modellansicht.", vbOKOnly, "Fehler")
>
> Set delclass =
> objRoseApp.CurrentModel.GetAllClasses.GetWithUniqueID(objItem.GetUniqueID)
>
> trashCategory.RelocateClass (delclass)
>
> Else
> ...
> End If
>
> interneAenderung = False
>
> End Sub
>
>
> Alexander
>
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
* http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
* To: [EMAIL PROTECTED]
* Subject: <BLANK>
* Body: unsubscribe rose_forum
*************************************************************************