muze 0 Junior Poster in Training

hello guys...im writing simple TAPI app which, if I call to my landline number, prints the message.If you need variable declarations and initialization, I"ll give, but i know they are fine. This code should work but it does't, everything looks fine here...:confused:

void WINAPI TapiInitialize() {
	LPLINEDEVCAPS lineDevCaps = NULL;
	lineDevCaps = (LPLINEDEVCAPS)LocalAlloc(LPTR, 4096);

	lineCallStatus = NULL;
	lineCallStatus = (LPLINECALLSTATUS)LocalAlloc(LPTR,4096);

	
	//create the event first..
	EventReply = CreateEvent(NULL,FALSE,FALSE,NULL);

	//clear the structure before the usage
	memset(&LineInitializeExParams,0,sizeof(LINEINITIALIZEEXPARAMS));

	//populate the options
	LineInitializeExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS);
	LineInitializeExParams.dwOptions = LINEINITIALIZEEXOPTION_USEEVENT;

	//call the LineInitializeEx function
	result = lineInitializeEx(&lineApp,NULL,(LINECALLBACK)lineCallbackFunc,NULL,&numDevs,&tapiVersion,NULL);
	if (result!=0)	
		printf("TAPI could't be Initialized"); 
	else printf("\n\nTAPI Initialized..");

	num = numDevs;
	printf("\nNumber of lines available to this app:  %d",(LPWSTR)num);
	result = lineNegotiateAPIVersion(lineApp,0,API_EARLY_VERSION,API_CURRENT_VERSION,&tapiVersion,0);
	result = lineGetDevCaps(lineApp,0,tapiVersion,0,lineDevCaps);

	//opening a line
	result = lineOpen(lineApp,0,&hLine,tapiVersion,0,0,LINECALLPRIVILEGE_MONITOR,LINEMEDIAMODE_DATAMODEM,NULL);
	if(result!=0)
		printf("\n\nLINE could't be Opened...");
	else
		printf("\n\nLINE Opened...");

	result = lineGetStatusMessages(hLine,&lineStatus,&addressStatus);
	if(result==0)
		printf("\n\nGetting line status...");
	else printf("\nError: Line status not getting...");
}

VOID CALLBACK lineCallbackFunc(DWORD hDevice,DWORD dwMsg, DWORD Param1, DWORD Param2, DWORD Param3) {
		printf("\nIncomg Line...");
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.