Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Knytestorme

DirectShow / C++ error (not sure which)

This topic is 6037 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

Hi all, just writing up an mp3 class to try to teach myself classes. The code works fine in C but I am getting this error on compilation in a C++ class
quote:
D:\Coding\projects\Aurora\Aurora_MP3.cpp(84) : error C2440: ''return'' : cannot convert from ''struct IBaseFilter *'' to ''struct IBaseFilter Aurora_MP3::*''
for the following code peice
IBaseFilter Aurora_MP3::*LoadMP3(LPCWSTR wszFilename)
{
	IBaseFilter *pSource;
	HRESULT		h;

    // Add the new source filter to the graph.
    h = g_pGraphBuilder->AddSourceFilter(wszFilename, wszFilename, &pSource);
	if (FAILED(h))
	{
		return NULL;
	}

	return pSource;
}
 
I know what the error is obviously, from the error message, but I''m not sure how to fix it. Is the answer to change the class type from IBaseFilter, to return something else altogether, or am I tiotally off base? Sorry if this is more a C++ question than DirectX, and guess it is since I got dshow working fine with some tute code, but had a 50/50 choice and took the more sensible one

Share this post


Link to post
Share on other sites
Advertisement
bah, that was what it was, thank you

Now I just have to go and read some more on C++ to cement in my mind why the pointer goes in front of the class name and not in front of the function like it does in C, rather than just shrugging and doing it that way from now on.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!