Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In a C++ Implementation of DirectShow, I have added two graphs the the Graph Manager (response checks removed for simplicity). When I try to connect them using ConnectDirect and I get a "E_POINTER Invalid Pointer as a result". What am I doing wrong?

	CComPtr<IBaseFilter> peconsCX3RDKwithOV5640;
	hr = peconsCX3RDKwithOV5640.CoCreateInstance(CLSID_econsCX3RDKwithOV5640);
	hr = pGraph->AddFilter(peconsCX3RDKwithOV5640, L"e-con's CX3 RDK with OV5640");

	CComPtr<IBaseFilter> pAVIDecompressor;
	hr = pAVIDecompressor.CoCreateInstance(CLSID_AVIDec);
	hr = pGraph->AddFilter(pAVIDecompressor, L"AVI Decompressor");

// ConnectDirect give an Invalid pointer response
	hr = pGraph->ConnectDirect(GetPin(peconsCX3RDKwithOV5640, L"Capture"), GetPin(pAVIDecompressor, L"XForm In"), NULL);


What I have tried:

I used GraphEdit for the model,and it works correctly. I verified the designations pin are correct and tried putting an underscore (_) between XForm and In (XForm_In). I have checked and re-checked the syntax and cannot see my mistake.
Posted
Updated 23-Oct-17 20:25pm
v2

1 solution

COM is weired, but the errors are helping you. Your message means that the input pointer is invalid or not correct for the desired action.

Are you sure, that all calls before are OK. I dont like the line
hr = pGraph->AddFilter(peconsCX3RDKwithOV5640,"e-con's CX3 RDK with OV5640");
And split the ConnectDirect call to check the GetPin calls at first. Maybe they are the source of your problem.

Separate the code and check all results.
 
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