Hexagon Geospatial
MENU

ERDAS APOLLO & ECW/JP2

Wondering how others have configured their ERDAS APOLLO server or what data they are crawling? The ERDAS APOLLO Discussion board is a place to find information, share ideas and more. Join the community, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Reply
New Contributor
Posts: 2
Registered: ‎05-06-2016
Accepted Solution

Access Violation in 64 Bit C# app using ECW SDK

We are using the ECW SDK to display arial photos behind destribution networks in a C# WPF desktop application.

 

It works fine in the 32 bit version but in the 64 Bit version an assertion window pops up when calling NCSSetFileView and the following call to NCSCloseFileViewEx never returns.

 

I created a stripped down console application and made a screenshot of the assertion.

https://www.dropbox.com/s/fd3749736c4a05h/error.png?dl=0

https://www.dropbox.com/s/rz356oef18dzqox/EcwReader.zip?dl=0

 

 

 

 

New Contributor
Posts: 2
Registered: ‎05-06-2016

Re: Access Violation in 64 Bit C# app using ECW SDK

I figured it out eventually.

 

The signature of the NCSOpenFileViewW call must be:

NCSError NCSOpenFileViewW(string fileName, out IntPtr pNCSFileView, [MarshalAs(UnmanagedType.FunctionPtr)] RefreshCallback callBack);

with

delegate int RefreshCallback(IntPtr ptr);

 

If you don't use the callback it can be simply:

NCSError NCSOpenFileViewW(string fileName, out IntPtr pNCSFileView, IntPtr callBack);

and you can pass IntPtr.Zero.

 

Apparently using object callback has some side effects.

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.