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. migration from Visual studio 6

migration from Visual studio 6

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++csharpvisual-studiocom
35 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.
  • J Jochen Arndt

    To get rid of the warning ensure that the parameter lists of the functions agree. If this is serious depends on the assignment. It is just a warning and the code will be compiled. But your application may crash when passing incompatible parameters. You should show the assignment and the definitions.

    S Offline
    S Offline
    Swap9
    wrote on last edited by
    #26

    below given code in file 'some.c' --------------------------------

    #ifdef __STDC__
    static int fun1 ( struct1_inlistfile membervar1, void_pointerinlist_file membervar2 )
    #else

    static int fun1 (membervar1, membervar2)

    struct1_inlistfile membervar1;
    void_pointerinlist_file membervar2;

    #endif

    if the code is as above - I get this warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'RECORDstructinlistheader' file if i comment the above code like you showed the other day the warning goes away. .h file has record defination in the form off struct. the 'some.c' file has another list class defination static RECORDstructinlistheader Listclass = { sizeof(RECORD), sizeof(element in record), add function , search function, /*This is the line where warning is pointed to */ pointer set, . . . I am afraid I am confusing, but I am giving much details to understand it correctly. pls help.

    J 1 Reply Last reply
    0
    • S Swap9

      below given code in file 'some.c' --------------------------------

      #ifdef __STDC__
      static int fun1 ( struct1_inlistfile membervar1, void_pointerinlist_file membervar2 )
      #else

      static int fun1 (membervar1, membervar2)

      struct1_inlistfile membervar1;
      void_pointerinlist_file membervar2;

      #endif

      if the code is as above - I get this warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'RECORDstructinlistheader' file if i comment the above code like you showed the other day the warning goes away. .h file has record defination in the form off struct. the 'some.c' file has another list class defination static RECORDstructinlistheader Listclass = { sizeof(RECORD), sizeof(element in record), add function , search function, /*This is the line where warning is pointed to */ pointer set, . . . I am afraid I am confusing, but I am giving much details to understand it correctly. pls help.

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #27

      So you did not get the warning when removing the __STDC__ stuff? Then its should be OK. To resolve the error check the declaration of search_function and the corresponding RECORDstructinlistheader structure member (structure definition in some header file).

      S 2 Replies Last reply
      0
      • J Jochen Arndt

        So you did not get the warning when removing the __STDC__ stuff? Then its should be OK. To resolve the error check the declaration of search_function and the corresponding RECORDstructinlistheader structure member (structure definition in some header file).

        S Offline
        S Offline
        Swap9
        wrote on last edited by
        #28

        right no warnings when removing __STDC__ stuff. I am trying to resolve where is that disagreement happening - but I am confused looking what is the meaning of these four statement ?

        typedef int (*p)(void *, void *);

        typedef void *P;

        typedef void* P;

        typedef void* (*p)();

        J 1 Reply Last reply
        0
        • S Swap9

          right no warnings when removing __STDC__ stuff. I am trying to resolve where is that disagreement happening - but I am confused looking what is the meaning of these four statement ?

          typedef int (*p)(void *, void *);

          typedef void *P;

          typedef void* P;

          typedef void* (*p)();

          J Offline
          J Offline
          Jochen Arndt
          wrote on last edited by
          #29

          Swap9 wrote:

          right no warnings when removing __STDC__ stuff.

          Then don't care about it.

          // A pointer to a function returning an int and accepting to parameters of type void*
          typedef int (*p)(void *, void *);
          // Use it this way:
          // int some_func(void *p1, void *p2);
          // p my_func = some_func;
          // Then you can call the function
          // int nRet = my_func(param1, param2);

          // A pointer to an unspecified object
          typedef void *P;

          // A pointer to a function returning void*
          typedef void* (*p)();
          // With the preceeding typedef it can be also written as
          typedef P (*p)();

          S 1 Reply Last reply
          0
          • J Jochen Arndt

            Swap9 wrote:

            right no warnings when removing __STDC__ stuff.

            Then don't care about it.

            // A pointer to a function returning an int and accepting to parameters of type void*
            typedef int (*p)(void *, void *);
            // Use it this way:
            // int some_func(void *p1, void *p2);
            // p my_func = some_func;
            // Then you can call the function
            // int nRet = my_func(param1, param2);

            // A pointer to an unspecified object
            typedef void *P;

            // A pointer to a function returning void*
            typedef void* (*p)();
            // With the preceeding typedef it can be also written as
            typedef P (*p)();

            S Offline
            S Offline
            Swap9
            wrote on last edited by
            #30

            Thank you so much !

            1 Reply Last reply
            0
            • J Jochen Arndt

              So you did not get the warning when removing the __STDC__ stuff? Then its should be OK. To resolve the error check the declaration of search_function and the corresponding RECORDstructinlistheader structure member (structure definition in some header file).

              S Offline
              S Offline
              Swap9
              wrote on last edited by
              #31

              I also have another issue - posted at http://www.codeproject.com/Messages/4873177/How-can-I-display-Japanese-characters-in-an-applic.aspx[^] Will be able to help please ?

              J 1 Reply Last reply
              0
              • S Swap9

                I also have another issue - posted at http://www.codeproject.com/Messages/4873177/How-can-I-display-Japanese-characters-in-an-applic.aspx[^] Will be able to help please ?

                J Offline
                J Offline
                Jochen Arndt
                wrote on last edited by
                #32

                I saw that post but thought it was (partially) solved. When the application uses Japanese Multi Byte characters, support for this characters must be installed in Windows. The best approach would be converting the application to Unicode. But that might be a lot of work (all char and string literals must be manually rewritten by enclosing them using the _T() macro and the resource strings must be also updated).

                S 1 Reply Last reply
                0
                • J Jochen Arndt

                  I saw that post but thought it was (partially) solved. When the application uses Japanese Multi Byte characters, support for this characters must be installed in Windows. The best approach would be converting the application to Unicode. But that might be a lot of work (all char and string literals must be manually rewritten by enclosing them using the _T() macro and the resource strings must be also updated).

                  S Offline
                  S Offline
                  Swap9
                  wrote on last edited by
                  #33

                  Ok thats another approach - but if its easy I can do it. Will you be able to show me a simple example of it ? can I compile and execute it in Japanese just by adding _T() on the Japanese windows ? I had another expert suggesting me this option, but that looked like another proj on its own http://social.msdn.microsoft.com/Forums/vstudio/en-US/d3b75db1-3646-4591-84c5-924cd5ec3065/how-to-change-the-application-to-display-gui-screens-captions-etc-in-both-the-languages-japanese?forum=vcgeneral#a4ff216a-fd6c-419f-a8a5-81b40b08e4b8[^]

                  J 1 Reply Last reply
                  0
                  • S Swap9

                    Ok thats another approach - but if its easy I can do it. Will you be able to show me a simple example of it ? can I compile and execute it in Japanese just by adding _T() on the Japanese windows ? I had another expert suggesting me this option, but that looked like another proj on its own http://social.msdn.microsoft.com/Forums/vstudio/en-US/d3b75db1-3646-4591-84c5-924cd5ec3065/how-to-change-the-application-to-display-gui-screens-captions-etc-in-both-the-languages-japanese?forum=vcgeneral#a4ff216a-fd6c-419f-a8a5-81b40b08e4b8[^]

                    J Offline
                    J Offline
                    Jochen Arndt
                    wrote on last edited by
                    #34

                    I'm sorry but I can't really help you with the language issues due to lack of experience with multi byte projects. Your link seems to describe the problem. Porting an appplication to Unicode is a lot of work (more than I told you before; I forget to mention additional tasks). If you decide to port your application take special care when reading and writing text file. You may want to let those still use ANSI rather than Unicode.

                    S 1 Reply Last reply
                    0
                    • J Jochen Arndt

                      I'm sorry but I can't really help you with the language issues due to lack of experience with multi byte projects. Your link seems to describe the problem. Porting an appplication to Unicode is a lot of work (more than I told you before; I forget to mention additional tasks). If you decide to port your application take special care when reading and writing text file. You may want to let those still use ANSI rather than Unicode.

                      S Offline
                      S Offline
                      Swap9
                      wrote on last edited by
                      #35

                      Sure, Thanks a lot for responding. I will find out.

                      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