Jump to content
  • Advertisement
Sign in to follow this  
XenoPhyre

Visual C++ 2008: error C2470 "looks like function definition, but no parameter list"

This topic is 3660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

(Visual C++ 2008 Express Edition) Hey everyone, Do you think you could tell me why my declaration of this class, is causing error C2470 ("looks like a function definition, but there is no parameter list; skipping apparent body"). I have been wrestling with this error for quite a while now.
class __declspec(dllexport) AbstractionHandle
{
    public:
    void SetAPICode(int API){APINumber = API;}
    int GetAPICode(){return APINumber;}
    int CollectDeviceCapabilities(int API);
    void CreateDevice(HWND hWnd);
    /* All rendering functions after here. */
    void* ObtainDeviceMAddress(){return device;}

    private:
    AbstractionHandle()
	{
	device = NULL;
	APINumber = 0;
	}
    ~AbstractionHandle();
    int APINumber; /* 0 - DX9, 1 - OpenGL */
    DeviceCapabilities caps;
    AbstractionDevice* device;
    void* RelevantContext; //information related to device setup. these are mainly intermediates and are inaccessible.
    void* RelevantContext2;
    void* RelevantContext3;
    void* RelevantContext4;
    void* RelevantContext5;
    HGLRC hRC;
    HDC hDC;
    HINSTANCE hInstance;
};

Share this post


Link to post
Share on other sites
Advertisement
That code works just fine for me (Commenting out the DeviceCapabilities caps line and changine device to a void*). My guess is the problem is before that code - in the header previously included.

Share this post


Link to post
Share on other sites
Quote:
AbstractionHandle()
{
device = NULL;
APINumber = 0;
}
int APINumber; /* 0 - DX9, 1 - OpenGL */


Use an enum....

Also, the word abstract in names is redundant.

Handle *is* an abstraction of something.
Device *is* an abstraction of the device.

When you ask for a device, you may get DX device or OGL device or something else.

Quote:
void* RelevantContext; //information related to device setup. these are mainly intermediates and are inaccessible.

void* RelevantContext2;

void* RelevantContext3;

void* RelevantContext4;

void* RelevantContext5;


Use, at very least:
void * getContext(Contexts c);
where contexts is again an enum.

There is definitely a better solution to this, but given that functions don't carry any kind of meaning, it's impossible to tell what they do, or how to improve on the design.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!