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. MSFLXGRD problem in 64bit machine (MFC/C++)

MSFLXGRD problem in 64bit machine (MFC/C++)

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++cssdebugging
9 Posts 2 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.
  • R Offline
    R Offline
    raesa
    wrote on last edited by
    #1

    I am working on a 64 bit system (windows XP).I have a problem in launching an MFC dialog, that contains an active-x control (MSFlex Grid control).My project builds successfully without any errors.But when i try to launch this dialog, i get an error "Debug Assertion Failed".My Msflxgrd.ocx file is registered successfully.I don't understand where the problem is.Do let me know where the problem is.Please help me out ...... Thnx in advance. :(

    _ 1 Reply Last reply
    0
    • R raesa

      I am working on a 64 bit system (windows XP).I have a problem in launching an MFC dialog, that contains an active-x control (MSFlex Grid control).My project builds successfully without any errors.But when i try to launch this dialog, i get an error "Debug Assertion Failed".My Msflxgrd.ocx file is registered successfully.I don't understand where the problem is.Do let me know where the problem is.Please help me out ...... Thnx in advance. :(

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      This problem can arise if the dialog application is build for x64 and the flex grid is a 32 bit activeX.

      «_Superman_»

      R 1 Reply Last reply
      0
      • _ _Superman_

        This problem can arise if the dialog application is build for x64 and the flex grid is a 32 bit activeX.

        «_Superman_»

        R Offline
        R Offline
        raesa
        wrote on last edited by
        #3

        Firstly, thnx for the reply. I have a question, though...if i am working on a 64bit machine, then the active x control (Msflxgrd.ocx) will be for 64bit right?How is it possible that i can built a dialog for 64bit with 32 bit active x control?Is there anything else that is required to be done on my project settings or any other file that i am suppose to use or download.Please do lemme know. Thnk You.

        _ 1 Reply Last reply
        0
        • R raesa

          Firstly, thnx for the reply. I have a question, though...if i am working on a 64bit machine, then the active x control (Msflxgrd.ocx) will be for 64bit right?How is it possible that i can built a dialog for 64bit with 32 bit active x control?Is there anything else that is required to be done on my project settings or any other file that i am suppose to use or download.Please do lemme know. Thnk You.

          _ Offline
          _ Offline
          _Superman_
          wrote on last edited by
          #4

          It is not necessary that the flex grid is also 64 bit. Even though the OS is 64 bit, you can create 32 bit binaries. Basically a 64 bit binary cannot load any 32 bit modules (.dll, .ocx etc.) Similarily 32 bit binaries cannot load 64 bit modules. So make sure the dialog app and flexgrid have the same bitness.

          «_Superman_»

          R 1 Reply Last reply
          0
          • _ _Superman_

            It is not necessary that the flex grid is also 64 bit. Even though the OS is 64 bit, you can create 32 bit binaries. Basically a 64 bit binary cannot load any 32 bit modules (.dll, .ocx etc.) Similarily 32 bit binaries cannot load 64 bit modules. So make sure the dialog app and flexgrid have the same bitness.

            «_Superman_»

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

            I have checked my dialog app and flexgrid.Both are 64bit. I don't just understand what the problem is.Please do let me know.

            _ 1 Reply Last reply
            0
            • R raesa

              I have checked my dialog app and flexgrid.Both are 64bit. I don't just understand what the problem is.Please do let me know.

              _ Offline
              _ Offline
              _Superman_
              wrote on last edited by
              #6

              If you can give me the stack trace and the code in you InitDialog function I could try and find out.

              «_Superman_»

              R 1 Reply Last reply
              0
              • _ _Superman_

                If you can give me the stack trace and the code in you InitDialog function I could try and find out.

                «_Superman_»

                R Offline
                R Offline
                raesa
                wrote on last edited by
                #7

                Hi.... My code is pasted here below.I developed this in VS 2005, type of project: MFC Application(.exe) When i debug the code, it fails in function CreateDlgIndirect (in dlgcore.cpp which is system file) Please do have a look.Thnx again. BOOL CMFCExecutableApp::InitInstance() { // InitCommonControlsEx() is required on Windows XP if an application // manifest specifies use of ComCtl32.dll version 6 or later to enable // visual styles. Otherwise, any window creation will fail. INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // Set this to include all the common control classes you want to use // in your application. InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } // Initialize OLE libraries if (!AfxOleInit()) { AfxMessageBox(IDP_OLE_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need // Change the registry key under which our settings are stored // TODO: You should modify this string to be something appropriate // such as the name of your company or organization SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings(4); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views CMultiDocTemplate* pDocTemplate; pDocTemplate = new CMultiDocTemplate(IDR_MFCExecutableTYPE, RUNTIME_CLASS(CMFCExecutableDoc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(CMFCExecutableView)); if (!pDocTemplate) return FALSE; AddDocTemplate(pDocTemplate); // Connect the COleTemplateServer to the document template // The COleTemplateServer creates new documents on behalf // of requesting OLE containers by using information // specified in the document template m_server.ConnectTemplate(clsid, pDocTemplate, FALSE); // Register all OLE server factories as running. This enables the // OLE libraries to create objects from other applications COleTemplateServer::RegisterAll(); // Note: MDI applications register all server objects without regard // to the /Embedding or

                _ 1 Reply Last reply
                0
                • R raesa

                  Hi.... My code is pasted here below.I developed this in VS 2005, type of project: MFC Application(.exe) When i debug the code, it fails in function CreateDlgIndirect (in dlgcore.cpp which is system file) Please do have a look.Thnx again. BOOL CMFCExecutableApp::InitInstance() { // InitCommonControlsEx() is required on Windows XP if an application // manifest specifies use of ComCtl32.dll version 6 or later to enable // visual styles. Otherwise, any window creation will fail. INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // Set this to include all the common control classes you want to use // in your application. InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } // Initialize OLE libraries if (!AfxOleInit()) { AfxMessageBox(IDP_OLE_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need // Change the registry key under which our settings are stored // TODO: You should modify this string to be something appropriate // such as the name of your company or organization SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings(4); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views CMultiDocTemplate* pDocTemplate; pDocTemplate = new CMultiDocTemplate(IDR_MFCExecutableTYPE, RUNTIME_CLASS(CMFCExecutableDoc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(CMFCExecutableView)); if (!pDocTemplate) return FALSE; AddDocTemplate(pDocTemplate); // Connect the COleTemplateServer to the document template // The COleTemplateServer creates new documents on behalf // of requesting OLE containers by using information // specified in the document template m_server.ConnectTemplate(clsid, pDocTemplate, FALSE); // Register all OLE server factories as running. This enables the // OLE libraries to create objects from other applications COleTemplateServer::RegisterAll(); // Note: MDI applications register all server objects without regard // to the /Embedding or

                  _ Offline
                  _ Offline
                  _Superman_
                  wrote on last edited by
                  #8

                  I would like to see the code where the actual crash happens. I'm guessing this is the code where the dialog or form view is being initialized.

                  «_Superman_»

                  R 1 Reply Last reply
                  0
                  • _ _Superman_

                    I would like to see the code where the actual crash happens. I'm guessing this is the code where the dialog or form view is being initialized.

                    «_Superman_»

                    R Offline
                    R Offline
                    raesa
                    wrote on last edited by
                    #9

                    Hi..... Thnx for the reply.I have pasted the code below from dlgcore.cpp.The code fails at function CreateDlgIndirect.Do have a look. If possible plse create an MFC Application in VS 2005 and insert an active x control (MS FLEX GRD) and execute it.i think you might get the error "Debug Assertion failed", while executing the dialog.to remind, my system is a 64bit system .Thnx once again.Please do let me know if you get to know the problem. thnx. INT_PTR CDialog::DoModal() { // can be constructed with a resource template or InitModalIndirect ASSERT(m_lpszTemplateName != NULL || m_hDialogTemplate != NULL || m_lpDialogTemplate != NULL); // load resource as necessary LPCDLGTEMPLATE lpDialogTemplate = m_lpDialogTemplate; HGLOBAL hDialogTemplate = m_hDialogTemplate; HINSTANCE hInst = AfxGetResourceHandle(); if (m_lpszTemplateName != NULL) { hInst = AfxFindResourceHandle(m_lpszTemplateName, RT_DIALOG); HRSRC hResource = ::FindResource(hInst, m_lpszTemplateName, RT_DIALOG); hDialogTemplate = LoadResource(hInst, hResource); } if (hDialogTemplate != NULL) lpDialogTemplate = (LPCDLGTEMPLATE)LockResource(hDialogTemplate); // return -1 in case of failure to load the dialog template resource if (lpDialogTemplate == NULL) return -1; // disable parent (before creating dialog) HWND hWndParent = PreModal(); AfxUnhookWindowCreate(); BOOL bEnableParent = FALSE; #ifndef _AFX_NO_OLE_SUPPORT CWnd* pMainWnd = NULL; BOOL bEnableMainWnd = FALSE; #endif if (hWndParent && hWndParent != ::GetDesktopWindow() && ::IsWindowEnabled(hWndParent)) { ::EnableWindow(hWndParent, FALSE); bEnableParent = TRUE; #ifndef _AFX_NO_OLE_SUPPORT pMainWnd = AfxGetMainWnd(); if (pMainWnd && pMainWnd->IsFrameWnd() && pMainWnd->IsWindowEnabled()) { // // We are hosted by non-MFC container // pMainWnd->EnableWindow(FALSE); bEnableMainWnd = TRUE; } #endif } TRY { // create modeless dialog AfxHookWindowCreate(this); if (CreateDlgIndirect(lpDialogTemplate, CWnd::FromHandle(hWndParent), hInst)) { if (m_nFlags & WF_CONTINUEMODAL) { // enter modal loop DWORD dwFlags = MLF_SHOWONIDLE; if (GetStyle() & DS_NOIDLEMSG) dwFlags |= MLF_NOIDLEMSG; VERIFY(RunModalLoop(dwFlags) == m_nModalResult); } // hide the window before enabling the parent, etc. if (m_hWnd != NULL) SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW| SWP_NOSIZE|SWP_N

                    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