Checking the return values
How can I check the return value of a function and then send it into another function.
Code:
#include "global.h"
ISpVoice * mainVoice = NULL;
int main()
{
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&mainVoice);
if( SUCCEEDED( hr ) )
{
//Start Essential Processes
hr = mainVoice->Speak(L"Start Up. Initiated.", 0, NULL);
Boot_Up();
//Choose User-Mode
hr = mainVoice->Speak(L"Selecting User Mode.",0, NULL);
User_Mode();
//Start the Main Loop
hr = mainVoice->Speak(L"Entering Main Loop.",0, NULL);
M_Dogma(User_Mode());
//Clean Up and Shutdown
mainVoice->Release();
mainVoice = NULL;
}
CoUninitialize();
Shutdown(M_Dogma(User_Mode()));
return COMPLETE;
}
I want to send the return value of User_Mode() into M_Dogma(). Then I want to send the return value of M_Dogma() into Shutdown().