add ATL support to your MFC project
http://www.codeguru.com/atl/mfcatl.shtml
then you create mscomm control by ATL, refer to the following technic of creating mswinsck.ocx control
#import "c:\winnt\system32\mswinsck.ocx" no_namespace
...
IMSWinsockControlPtr pWinsock;
_bstr_t pstr("mswinsock.winsock");
CLSID clsidwinsock;
CLSIDFromProgID(pstr,&clsidwinsock);
pWinsock.CreateInstance(clsidwinsock);
if(pWinsock)
{
pWinsock->RemotePort=13;
pWinsock->RemoteHost=_bstr_t("time-a.nist.gov");
_variant_t varoptional((long)DISP_E_PARAMNOTFOUND,VT_ERROR);
HRESULT hr= pWinsock->Connect();
if(FAILED(hr))
MessageBox(NULL,"failed","failed",MB_OK);
......
pWinsock->Close();
}
else
MessageBox(NULL,"can not create winsock","error",MB_OK);