weird crash with type declaration RRS feed

  • Question

  • Hi,I'm eperimenting a very weird problem with Word 2010.

    I have an abstract class and several inherited classes who are implementing it.

    If in a regular module I declare a var as

    Public obj as IclsMyAncestor

    is fine;

    BUT if I declare

    Public Type MyType_UDT


    obj as IclsMyAncestor

    end type

    Public MyVar as MyType_UDT

    the next time I open the word file the program crashes!

    Isn't it very strange?


    • Edited by Lauro2 Wednesday, March 14, 2012 7:05 AM
    Wednesday, March 14, 2012 7:04 AM

All replies

  • Hi Lauro,

    Thank you for posting.

    I try to reproduce your scenario on my side, but it does not happen like this. I used the following code snippet:

    Type MyType_UDT
        obj As Object
    End Type
    Public MyVar As MyType_UDT

    You can test whether it can work on your side. I'm don't know how did you declare the IclsMyAncestor class?

    How about add New before the class?  If this does not help you, can you give more details about the class you referenced?  I will try to reproduce it on my side.

    Best Regards,

    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us

    Friday, March 16, 2012 9:28 AM
  • Hi Bruce,

    I have very appreciated your interest in my question and I'm very sorry that I didn't reply to you for long time.

    I don't know exactly what happens.

    I tried to reproduce the problem from scratch and I didn't succed. [I created two simple classes, one an inherited interface from the other and declared the global variables in the two mentioned ways and no problem in either ways never arise.]

    So I don't know what to think.

    But more then one time I saw that just rebuild the project, importing again all the modules save from "unexplicable" problems.

    Cheers, Lauro

    Thursday, March 29, 2012 7:23 PM