Click here to Skip to main content
15,895,781 members
Please Sign up or sign in to vote.
2.67/5 (3 votes)
See more:
I have some C++ code inside of my library (.h file).
I'm using a Win32 C++ Project in Visual Studio 2010.
Here's my code:
C++
virtual char*         get_T() { return this->t; }
	virtual void          set_T(char *value) { this->t = value; }
	void Draw()
	{
		int img;
		img = ImageAdd(get_T);

	}

private:

    int    m_width;
	int    m_hight;
	int    m_x;
	int    m_y;
    string m_text;
	string m_texture;
	char *t;

And the prototype for ImageAdd() is:
C++
int ImageAdd(char *filename);

I keep getting this error:
"IntelliSense: argument of type "char *(dfButton::*)()" is incompatible with parameter of type "char *"

I need to know how to fix this.

If I need to post more to help let me know.
Posted
Updated 5-Jul-12 20:23pm
v2

1 solution

You could try adding brackets to call the function, instead of trying to return its address...
C#
img = ImageAdd(get_T);
Becomes
C#
img = ImageAdd(get_T());
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900