CSharp NetMail example not working

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

marcovdlinden
User
Posts: 45
Joined: Thu May 06, 2010 7:40 am

CSharp NetMail example not working

Post by marcovdlinden »

Im trying to compile and run the C# NetMail application but I can't get it to work.
It compiles without any problems, but when I press send I get an exeption on line 579:

Code: Select all

int hr = NetLib.NXC_Mail_Init(out mail, m_nTypeEmail, ref smtp);
When I build the project for Any CPU
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

When I build the project for x86 platform
Unable to load DLL 'netlib40': The specified module could not be found. (Exception from HRESULT: 0x8007007E)


I made sure that the netlib40.DLL was in the correct build locations, and why it could not load it beats me.
I tried with both the \bin\ and \bin.x64\ version of the netlib40.DLL

As a test I tried to add the .dll under References but it remarked upon it as not valid assembly/Com.

As a final test I just started your own CS_NetMail.exe from \bin\ and to my surprise I got an exception identical to the Any CPU exception above.

Al this was done on a x64 Windows 7 installation, and build with Visual Studio 2008.

The regular NetMail.exe did work.
Marco
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: CSharp NetMail example not working

Post by Tracker Supp-Stefan »

Hello Marco,

"Any CPU" will not work - so make sure to compile the sample for Win32 - and to copy the x86 version of netlib40.dll and dscrt40.dll in the same folder where your .exe is (there is a dependency between the two dlls - so make sure that both are included).

Best,
Stefan
marcovdlinden
User
Posts: 45
Joined: Thu May 06, 2010 7:40 am

Re: CSharp NetMail example not working

Post by marcovdlinden »

it was dscrt40.dll that I was missing.
thanks
Marco
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: CSharp NetMail example not working

Post by Tracker Supp-Stefan »

Pleasure!