The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: loki_dre on January 14, 2009, 06:59:57 PM

Title: sapi
Post by: loki_dre on January 14, 2009, 06:59:57 PM
can someone please translate the following C++ code:

#include "stdafx.h"
#include <sapi.h>
int _tmain(int argc, _TCHAR* argv[])
{

   ISpVoice * pVoice = NULL;

    if (FAILED(CoInitialize(NULL)))
   {
//      AfxMessageBox("Error to intiliaze COM");
        return 1;
   }

    HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice);
    if( SUCCEEDED( hr ) )
    {
        hr = pVoice->Speak(argv[1], 0, NULL);
        pVoice->Release();
        pVoice = NULL;
    }

    CoUninitialize();
   return 0;
}
Title: Re: sapi
Post by: askm on January 14, 2009, 08:13:20 PM
Meanwhile, away from Crawford Texas ranch...

There are plenty bits in the examples folder of the current download.

However the "Ernest Murphy" COM examples ? The earlier download.

Example:
; MakeLink.asm ActiveX simple client to demonstrate basic concepts
;               written & (c) copyright April 5, 2000 by Ernest Murphy
;from
    invoke CoInitialize, NULL
    MakeMessage "Let's try our Createlink."
    invoke CoCreateLink, ADDR szBuffer1, ADDR szBuffer2
    MakeMessage "That's all folks !!!"
    invoke CoUninitialize

Tried this link, not a bum steer at this ranch:

http://ourworld.compuserve.com/homepages/ernies_world/a.htm