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. How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ?

How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
9 Posts 4 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.
  • S Offline
    S Offline
    suninwater
    wrote on last edited by
    #1

    Hi, guys: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Any suggestion/advice is much appreciated. TIA :confused:

    P 1 Reply Last reply
    0
    • S suninwater

      Hi, guys: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Any suggestion/advice is much appreciated. TIA :confused:

      P Offline
      P Offline
      pranavamhari
      wrote on last edited by
      #2

      WHy would you want to do that ? Code in win32 is better than MFC IMHO. Hari Krishnan

      S 1 Reply Last reply
      0
      • P pranavamhari

        WHy would you want to do that ? Code in win32 is better than MFC IMHO. Hari Krishnan

        S Offline
        S Offline
        suninwater
        wrote on last edited by
        #3

        I have to convert my program to an ocx. And I've got that it's very difficult to implement it from a win32 one. Somebody told me it's a little easier to do that from a mfc one. Am I right or wrong ? Any advice ?

        I 1 Reply Last reply
        0
        • S suninwater

          I have to convert my program to an ocx. And I've got that it's very difficult to implement it from a win32 one. Somebody told me it's a little easier to do that from a mfc one. Am I right or wrong ? Any advice ?

          I Offline
          I Offline
          igor1960
          wrote on last edited by
          #4

          If it's a standalone windows program like SDI/MDI/or Dialog: solution maybe very easy: Just create standard MFC COleControl application: 1. Overload OnCreateWindow -- add to it creation of your main Win32 SDI/MDI/Dialog frame or window; immediately after that call SetParent on it so your Control Window will becomw parent of it -- also you may need to change style of your Win32 window to WS_CHILD -- remeber m_hWnd32 handler to your SDI/MDI/Dialog frame here in one of member variables; 2. Overload OnSize of your COleControl and resize your m_hWnd32 here to occupy all available space of COleControl; 3. Remove message pump from the original code of your application -- you are running on message pump of container now; 4. Add PreTranslateMessage to you COleControl and perform appropriate calls to your win32 app returning true/false if appropriate... Regards "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me

          S 1 Reply Last reply
          0
          • I igor1960

            If it's a standalone windows program like SDI/MDI/or Dialog: solution maybe very easy: Just create standard MFC COleControl application: 1. Overload OnCreateWindow -- add to it creation of your main Win32 SDI/MDI/Dialog frame or window; immediately after that call SetParent on it so your Control Window will becomw parent of it -- also you may need to change style of your Win32 window to WS_CHILD -- remeber m_hWnd32 handler to your SDI/MDI/Dialog frame here in one of member variables; 2. Overload OnSize of your COleControl and resize your m_hWnd32 here to occupy all available space of COleControl; 3. Remove message pump from the original code of your application -- you are running on message pump of container now; 4. Add PreTranslateMessage to you COleControl and perform appropriate calls to your win32 app returning true/false if appropriate... Regards "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me

            S Offline
            S Offline
            suninwater
            wrote on last edited by
            #5

            Thanks for your kind and clear direction. But my program is not a simple SDI/MDI/Dialog one, instead, something more complex. Does your solution fit this ? Thank you very much !

            I 1 Reply Last reply
            0
            • S suninwater

              Thanks for your kind and clear direction. But my program is not a simple SDI/MDI/Dialog one, instead, something more complex. Does your solution fit this ? Thank you very much !

              I Offline
              I Offline
              igor1960
              wrote on last edited by
              #6

              No...;P "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me

              S 1 Reply Last reply
              0
              • I igor1960

                No...;P "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me

                S Offline
                S Offline
                suninwater
                wrote on last edited by
                #7

                What a pity! Are there any other ways in which I can finish my task ? Thanks a lot for your help anyway!

                S 1 Reply Last reply
                0
                • S suninwater

                  What a pity! Are there any other ways in which I can finish my task ? Thanks a lot for your help anyway!

                  S Offline
                  S Offline
                  Steve S
                  wrote on last edited by
                  #8

                  Instead of using MFC, why not consider ATL. Yes, writing a control is not necessarily easy, but instead of bloating your control by using MFC, ATL will take much of the pain away... Steve S [This signature space available for rent]

                  S 1 Reply Last reply
                  0
                  • S Steve S

                    Instead of using MFC, why not consider ATL. Yes, writing a control is not necessarily easy, but instead of bloating your control by using MFC, ATL will take much of the pain away... Steve S [This signature space available for rent]

                    S Offline
                    S Offline
                    suninwater
                    wrote on last edited by
                    #9

                    convert my program to a MFC one then convert the MFC one to an ocx. He also told me the first step need only minor change on source and the latter is also not very difficult. Time is so limited though I'm not familiar with VC++... Can you give me some further help? Thank you very much !

                    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