NullPtrEx while calling "invisible" gdviewer
NullPtrEx while calling "invisible" gdviewer
Hi there,
I have have an example which makes gdviewer.Clear() (and other MF) go NullPtrEx.
The attached example references the gdviewer from another page without prior displaying it (but it says it's initailized). If the tab with the gdviewer is shown everything works. But just staring up an pressing the button crashes it (but not all functions would crash).
Regards
UM
I have have an example which makes gdviewer.Clear() (and other MF) go NullPtrEx.
The attached example references the gdviewer from another page without prior displaying it (but it says it's initailized). If the tab with the gdviewer is shown everything works. But just staring up an pressing the button crashes it (but not all functions would crash).
Regards
UM
- Attachments
-
- gdviewer_example.zip
- Contains some VB code and some xaml code
- (2.29 KiB) Downloaded 333 times
Re: NullPtrEx while calling "invisible" gdviewer
Hi,
Could you attach all the project's files?
Kind regards,
Loïc
Could you attach all the project's files?
Kind regards,
Loïc
Re: NullPtrEx while calling "invisible" gdviewer
Hi,
here you go. Hope it's complete.
Regards
here you go. Hope it's complete.
Regards
- Attachments
-
- playground.zip
- All files
- (11.53 KiB) Downloaded 330 times
Re: NullPtrEx while calling "invisible" gdviewer
Hi,
You are trying to reach a non loaded element. Please use such code:
Please let me know if you need further information.
With best regards,
Loïc
You are trying to reach a non loaded element. Please use such code:
Code: Select all
Dim gdViewer As GdPicture11.WPF.GdViewer = DirectCast(System.Windows.Application.Current.MainWindow, MainWindow).gd.gdViewer
If gdViewer.IsLoaded Then
gdViewer.Clear()
End If
With best regards,
Loïc
Re: NullPtrEx while calling "invisible" gdviewer
Hi,
thank you for the quick answer.
But how can I initialize the gdviewer even if it's wasn't shown before? Suppose I don't want to call 'Clear()' but 'DisplayFromGdPictureImage(pid)' to display an image? For our eval application the user selects a picture and other data and then switches to the page with gdviewer which crashes the app.
Best regards
UM
thank you for the quick answer.
But how can I initialize the gdviewer even if it's wasn't shown before? Suppose I don't want to call 'Clear()' but 'DisplayFromGdPictureImage(pid)' to display an image? For our eval application the user selects a picture and other data and then switches to the page with gdviewer which crashes the app.
Best regards
UM
Re: NullPtrEx while calling "invisible" gdviewer
Hi,
I guess you can select by code the tab hosting the GdViewer control. In all case the control must be loaded before interacting with it from code behind.
With best regards,
Loïc
I guess you can select by code the tab hosting the GdViewer control. In all case the control must be loaded before interacting with it from code behind.
With best regards,
Loïc
Who is online
Users browsing this forum: No registered users and 2 guests