Pelles C forum

C language => Expert questions => Topic started by: misgana on November 11, 2010, 06:53:13 AM

Title: Building a win32 TAPI application
Post by: misgana on November 11, 2010, 06:53:13 AM

  Hello , I was planning to develope a TAPI application,and i downloaded small code from msdn,then i added the uuid.lib to my linker and tapi3.dll ;but my small code failed at compile time.please is there anyone that could  help me with my problem?
#include<tapi.h>
#include<windows.h>

int main(){
// Initialize COM.
HRESULT hr = CoInitializeEx(
     NULL,
     COINIT_MULTITHREADED
     );
// If (hr != S_OK) process the error here. 

// Create a TAPI entry point object.
ITTAPI *gpTapi;    // globally allocated
hr = CoCreateInstance(
     CLSID_TAPI,
     NULL,
     CLSCTX_INPROC_SERVER,
     IID_ITTAPI,
     (LPVOID *)&gpTapi
     );
// If (hr != S_OK) process the error here. 

// Initialize TAPI.
hr = gpTapi->Initialize();
// If (hr != S_OK) process the error here.

   return 0;
}

Building checkTapi.obj.
C:\Documents and Settings\MOON\My Documents\Pelles C Projects\winNetwork2\checkTapi.c(12): error #2048: Undeclared identifier 'ITTAPI'.
C:\Documents and Settings\MOON\My Documents\Pelles C Projects\winNetwork2\checkTapi.c(12): error #2048: Undeclared identifier 'gpTapi'.
C:\Documents and Settings\MOON\My Documents\Pelles C Projects\winNetwork2\checkTapi.c(14): error #2048: Undeclared identifier 'CLSID_TAPI'.
C:\Documents and Settings\MOON\My Documents\Pelles C Projects\winNetwork2\checkTapi.c(14): error #2140: Type error in argument 1 to 'CoCreateInstance'; expected 'LPCGUID const' but found 'int'.
C:\Documents and Settings\MOON\My Documents\Pelles C Projects\winNetwork2\checkTapi.c(17): error #2048: Undeclared identifier 'IID_ITTAPI'.
C:\Documents and Settings\MOON\My Documents\Pelles C Projects\winNetwork2\checkTapi.c(17): error #2140: Type error in argument 4 to 'CoCreateInstance'; expected 'LPCGUID const' but found 'int'.
C:\Documents and Settings\MOON\My Documents\Pelles C Projects\winNetwork2\checkTapi.c(23): error #2112: Left operand of '->' has incompatible type 'int'.
C:\Documents and Settings\MOON\My Documents\Pelles C Projects\winNetwork2\checkTapi.c(23): error #2068: Expected a function but found 'int'.
C:\Documents and Settings\MOON\My Documents\Pelles C Projects\winNetwork2\checkTapi.c(23): error #2168: Operands of '=' have incompatible types 'long int' and 'void'.
*** Error code: 1 ***
Done.
Title: Re: Building a win32 TAPI application
Post by: frankie on November 11, 2010, 12:50:43 PM
To compile you need the include "tapi3.h" which is not present in PellesC distribution. You can get it from msdn downloading the last SDK.