Thread: c4430

  1. #1
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195

    c4430

    getting an error c4430 on the following line

    Code:
    operator=( DWORD value )
       {  // <---- this is where the error is reported
       return Set(value, TRUE);
       };
    I think they guy was trying to do automatic type conversion, but im unfamiliar with this practice so I don't know how to fix the problem.

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    operator=() doesn't specify a return type.
    Find out what Set() returns and use that as the return type.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Doesn't the error message tell you all about the error? Or perhaps you are unfamiliar with Visual Studio errors...
    Quote Originally Posted by MSDN
    C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by cpjust View Post
    operator=() doesn't specify a return type.
    Find out what Set() returns and use that as the return type.
    ok, i changed it to
    Code:
    HRESULT operator= etc.
    


    seems to not give an error naymore at least, not tellign if that fixed it.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    You would get an error if the return type is incorrect since you'd be returning an incorrect type.
    I'd say it's fixed unless the function is returned a faulty value in the first place.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by Elysia View Post
    You would get an error if the return type is incorrect since you'd be returning an incorrect type.
    I'd say it's fixed unless the function is returned a faulty value in the first place.
    Unfortunately there are about 150 other compile errors to fix before I will know. The previous programmer was a ........nut retard. None of his code is portable from 6.0 to 2005 let alone from Win32 to Win64 or Linux.

    Not that most of my code is portable to linux, but thats just because I make heavy use of the Win32 API, its syntactically portable if one where to impliment the functions I call.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  2. #include <string> not working?
    By bulletbutter in forum C++ Programming
    Replies: 7
    Last Post: 04-26-2008, 12:46 AM
  3. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  4. Class Include Problem (I Think)
    By gpr1me in forum C++ Programming
    Replies: 8
    Last Post: 03-21-2006, 12:47 PM
  5. DirectSound header issues
    By dxfoo in forum C++ Programming
    Replies: 0
    Last Post: 03-19-2006, 07:16 PM