News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

sapi

Started by loki_dre, January 14, 2009, 06:59:57 PM

Previous topic - Next topic

loki_dre

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;
}

askm

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