Design Review

Reply
Active Member
mauroanzola
Posts: 8
Registered: ‎09-09-2010
Message 1 of 5 (1,025 Views)

"NullReferenceException was unhandled" error in VB.NET

1025 Views, 4 Replies
10-19-2010 09:19 AM

This Routine in VB6 is working : 

   

Private Sub Aggiorna_Stato()
        Dim CompositeViewer As AdCommon.IAdECompositeViewer3
        Dim Section As ECompositeViewer.IAdSection
        Dim MyObjects As AdCommon.IAdCollection, MyObjectProperties As AdCommon.IAdCollection
        Dim MyObjectsNamedCollection As AdCommon.IAdUserCollection
        Dim ObjectContent As ECompositeViewer.IAdContent
        Dim MyObject As ECompositeViewer.IAdObject
        Dim MyObjectProperty As AdCommon.IAdProperty
        Dim Commands As AdCommon.IAdCollection
        Dim SectionType As ECompositeViewer.IAdSectionType
        CompositeViewer = AxCExpressViewerControl1.ECompositeViewer
        Commands = CompositeViewer.Commands
        Commands.Item("ISOLATE").Enabled = True
        Section = CompositeViewer.Section
        SectionType = Section.SectionType
        ObjectContent = Section.Content
        MyObjectsNamedCollection = ObjectContent.CreateUserCollection
        MyObjects = ObjectContent.Objects(0) '0 is to return all objects
        ObjectContent.Objects(1) = MyObjectsNamedCollection
        For Each MyObject In MyObjects
            MyObjectProperties = MyObject.Properties
            For Each MyObjectProperty In MyObjectProperties
                '
                ' DO SOMETHING
            Next
        Next
    End Sub

In Vb.net generate this error:

1276i062120419681AD1E

Employee
Posts: 338
Registered: ‎03-05-2008
Message 2 of 5 (1,011 Views)

Re: "NullReferenceException was unhandled" error in VB.NET

10-20-2010 02:11 AM in reply to: mauroanzola

Thank you for your question.

 

Please insure DWF/x file loading succeed before you invoking this code.

 

Any further questions please let me know.



Herbert He
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Active Member
mauroanzola
Posts: 8
Registered: ‎09-09-2010
Message 3 of 5 (999 Views)

Re: "NullReferenceException was unhandled" error in VB.NET

10-20-2010 06:00 AM in reply to: mauroanzola

I use Visual Studio 2008 (VB) with ADR 2010.

When i launch program i receive many errors of this type:

 

System.Windows.Data Error: 39 : BindingExpression path error: 'QuickAccessToolBar' property not found on 'object' ''ComponentSettings' (HashCode=31307802)'. BindingExpression:smileytongue:ath=QuickAccessToolBar.Theme.CurrentBrush; DataItem='ComponentSettings' (HashCode=31307802); target element is 'Border' (Name=''); target property is 'Background' (type 'Brush')

System.Windows.Data Error: 39 : BindingExpression path error: 'Id' property not found on 'object' ''RibbonPanel' (HashCode=25039667)'. BindingExpression:smileytongue:ath=Id; DataItem='RibbonPanel' (HashCode=25039667); target element is 'RibbonPanelControl' (Name=''); target property is 'AutomationId' (type 'String')

System.Windows.Data Error: 39 : BindingExpression path error: 'Id' property not found on 'object' ''RibbonPanel' (HashCode=25039667)'. BindingExpression:smileytongue:ath=Id; DataItem='RibbonPanel' (HashCode=25039667); target element is 'DockPanel' (Name='PART_OuterDockPanel'); target property is 'AutomationId' (type 'String')

Contributor
Posts: 22
Registered: ‎05-06-2010
Message 4 of 5 (899 Views)

Re: "NullReferenceException was unhandled" error in VB.NET

11-11-2010 04:01 AM in reply to: herbert.he

"Please insure DWF/x file loading succeed before you invoking this code."

 

how this can be achieved in using c#?

Employee
Posts: 338
Registered: ‎03-05-2008
Message 5 of 5 (884 Views)

Re: "NullReferenceException was unhandled" error in VB.NET

11-11-2010 06:44 PM in reply to: mauroanzola

Thank you for your question.

 

Please monitor the event ViewerEvents.OnEndLoadItem. This event gets fired after the Dwf Viewer control is loaded, and after a DWF file is loaded in the canvas.

 

Any further questions please let me know.

 

Thanks,

-Herbert



Herbert He
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community