Surezsu

Hi all,

I need to play with image magick on dialog based application of vc++(MFC) and i have installed the image magic(dynamic dll of binary version).

when i use the below code snippet,got runtime error.....

Code:
Code Snippet

#include Magick++.h
#include iostream
using namespace std;
using namespace Magick;

{
Image img;
img.read("c:\\logo.jpg");
}



Error is:

Unhandled exception at 0x000c256.. in sample.exe:0xC000075:
Access voilation writing location 0xcde....

Anybody know the solution to this,please let me know as soon as possible....

Thankx in advance...


Re: Visual C++ General How to read image from MFC using image magick?

Ramkrishna Pawar

What line debugger stops on this crash






Re: Visual C++ General How to read image from MFC using image magick?

Aleksandr Tokarev

May be better to use GdiPlus





Re: Visual C++ General How to read image from MFC using image magick?

Surezsu

image.read("c:\\test.tif");



Re: Visual C++ General How to read image from MFC using image magick?

Bite Qiu - MSFT

Surezsu wrote:
Hi all,

I need to play with image magick on dialog based application of vc++(MFC) and i have installed the image magic(dynamic dll of binary version).

when i use the below code snippet,got runtime error.....

Code:
Code Snippet

#include Magick++.h
#include iostream
using namespace std;
using namespace Magick;

{
Image img;
img.read("c:\\logo.jpg");
}



Error is:

Unhandled exception at 0x000c256.. in sample.exe:0xC000075:
Access voilation writing location 0xcde....

Anybody know the solution to this,please let me know as soon as possible....

Thankx in advance...

First of all, your question is off topic here. For such questions, a magick++ related forum or newsgroup is better choice since vc++ folks may have no experience on magick++ at all.

Secondly, when I did a quick search about magick++, I found this information that you are missing:

"

Please note that under Windows (and possibly the Mac) it is necessary to initialize the ImageMagick library prior to using the Magick++ library. This initialization is performed by passing the path to the ImageMagick DLLs (assumed to be in the same directory as your program) to the InitializeMagick() function call. This is commonly performed by providing the path to your program (argv[0]) as shown in the following example:

int main( int /*argc*/, char ** argv)
{
InitializeMagick(*argv);

This initialization step is not required under Unix, Linux, Cygwin, or any other operating environment that supports the notion of "installing" ImageMagick in a known location.

"