VB.NET 'Object reference not set to an instance of an object' Loading PDF in Adobe PDF Reader Component

FamousMortimer
FamousMortimer used Ask the Experts™
on
Hi Experts,

I am tring to create a form with a PDF viewer in a WPF application.  I am using QuickWPFMonthCalendar that i downloaded here: http://www.codeproject.com/Articles/34052/Quick-and-Simple-WPF-Month-view-Calendar

I created a form and added an AxAcroPDF Control but i receive Object reference not set to an instance of an object error.  Here is the code on Day double click, that is supposed to load a test pdf.

    Private Sub DayBoxDoubleClicked_event(ByVal e As NewAppointmentEventArgs) Handles AptCalendar.DayBoxDoubleClicked
        MessageBox.Show("You double-clicked on day " & CDate(e.StartDate).ToShortDateString(), "Calendar Event", MessageBoxButton.OK)
        Dim frmProject As New frmProjectDetails
        frmProject.AxAcroPDF1.LoadFile("D:\Temp\test.pdf")
        frmProject.Show()
    End Sub

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ǩa̹̼͍̓̂ͪͤͭ̓u͈̳̟͕̬ͩ͂̌͌̾̀ͪf̭̤͉̅̋͛͂̓͛̈m̩̘̱̃e͙̳͊̑̂ͦ̌ͯ̚d͋̋ͧ̑ͯ͛̉Glanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015

Commented:
Which line throws the error?

Author

Commented:
Line 4.

I even tried putting this code in the form load event and it give the same error.
Most Valuable Expert 2012
Top Expert 2014

Commented:
Thanks for the help.  It turns out that it was a 64bit app and the Acrobat component is 32bit.  Oops

Author

Commented:
--

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial