Page 1 of 1

Can someone please give me an idea about what an IID is?

Posted: Tue Nov 08, 2011 6:43 pm
by JustinJack
I am trying to get this to work so I'll have a better understanding of how COM objects work.
I'm not exactly sure what a CLSID is, although I know i can find them in the registry under "Classes", so I assume it's an identifier for the class....
I don't know what and IID_... is or why it's necessary. All the other parameters of CoCreateInstance I understand fine.

Code: Select all

Interface SpVoice
  DisplayUI( hWndParent, Title, TypeOfUI, ExtraData = 0)
  GetAudioOutputs()
  GetVoices()
  IsUISupported()
  Pause()
  Resume() 
  Skip()
  Speak( Text, Flags = 0)
  SpeakCompleteEvent()
  SpeakStream()
  WaitUntilDone()
EndInterface

Enumeration
  #CLSCTX_INPROC_SERVER            = $1
  #CLSCTX_INPROC_HANDLER           = $2
  #CLSCTX_LOCAL_SERVER             = $4
  #CLSCTX_INPROC_SERVER16          = $8
  #CLSCTX_REMOTE_SERVER            = $10
  #CLSCTX_INPROC_HANDLER16         = $20
  #CLSCTX_RESERVED1                = $40
  #CLSCTX_RESERVED2                = $80
  #CLSCTX_RESERVED3                = $100
  #CLSCTX_RESERVED4                = $200
  #CLSCTX_NO_CODE_DOWNLOAD         = $400
  #CLSCTX_RESERVED5                = $800
  #CLSCTX_NO_CUSTOM_MARSHAL        = $1000
  #CLSCTX_ENABLE_CODE_DOWNLOAD     = $2000
  #CLSCTX_NO_FAILURE_LOG           = $4000
  #CLSCTX_DISABLE_AAA              = $8000
  #CLSCTX_ENABLE_AAA               = $10000
  #CLSCTX_FROM_DEFAULT_CONTEXT     = $20000
  #CLSCTX_ACTIVATE_32_BIT_SERVER   = $40000
  #CLSCTX_ACTIVATE_64_BIT_SERVER   = $80000
  #CLSCTX_ENABLE_CLOAKING          = $100000
  #CLSCTX_PS_DLL                   = $80000000   
EndEnumeration



CoInitialize_(0);




spvCLSID.s = "96749377-3391-11D2-9EE3-00C04F797396"
spvIID.s = ""

UuidFromString_(spvCLSID, @spVoiceCLSID.CLSID)
IIDFromString_(spvIID, @spVoiceIID.IID)


*lpSvo.SpVoice
hResult = CoCreateInstance_(@spVoiceCLSID, #Null, #CLSCTX_INPROC_SERVER, @spvIID, @*lpSvo)
Debug hResult

CoUninitialize_();
I just can't find the IID_... of IID_ISpVoice anywhere.
I mean. I must be missing something, Isn't there some easy place to find this stuff so as long as you know what objects you're trying to use you can find them quickly? Any help would be greatly appreciated.

Re: Can someone please give me an idea about what an IID is?

Posted: Tue Nov 08, 2011 7:27 pm
by DarkDragon
It is defined in some sources in the windows platform sdk and it is exported in one of the libraries IIRC.

IID = Interface Identifier
CLSID = Class Identifier