MFC app does not load images

I have made an image viewer/research tool that works fine when I and 
other saround me use it on win XP. but I had a correspondence with a 
guy, who can't get it to load anything. He uses W2K SP4 on a 2.8 GHz P4 
machine with 512MB of RAM in dual CPU emulation mode.

When he opens a file, the open file dialog appears (so onfileopen() is 
called), but nothing is loaded when he picks a file. It is as if the 
CDocument::onopendocument(filename) returns false on his computer, but 
on all the computers I've tsted it on, it works.

http://www.cvmt.dk/~mnielsen/tools/setupimgview0111.exe




-- 
-------------------------------------------------------------------------
Music, Recipes, Photos, and more:

http://www.sequoiagrove.dk

"You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons 
of a silly person. I blow my nose at you, so-called Arthur-king, you and 
all your silly English kaniggets. Thppppt!"
--------------------------------------------------------------------------
0
mnielsen1 (59)
11/1/2006 12:59:04 PM
vc.mfc 33608 articles. 0 followers. Follow

17 Replies
903 Views

Similar Articles

[PageSpeed] 25

"Michael Archon Sequoia Nielsen" <mnielsen@DELDELDELcvmt.dk> wrote in 
message news:45489868$0$49200$14726298@news.sunsite.dk...
>I have made an image viewer/research tool that works fine when I and other 
>saround me use it on win XP. but I had a correspondence with a guy, who 
>can't get it to load anything. He uses W2K SP4 on a 2.8 GHz P4 machine with 
>512MB of RAM in dual CPU emulation mode.
>

Just a guess... does your app use GDI+?  GDIPLUS.DLL (I think is what it's 
called) is included on WinXP or later but not Win2K.  You need to 
redistribute it as per the Microsoft guidelines (search MSDN for 
redistributing GDI+).

-- David


0
dc2983 (3206)
11/1/2006 1:27:40 PM
David Ching wrote:
> 
> Just a guess... does your app use GDI+?  GDIPLUS.DLL (I think is what it's 
> called) is included on WinXP or later but not Win2K.  You need to 
> redistribute it as per the Microsoft guidelines (search MSDN for 
> redistributing GDI+).

Hmm, the dependency list actually includes GDI. but I have not included 
gdiplus.h and do not use any of its functions. Maybe it is IPicture.

-- 
-------------------------------------------------------------------------
Music, Recipes, Photos, and more:

http://www.sequoiagrove.dk

"You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons 
of a silly person. I blow my nose at you, so-called Arthur-king, you and 
all your silly English kaniggets. Thppppt!"
--------------------------------------------------------------------------
0
mnielsen1 (59)
11/1/2006 3:31:32 PM
I am using W2K with SP4 at work, I tried your app and it didn't work.
When I launched the app, I background of the view was black. I tried opening
an image and nothing.

AliR.

"Michael Archon Sequoia Nielsen" <mnielsen@DELDELDELcvmt.dk> wrote in
message news:45489868$0$49200$14726298@news.sunsite.dk...
> I have made an image viewer/research tool that works fine when I and
> other saround me use it on win XP. but I had a correspondence with a
> guy, who can't get it to load anything. He uses W2K SP4 on a 2.8 GHz P4
> machine with 512MB of RAM in dual CPU emulation mode.
>
> When he opens a file, the open file dialog appears (so onfileopen() is
> called), but nothing is loaded when he picks a file. It is as if the
> CDocument::onopendocument(filename) returns false on his computer, but
> on all the computers I've tsted it on, it works.
>
> http://www.cvmt.dk/~mnielsen/tools/setupimgview0111.exe
>
>
>
>
> -- 
> -------------------------------------------------------------------------
> Music, Recipes, Photos, and more:
>
> http://www.sequoiagrove.dk
>
> "You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons
> of a silly person. I blow my nose at you, so-called Arthur-king, you and
> all your silly English kaniggets. Thppppt!"
> --------------------------------------------------------------------------


0
AliR3470 (3236)
11/1/2006 4:02:49 PM
"Michael Archon Sequoia Nielsen" <mnielsen@DELDELDELcvmt.dk> wrote in 
message news:4548bc24$0$49195$14726298@news.sunsite.dk...

> Hmm, the dependency list actually includes GDI. but I have not included 
> gdiplus.h and do not use any of its functions. Maybe it is IPicture.
>

Hmm, IPicture doesn't require any additional DLL's.  It's been supported 
since at least NT4.  It must be something else.

I recommend you install either Virtual PC or VMWare Workstation and create a 
virtual machine with Win2K on it, then debug your program in it.

-- David


0
dc2983 (3206)
11/1/2006 5:43:27 PM
Hi Ajay,

Did you run it on W2K?

AliR.

"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
news:1162408064.042868.260040@f16g2000cwb.googlegroups.com...
I was able to run it with essentially a black colored view. However I
was able to see images when I opened these using open command of your
app. I think things are OK except for the default view.

---
Ajay


Michael Archon Sequoia Nielsen wrote:
> I have made an image viewer/research tool that works fine when I and
> other saround me use it on win XP. but I had a correspondence with a
> guy, who can't get it to load anything. He uses W2K SP4 on a 2.8 GHz P4
> machine with 512MB of RAM in dual CPU emulation mode.
>
> When he opens a file, the open file dialog appears (so onfileopen() is
> called), but nothing is loaded when he picks a file. It is as if the
> CDocument::onopendocument(filename) returns false on his computer, but
> on all the computers I've tsted it on, it works.
>
> http://www.cvmt.dk/~mnielsen/tools/setupimgview0111.exe
>
>
>
>
> --
> -------------------------------------------------------------------------
> Music, Recipes, Photos, and more:
>
> http://www.sequoiagrove.dk
>
> "You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons
> of a silly person. I blow my nose at you, so-called Arthur-king, you and
> all your silly English kaniggets. Thppppt!"
> --------------------------------------------------------------------------


0
AliR3470 (3236)
11/1/2006 7:06:44 PM
I was able to run it with essentially a black colored view. However I
was able to see images when I opened these using open command of your
app. I think things are OK except for the default view.

---
Ajay


Michael Archon Sequoia Nielsen wrote:
> I have made an image viewer/research tool that works fine when I and
> other saround me use it on win XP. but I had a correspondence with a
> guy, who can't get it to load anything. He uses W2K SP4 on a 2.8 GHz P4
> machine with 512MB of RAM in dual CPU emulation mode.
>
> When he opens a file, the open file dialog appears (so onfileopen() is
> called), but nothing is loaded when he picks a file. It is as if the
> CDocument::onopendocument(filename) returns false on his computer, but
> on all the computers I've tsted it on, it works.
>
> http://www.cvmt.dk/~mnielsen/tools/setupimgview0111.exe
>
>
>
>
> --
> -------------------------------------------------------------------------
> Music, Recipes, Photos, and more:
>
> http://www.sequoiagrove.dk
>
> "You don=B4t frighten us, English pig-dogs! Go and boil your bottoms, sons
> of a silly person. I blow my nose at you, so-called Arthur-king, you and
> all your silly English kaniggets. Thppppt!"
> --------------------------------------------------------------------------

0
ajaykalra (6842)
11/1/2006 7:07:44 PM
> Did you run it on W2K?
 
My fault. I did use XP SP2.

---
Ajay

0
ajaykalra (6842)
11/1/2006 7:13:02 PM
Ajay Kalra wrote:
> I was able to run it with essentially a black colored view. However I
> was able to see images when I opened these using open command of your
> app. I think things are OK except for the default view.

The default view actually is black (you can choose white in the menu, 
but I prefer the black background for viewing images).

-- 
-------------------------------------------------------------------------
Music, Recipes, Photos, and more:

http://www.sequoiagrove.dk

"You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons 
of a silly person. I blow my nose at you, so-called Arthur-king, you and 
all your silly English kaniggets. Thppppt!"
--------------------------------------------------------------------------
0
mnielsen1 (59)
11/2/2006 7:35:11 PM
AliR (VC++ MVP) wrote:
> I am using W2K with SP4 at work, I tried your app and it didn't work.
> When I launched the app, I background of the view was black. I tried opening
> an image and nothing.

In the app folder, tehre is a imgview.log
Could you post its contents here so I can see where in the load process 
it failed?


-- 
-------------------------------------------------------------------------
Music, Recipes, Photos, and more:

http://www.sequoiagrove.dk

"You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons 
of a silly person. I blow my nose at you, so-called Arthur-king, you and 
all your silly English kaniggets. Thppppt!"
--------------------------------------------------------------------------
0
mnielsen1 (59)
11/2/2006 7:36:08 PM
This is all that was in the file

Wed Nov 01 10:00:08| OnFileOpen()
Wed Nov 01 10:00:23| OnFileOpen() CANCELLED
Wed Nov 01 10:00:41| OnFileOpen()
Wed Nov 01 10:00:46| OnFileOpen() CANCELLED
Wed Nov 01 10:01:03| OnFileOpen()
Wed Nov 01 10:01:13| OnFileOpen() CANCELLED
Wed Nov 01 10:01:15| OnFileOpen()
Wed Nov 01 10:01:21| OnFileOpen() CANCELLED
Wed Nov 01 10:01:24| OnFileOpen()
Wed Nov 01 10:01:28| OnFileOpen() CANCELLED

AliR.

"Michael Archon Sequoia Nielsen" <mnielsen@DELDELDELcvmt.dk> wrote in
message news:454a46f8$0$49205$14726298@news.sunsite.dk...
> AliR (VC++ MVP) wrote:
> > I am using W2K with SP4 at work, I tried your app and it didn't work.
> > When I launched the app, I background of the view was black. I tried
opening
> > an image and nothing.
>
> In the app folder, tehre is a imgview.log
> Could you post its contents here so I can see where in the load process
> it failed?
>
>
> -- 
> -------------------------------------------------------------------------
> Music, Recipes, Photos, and more:
>
> http://www.sequoiagrove.dk
>
> "You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons
> of a silly person. I blow my nose at you, so-called Arthur-king, you and
> all your silly English kaniggets. Thppppt!"
> --------------------------------------------------------------------------


0
AliR3470 (3236)
11/2/2006 8:13:16 PM
AliR (VC++ MVP) wrote:
> This is all that was in the file
> 
> Wed Nov 01 10:00:08| OnFileOpen()
> Wed Nov 01 10:00:23| OnFileOpen() CANCELLED
> Wed Nov 01 10:00:41| OnFileOpen()
> Wed Nov 01 10:00:46| OnFileOpen() CANCELLED
> Wed Nov 01 10:01:03| OnFileOpen()
> Wed Nov 01 10:01:13| OnFileOpen() CANCELLED
> Wed Nov 01 10:01:15| OnFileOpen()
> Wed Nov 01 10:01:21| OnFileOpen() CANCELLED
> Wed Nov 01 10:01:24| OnFileOpen()
> Wed Nov 01 10:01:28| OnFileOpen() CANCELLED

Aha, that is CFileDialog that return IDCANCELLED
Let me guess, if you drag'n'drop files into the black area, it works fine?


-- 
-------------------------------------------------------------------------
Music, Recipes, Photos, and more:

http://www.sequoiagrove.dk

"You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons 
of a silly person. I blow my nose at you, so-called Arthur-king, you and 
all your silly English kaniggets. Thppppt!"
--------------------------------------------------------------------------
0
mnielsen1 (59)
11/2/2006 8:26:26 PM
Yes, it sure does.

AliR.

"Michael Archon Sequoia Nielsen" <mnielsen@DELDELDELcvmt.dk> wrote in
message news:454a52c2$0$49200$14726298@news.sunsite.dk...
> AliR (VC++ MVP) wrote:
> > This is all that was in the file
> >
> > Wed Nov 01 10:00:08| OnFileOpen()
> > Wed Nov 01 10:00:23| OnFileOpen() CANCELLED
> > Wed Nov 01 10:00:41| OnFileOpen()
> > Wed Nov 01 10:00:46| OnFileOpen() CANCELLED
> > Wed Nov 01 10:01:03| OnFileOpen()
> > Wed Nov 01 10:01:13| OnFileOpen() CANCELLED
> > Wed Nov 01 10:01:15| OnFileOpen()
> > Wed Nov 01 10:01:21| OnFileOpen() CANCELLED
> > Wed Nov 01 10:01:24| OnFileOpen()
> > Wed Nov 01 10:01:28| OnFileOpen() CANCELLED
>
> Aha, that is CFileDialog that return IDCANCELLED
> Let me guess, if you drag'n'drop files into the black area, it works fine?
>
>
> -- 
> -------------------------------------------------------------------------
> Music, Recipes, Photos, and more:
>
> http://www.sequoiagrove.dk
>
> "You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons
> of a silly person. I blow my nose at you, so-called Arthur-king, you and
> all your silly English kaniggets. Thppppt!"
> --------------------------------------------------------------------------


0
AliR3470 (3236)
11/2/2006 8:43:49 PM
AliR (VC++ MVP) wrote:
> Yes, it sure does.

So it is CFileDialog that does not work on w2k - does it use gdiplus?

-- 
-------------------------------------------------------------------------
Music, Recipes, Photos, and more:

http://www.sequoiagrove.dk

"You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons 
of a silly person. I blow my nose at you, so-called Arthur-king, you and 
all your silly English kaniggets. Thppppt!"
--------------------------------------------------------------------------
0
mnielsen1 (59)
11/2/2006 9:16:54 PM
nope, CFileDialog normally works fine under windows 2000. I use it all the
time.

AliR.

"Michael Archon Sequoia Nielsen" <mnielsen@DELDELDELcvmt.dk> wrote in
message news:454a5e96$0$49201$14726298@news.sunsite.dk...
> AliR (VC++ MVP) wrote:
> > Yes, it sure does.
>
> So it is CFileDialog that does not work on w2k - does it use gdiplus?
>
> -- 
> -------------------------------------------------------------------------
> Music, Recipes, Photos, and more:
>
> http://www.sequoiagrove.dk
>
> "You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons
> of a silly person. I blow my nose at you, so-called Arthur-king, you and
> all your silly English kaniggets. Thppppt!"
> --------------------------------------------------------------------------


0
AliR3470 (3236)
11/2/2006 9:42:28 PM


"Michael Archon Sequoia Nielsen" <mnielsen@DELDELDELcvmt.dk> wrote in
message news:454a5e96$0$49201$14726298@news.sunsite.dk...
> AliR (VC++ MVP) wrote:
> > Yes, it sure does.
>
> So it is CFileDialog that does not work on w2k - does it use gdiplus?

I dont think it has anything to do with GDI+. CFileDialog works fine on W2K
and XP. In VS2005, it has changed little bit but that should not matter as
long as you have the correct version of MFC installed on that machine(that
must be the case otherwise you wouldnt be able to run the app).

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com





0
ajaykalra (6842)
11/2/2006 11:36:23 PM
I haven't seen your code, but perhaps you could post that part where you are 
grabbing the file from CFileDialg?

Tom

"Michael Archon Sequoia Nielsen" <mnielsen@DELDELDELcvmt.dk> wrote in 
message news:454a5e96$0$49201$14726298@news.sunsite.dk...
> AliR (VC++ MVP) wrote:
>> Yes, it sure does.
>
> So it is CFileDialog that does not work on w2k - does it use gdiplus?
>
> -- 
> -------------------------------------------------------------------------
> Music, Recipes, Photos, and more:
>
> http://www.sequoiagrove.dk
>
> "You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons 
> of a silly person. I blow my nose at you, so-called Arthur-king, you and 
> all your silly English kaniggets. Thppppt!"
> -------------------------------------------------------------------------- 


0
tserface (3861)
11/3/2006 12:16:33 AM
Tom Serface wrote:
> I haven't seen your code, but perhaps you could post that part where you are 
> grabbing the file from CFileDialg?
> 

void CImgviewDoc::OnFileOpen()
{
     logentry("OnFileOpen()");
     if (SAStopped){ /* make sure graph cut or simulated annealing 
thread is not working*/
     char BASED_CODE szFilter[] = "All files 
(*.bmp;*.jpg;*.jpeg;*.gif;*.ppm;*.pgm;*.png;*.wmf;*.ico)|*.bmp;*.jpg;*.jpeg;*.gif;*.png;*.ppm;*.pgm;*.ico;*.wmf|BMP 
Files (*.bmp)|*.bmp|JPG Files (*.jpg)|*.jpg;*.jpeg|GIF Files 
(*.gif)|*.gif|PPM Files (*.ppm)|*.ppm|PGM Files (*.pgm)|*.pgm|PNG Files 
(*.png)|*.png|WMF metafile (*.wmf)|*.wmf|Icon (*.ico)|*.ico||";

     char *FileNameListBuffer=(char*)malloc(1048577*sizeof(char));
     FileNameListBuffer[0] = 0;
     CFileDialog *openDialog = new 
CFileDialog(TRUE,NULL,NULL,OFN_ALLOWMULTISELECT|OFN_HIDEREADONLY|OFN_FILEMUSTEXIST,szFilter,NULL,sizeof(OPENFILENAME));

         openDialog->m_ofn.lpstrFile=FileNameListBuffer;
         openDialog->m_ofn.nMaxFile=1048576;

     if (openDialog->DoModal()==IDCANCEL)
         {
             logentry("OnFileOpen() CANCELLED");
         }
         else
             {
                 CString    sFilePathName = openDialog->GetPathName();
                 FLIST sFileName;
                 int nofiles;
                 POSITION pos = openDialog->GetStartPosition();
                 while(pos) // extract all selected filenames
                 {

                     sFileName.push_back(openDialog->GetNextPathName(pos));
                 }
                 nofiles = sFileName.size();
                 SetPathName(sFileName[0]);
                 if(sFileName.size()==1)
                     OnOpenDocument(sFileName[0]); /* if only one file 
was selected load it and put all files of the same type in the same 
folder into the filelist*/
                 else
                     OnOpenDocumentMulti(sFileName); /* load the first 
image and put the selected files into the filelist */
             }
            // clean up
             delete openDialog;
             free(FileNameListBuffer);
     }
}


-- 
-------------------------------------------------------------------------
Music, Recipes, Photos, and more:

http://www.sequoiagrove.dk

"You don�t frighten us, English pig-dogs! Go and boil your bottoms, sons 
of a silly person. I blow my nose at you, so-called Arthur-king, you and 
all your silly English kaniggets. Thppppt!"
--------------------------------------------------------------------------
0
mnielsen1 (59)
11/3/2006 8:00:29 AM
Reply:

Similar Artilces: