The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

sabeeshcs (6) [Avatar] Offline
#1
Hi,
I had download the Soruce code from http://www.manning.com/sivakumar and unzip that file and try to run the program
"SourceCodeChapter 7FirstAvalonDerivedFirstAvalonDerived". and successfully build that program and it create a .dll file. But at run time it display an error like this

"An unhandled exception of type 'System.NullReferenceException' occurred in PresentationCore.dll

Additional information: Object reference not set to an instance of an object. "


How can I solve that? If we need to register that .dll file?
Please help me
Sabeesh
digiplant (4) [Avatar] Offline
#2
Re: Your source code is not working
Hello. I also am trying to compile the codes from Chapter 7 (specifically). None of them compile successfully but instead I get an error message.

For example,

in "FirstAvalon" I get the error:
"fatal error C1192: #using failed on 'c:documents and settingsmyUserNamelmy documentsexamplessourcecodesourcecodechapter 7firstavalonfirstavalonwindowsbase.dll'"

in "FirstAvalonDerived" I get the error:
"fatal error C1192: #using failed on 'c:documents and settingsandrew.hillmy documentsexamplessourcecodesourcecodechapter 7firstavalonderivedfirstavalonderivedpresentationcore.dll' "

This are pretty clearly related. What do I need to do to make these work?
digiplant (4) [Avatar] Offline
#3
Re: Your source code is not working
Ok, I figured out the problem on my machine is that references are all the old names or something. For anyone else experiencing the same problem:

Right click on the project name
choose the references option
remove windowsbase, presentationcore, and presentationframework
add WindowsBase, PresentationCore, and PresentationFramework

Everything should work. I also had to target .NET 3.5
digiplant (4) [Avatar] Offline
#4
Re: Your source code is not working
So updating references worked for the first 2 methods/samples of using wpf from c++/cli. I am having the exact same problem that the original poster had when attempting to run the derived class example. I saw over on an amazon review for this book that method number 3 (deriving the c# classes) no longer is supported. Is this true? Is there another, better way to do it? This seems like the best possible way if it can be done. Help?