Thread: error C2064: term does not evaluate to a function taking 1 arguments

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    12

    Unhappy error C2064: term does not evaluate to a function taking 1 arguments

    Hi if any1 can help me i have the error:

    error C2064: term does not evaluate to a function taking 1 arguments

    for the following line and i have other lines simular with the same errors:

    (*file).publication.Add_publisher((_wtoi (readData[1]));
    i still get the same errors if i have the code as:

    (*file).publication.Add_publisher(readData[1]);

    i have tried every thing i can think of to solve it but am currently unable to, just as some extra info this is for to open a extnal csv file into an MFC diloag

    thanks....

  2. #2
    Registered User
    Join Date
    Aug 2011
    Posts
    12
    im using Visual Studio 2008 c++ sorry forgot to mention that!

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    The information you have given is insufficient to solve the problem. Have a look at this link for information on C2064 that can get you started.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  4. #4
    Registered User
    Join Date
    Aug 2011
    Posts
    12
    i looked through the page that you gave me and i cant see any that are simular to my coding, if it is possible could you or anybody else please explain the error 2 me add what the error exactly is? thanks

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    What do you expect me to do? Read your mind? You have shown the offending line, but not the declarations and types of things referenced in that line.

    From the offending line, you apparently think (*file).publication.Add_publisher is a member function that accepts one argument. The compiler thinks otherwise.

    From that, I can guess that Add_publisher is possibly a pointer to a function, or a pointer to a member function.

    There are many possibilities though, and I'm not a mindreader, so I can't guess. It would be easier if you looked up what Add_publisher is ( for example, (*file).publication is presumably an instance of a class type, and that class type might well declare something named Add_publisher). Then you can work out for yourself what the problem is.
    Last edited by grumpy; 08-24-2011 at 04:19 AM.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  6. #6
    Registered User
    Join Date
    Aug 2011
    Posts
    12
    (*file). is a pointer that points to the class publication and the variable in that class Add_publisher, here is not the error the error is with in what follows that they ((_wtoi (readData[1])); or the (readData[1]);...............readData is declared as a CString param = readData sorry to keep inconveniencing you, thanks

  7. #7
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    If Add_publisher is a variable (or a member of the class) then, unless it is an object that has an operator(), it should not be treated like a function.

    By supplying the (readData[1]) you are treating Add_publisher like a function. Even though it is not a function.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  8. #8
    Registered User
    Join Date
    Aug 2011
    Posts
    12
    ohhh okay thanks for them g!

  9. #9
    Registered User
    Join Date
    Aug 2011
    Location
    Montreal, Quebec, Canada
    Posts
    73
    I also can't help but notice your parentheses don't match.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 06-14-2010, 01:27 PM
  2. Replies: 1
    Last Post: 06-14-2010, 01:26 PM
  3. Replies: 3
    Last Post: 03-31-2010, 04:28 AM
  4. Replies: 4
    Last Post: 10-25-2009, 05:06 PM
  5. Replies: 9
    Last Post: 10-20-2008, 10:23 AM