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. call W32 API from MFC app

call W32 API from MFC app

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++json
7 Posts 5 Posters 1 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.
  • E Offline
    E Offline
    Errol
    wrote on last edited by
    #1

    I think it's a simple question yet have not found ANY answers. I would like to call BOOL CopyFileEx( LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags ); in my MFC app. No luck... what am I missing? Thanks:confused:

    E C C E 4 Replies Last reply
    0
    • E Errol

      I think it's a simple question yet have not found ANY answers. I would like to call BOOL CopyFileEx( LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags ); in my MFC app. No luck... what am I missing? Thanks:confused:

      E Offline
      E Offline
      Ernesto Perales Soto
      wrote on last edited by
      #2

      :confused: And your problem is? Does not compile? Compiles but does not work? Blows your machine? eperales

      1 Reply Last reply
      0
      • E Errol

        I think it's a simple question yet have not found ANY answers. I would like to call BOOL CopyFileEx( LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags ); in my MFC app. No luck... what am I missing? Thanks:confused:

        C Offline
        C Offline
        Carlos Antollini
        wrote on last edited by
        #3

        How you are using the function.....? Why don't use SHFileOperation? Best Regards.... Carlos Antollini. Pi Five[^]Creator Sonork ID 100.10529 cantollini

        1 Reply Last reply
        0
        • E Errol

          I think it's a simple question yet have not found ANY answers. I would like to call BOOL CopyFileEx( LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags ); in my MFC app. No luck... what am I missing? Thanks:confused:

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          MFC is calling Win32 stuff itself, you should be able to call any Win32 function from MFC. What you're missing is an explanation of what is going wrong, but according to MSDN it was introduced in W98, so you probably need a platform SDK installed in order to use it. ( That is to say you DO need it, and I'm guessing it's your problem ). Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

          1 Reply Last reply
          0
          • E Errol

            I think it's a simple question yet have not found ANY answers. I would like to call BOOL CopyFileEx( LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags ); in my MFC app. No luck... what am I missing? Thanks:confused:

            E Offline
            E Offline
            Errol
            wrote on last edited by
            #5

            If include the "winbase.h" header file the complier complains c:\program files\microsoft sdk\include\wininet.h(297) : error C2146: syntax error : missing ';' before identifier 'dwResult' c:\program files\microsoft sdk\include\wininet.h(297) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers c:\program files\microsoft sdk\include\wininet.h(297) : error C2501: 'dwResult' : missing storage-class or type specifiers thanks again

            E R 2 Replies Last reply
            0
            • E Errol

              If include the "winbase.h" header file the complier complains c:\program files\microsoft sdk\include\wininet.h(297) : error C2146: syntax error : missing ';' before identifier 'dwResult' c:\program files\microsoft sdk\include\wininet.h(297) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers c:\program files\microsoft sdk\include\wininet.h(297) : error C2501: 'dwResult' : missing storage-class or type specifiers thanks again

              E Offline
              E Offline
              Ernesto Perales Soto
              wrote on last edited by
              #6

              I have Platform SDK installed, and I had similar error, after defining: #define WIN32_WINDOWS 0x0410 in stdafx.h (before any include) they disappeared eperales

              1 Reply Last reply
              0
              • E Errol

                If include the "winbase.h" header file the complier complains c:\program files\microsoft sdk\include\wininet.h(297) : error C2146: syntax error : missing ';' before identifier 'dwResult' c:\program files\microsoft sdk\include\wininet.h(297) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers c:\program files\microsoft sdk\include\wininet.h(297) : error C2501: 'dwResult' : missing storage-class or type specifiers thanks again

                R Offline
                R Offline
                Rene De La Garza
                wrote on last edited by
                #7

                the msdn says: To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. maybe Adding it.

                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