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. CreateWindowEx causes application crash.

CreateWindowEx causes application crash.

Scheduled Pinned Locked Moved C / C++ / MFC
5 Posts 3 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.
  • B Offline
    B Offline
    birajendu
    wrote on last edited by
    #1

    Hi, I am facing a crash while calling the function CreateWindowEx , Here is the code piece i am using. WNDCLASSEX WndClassEx; memset( &WndClassEx, 0, sizeof(WNDCLASSEX) ); WndClassEx.lpfnWndProc = AVThreadMessageProcedure; WndClassEx.hInstance = (HINSTANCE)g_hModule; WndClassEx.lpszClassName = AVTHREAD_WINDOW_CLASS; WndClassEx.hIcon = hIcon; WndClassEx.hIconSm = hIconSmall; WndClassEx.cbSize = sizeof(WndClassEx); CreateWindowEx( 0, AVTHREAD_WINDOW_CLASS, L "", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, (HINSTANCE)g_hModule,(LPVOID)this ); Here I am passing the pointer of the calling class in last argument. Application is not crashing always but some time it crashed at this point. Can you please give some idea about what wrong i am doing here. Thanks in advance.

    Birajendu SonicWALL Bangalore India

    N C 2 Replies Last reply
    0
    • B birajendu

      Hi, I am facing a crash while calling the function CreateWindowEx , Here is the code piece i am using. WNDCLASSEX WndClassEx; memset( &WndClassEx, 0, sizeof(WNDCLASSEX) ); WndClassEx.lpfnWndProc = AVThreadMessageProcedure; WndClassEx.hInstance = (HINSTANCE)g_hModule; WndClassEx.lpszClassName = AVTHREAD_WINDOW_CLASS; WndClassEx.hIcon = hIcon; WndClassEx.hIconSm = hIconSmall; WndClassEx.cbSize = sizeof(WndClassEx); CreateWindowEx( 0, AVTHREAD_WINDOW_CLASS, L "", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, (HINSTANCE)g_hModule,(LPVOID)this ); Here I am passing the pointer of the calling class in last argument. Application is not crashing always but some time it crashed at this point. Can you please give some idea about what wrong i am doing here. Thanks in advance.

      Birajendu SonicWALL Bangalore India

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      Where is the RegisterClassEx() called? :confused:

      nave [OpenedFileFinder] [My Blog]

      B 1 Reply Last reply
      0
      • N Naveen

        Where is the RegisterClassEx() called? :confused:

        nave [OpenedFileFinder] [My Blog]

        B Offline
        B Offline
        birajendu
        wrote on last edited by
        #3

        Yeah, ofcourse that is being called successfully with out any error.

        Birajendu SonicWALL Bangalore India

        N 1 Reply Last reply
        0
        • B birajendu

          Hi, I am facing a crash while calling the function CreateWindowEx , Here is the code piece i am using. WNDCLASSEX WndClassEx; memset( &WndClassEx, 0, sizeof(WNDCLASSEX) ); WndClassEx.lpfnWndProc = AVThreadMessageProcedure; WndClassEx.hInstance = (HINSTANCE)g_hModule; WndClassEx.lpszClassName = AVTHREAD_WINDOW_CLASS; WndClassEx.hIcon = hIcon; WndClassEx.hIconSm = hIconSmall; WndClassEx.cbSize = sizeof(WndClassEx); CreateWindowEx( 0, AVTHREAD_WINDOW_CLASS, L "", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, (HINSTANCE)g_hModule,(LPVOID)this ); Here I am passing the pointer of the calling class in last argument. Application is not crashing always but some time it crashed at this point. Can you please give some idea about what wrong i am doing here. Thanks in advance.

          Birajendu SonicWALL Bangalore India

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #4

          Could you tell us the exact error message ? Where does it crash exactly ? Try to use your debugger to collect more information.

          Cédric Moonen Software developer
          Charting control [v2.0] OpenGL game tutorial in C++

          1 Reply Last reply
          0
          • B birajendu

            Yeah, ofcourse that is being called successfully with out any error.

            Birajendu SonicWALL Bangalore India

            N Offline
            N Offline
            Naveen
            wrote on last edited by
            #5

            May be some problem with the AVThreadMessageProcedure() function? Did you try putting a break point int that function and debug?

            nave [OpenedFileFinder] [My Blog]

            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