FaxInitializeEvent

  • Thread starter Thread starter Srini
  • Start date Start date
S

Srini

Hi All,

I am developing a component as a dll to send faxes using WinFax.
I am using win2000 professional. I am developing the component using VC++.

the problem with FaxInitializeEventQueue(). Here is the code
STDMETHODIMP CFax::InitializeFax()
{
if(!FaxConnectFaxServer(NULL,&fHandle))
{
return E_FAIL;
}

FaxEnumPorts(fHandle,&portInfo,&nPorts);

if(!FaxOpenPort(fHandle,portInfo->DeviceId,PORT_OPEN_QUERY,&portHandle))


return E_FAIL;
}

hCompletionPort =
CreateIoCompletionPort(INVALID_HANDLE_VALUE,NULL,NULL,0);

if(!FaxInitializeEventQueue(fHandle,hCompletionPort,NULL,NULL,WM_USER+1 ))


return E_FAIL;
}
}
STDMETHODIMP CFax::UnInitializeFax()
{
Closing all Handles here.
}

I am using this dll in VB. In that two buttons are there one is StartFax,
other is EndFax
In StartFax Button I am calling InitializeFax() method of my component, and
UnInitializeFax() on EndFax.
when I press StartFax button for the first time it works fine.Then If I
press StartFax button after pressing the EndFax button,
FaxInitializeEventQueue() method fails.Why?

I am very badly in need of it.
plz help me in this regard.

Thanks & Regards
Srinivas
 
Srini said:
In StartFax Button I am calling InitializeFax() method of my component, and
UnInitializeFax() on EndFax.
when I press StartFax button for the first time it works fine.Then If I
press StartFax button after pressing the EndFax button,
FaxInitializeEventQueue() method fails.Why?
Which FaxXXX call fails the second time? What is returned by
GetLastError at that point? Do you receive FEI_FAXSVC_ENDED
event between Start and End button clicks?
 
Back
Top