Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - ArgumentNullException
  FAQ FAQ  Forum Search   Register Register  Login Login

ArgumentNullException

 Post Reply Post Reply
Author
Message
pearlshaun View Drop Down
Beginner
Beginner


Joined: 28 Jul 14
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote pearlshaun Quote  Post ReplyReply Direct Link To This Post Topic: ArgumentNullException
    Posted: 28 Jul 14 at 12:57PM
I am using the QuickPdf .net DLL and I'm getting exceptions from the DLL class constructor of the provided import header file. Snippet of stack trace below,

System.ArgumentNullException: Value cannot be null.  Parameter name: ptr     at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)     at External.QuickPDF.DLL..ctor(String dllFileName) in C:\.....\QuickPDF.cs:line 34     at External.QuickPDF.PDFLibrary..ctor(String dllFileName) in C:\.....\QuickPDF.cs:line 2187

I'm using the 32 bit dll (QuickPDFDLL0726.dll) and Ive compiled my project for Any CPU so I dont think its an architecture mismatch.

My application is a .net website running in IIS. I have granted the App Pool user full control to the dll, but Im still getting the problem.

Any ideas?

Cheers
Shaun
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jul 14 at 1:38PM
Hi Shaun,
 
compiling with Option "any" means regarding the actual Environment - so 64 bit.
64 bit won't work with 32-bit-dll.
You compiling option should be "x86" or similar.
But this won't be all ... there will be further Problems i fear. Sorry.
 
Cheers and welcome here,
Ingo
 
Cheers,
Ingo

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jul 14 at 2:54PM
Yes. The project needs to be set to x86 and not to AnyCPU.

You can use the following code with AnyCPU.

            if (IntPtr.Size == 4)
                dllName = "DebenuPDFLibraryDLL1016.DLL";    // 32 bits
            else
                dllName = "DebenuPDFLibrary64DLL1016.DLL";  // 64 bits

By the way the DLL is not a native .NET DLL.  It is a standard Windows DLL.

Andrew.


Edited by AndrewC - 28 Jul 14 at 3:03PM
Back to Top
pearlshaun View Drop Down
Beginner
Beginner


Joined: 28 Jul 14
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote pearlshaun Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jul 14 at 3:35PM
Thanks for the fast responses chaps.

It turned out that you can build for Any CPU in this case, as IIS allows you to specify an app pool to run in WOW64, which I have only just discovered. This has resolved the issue.

Thanks for the tips though it steered me in the right direction *tips hat*
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store