Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Error in constructing Image class ?????

Error in constructing Image class ?????

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
15 Posts 9 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T TooShy2Talk

    Hi, I'm encountering an error in constructiong an Image class. For example: Provided that gdiplus is included. Image img(L"c:\\Sample.jpg"); the error points out to atlsimpstr.h. Hope somebody can spare some comment. It will be appreciated. Thank You.

    N Offline
    N Offline
    nbugalia
    wrote on last edited by
    #3

    Did you try without using L, I mean - Image img("c:\\Sample.jpg");

    T 1 Reply Last reply
    0
    • T TooShy2Talk

      Hi, I'm encountering an error in constructiong an Image class. For example: Provided that gdiplus is included. Image img(L"c:\\Sample.jpg"); the error points out to atlsimpstr.h. Hope somebody can spare some comment. It will be appreciated. Thank You.

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #4

      Whenever an error occurs: (1) Read the error message, usually it is quite descriptive. (2) If after point (1) you're still in troubles then post here your code (you've already done it) and the error message itself (you haven't done yet). :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

      1 Reply Last reply
      0
      • T TooShy2Talk

        Hi, I'm encountering an error in constructiong an Image class. For example: Provided that gdiplus is included. Image img(L"c:\\Sample.jpg"); the error points out to atlsimpstr.h. Hope somebody can spare some comment. It will be appreciated. Thank You.

        R Offline
        R Offline
        rjkg
        wrote on last edited by
        #5

        checkout c:\\Sample.jpg on the right path or the splling of the image you r using correct.

        Rajesh

        T 1 Reply Last reply
        0
        • C Cedric Moonen

          And what is the exact error ? Some info might help us, we still can't read what's written on your screen (altough we are trying hard).

          Cédric Moonen Software developer
          Charting control [v1.3 - Updated]

          T Offline
          T Offline
          TooShy2Talk
          wrote on last edited by
          #6

          The program compiled succesfully but encountered an error in the constructor. Error: Unhandled exception: Access violation reading location 0x00000010. pointing to atlsimpstr.h which is not my included in my source code.

          R R D 3 Replies Last reply
          0
          • N nbugalia

            Did you try without using L, I mean - Image img("c:\\Sample.jpg");

            T Offline
            T Offline
            TooShy2Talk
            wrote on last edited by
            #7

            Yes, and has a compiling error. Error: Cannot convert const char[10] to const WCHAR*.

            1 Reply Last reply
            0
            • T TooShy2Talk

              Hi, I'm encountering an error in constructiong an Image class. For example: Provided that gdiplus is included. Image img(L"c:\\Sample.jpg"); the error points out to atlsimpstr.h. Hope somebody can spare some comment. It will be appreciated. Thank You.

              T Offline
              T Offline
              TooShy2Talk
              wrote on last edited by
              #8

              By the way I have made this code work in other project. Now I'm trying to integrate this to an open source project.

              1 Reply Last reply
              0
              • R rjkg

                checkout c:\\Sample.jpg on the right path or the splling of the image you r using correct.

                Rajesh

                T Offline
                T Offline
                TooShy2Talk
                wrote on last edited by
                #9

                It is all correct.

                1 Reply Last reply
                0
                • T TooShy2Talk

                  The program compiled succesfully but encountered an error in the constructor. Error: Unhandled exception: Access violation reading location 0x00000010. pointing to atlsimpstr.h which is not my included in my source code.

                  R Offline
                  R Offline
                  Rajkumar R
                  wrote on last edited by
                  #10

                  Are you sure the exception is due to Image constructor. Have you debugged step into the Image constructor? When i did even though the path is not correct, i didn't get exception and it not directing to the source coded of atlsimpstr.h. I think it is not because of Image constructor. I suggest you to check the callstack which statement in your program leads to the exception and you can also debug the Image Constructor to verify.

                  T 1 Reply Last reply
                  0
                  • T TooShy2Talk

                    The program compiled succesfully but encountered an error in the constructor. Error: Unhandled exception: Access violation reading location 0x00000010. pointing to atlsimpstr.h which is not my included in my source code.

                    R Offline
                    R Offline
                    Rajesh R Subramanian
                    wrote on last edited by
                    #11

                    Why can't you just debug and find out the problem?

                    Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                    1 Reply Last reply
                    0
                    • R Rajkumar R

                      Are you sure the exception is due to Image constructor. Have you debugged step into the Image constructor? When i did even though the path is not correct, i didn't get exception and it not directing to the source coded of atlsimpstr.h. I think it is not because of Image constructor. I suggest you to check the callstack which statement in your program leads to the exception and you can also debug the Image Constructor to verify.

                      T Offline
                      T Offline
                      TooShy2Talk
                      wrote on last edited by
                      #12

                      Yes, I have debugged the code and error appears after the constructor line.

                      R 1 Reply Last reply
                      0
                      • T TooShy2Talk

                        Yes, I have debugged the code and error appears after the constructor line.

                        R Offline
                        R Offline
                        Rajkumar R
                        wrote on last edited by
                        #13

                        can you post the code snippet.

                        1 Reply Last reply
                        0
                        • T TooShy2Talk

                          The program compiled succesfully but encountered an error in the constructor. Error: Unhandled exception: Access violation reading location 0x00000010. pointing to atlsimpstr.h which is not my included in my source code.

                          D Offline
                          D Offline
                          David Crow
                          wrote on last edited by
                          #14

                          So set a breakpoint in the constructor and single-step over each statement.

                          "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                          1 Reply Last reply
                          0
                          • T TooShy2Talk

                            Hi, I'm encountering an error in constructiong an Image class. For example: Provided that gdiplus is included. Image img(L"c:\\Sample.jpg"); the error points out to atlsimpstr.h. Hope somebody can spare some comment. It will be appreciated. Thank You.

                            M Offline
                            M Offline
                            Mark Salsbery
                            wrote on last edited by
                            #15

                            Runtime error?  If so, have you initialized GDI+ (GdiplusStartup(), etc)?? Mark

                            Mark Salsbery Microsoft MVP - Visual C++ :java:

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups