Print Page | Close Window

ArgumentNullException

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2946
Printed Date: 01 May 24 at 11:39PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: ArgumentNullException
Posted By: pearlshaun
Subject: ArgumentNullException
Date 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



Replies:
Posted By: Ingo
Date 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



Posted By: AndrewC
Date 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.


Posted By: pearlshaun
Date 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*



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk