Click here to Skip to main content
15,914,163 members
Home / Discussions / COM
   

COM

 
QuestionHelp needed [ Problem in IDispatch::GetTypeInfo] Pin
mvkvibin11-Nov-08 19:13
mvkvibin11-Nov-08 19:13 
AnswerRe: Help needed [ Problem in IDispatch::GetTypeInfo] Pin
Vi213-Nov-08 1:38
Vi213-Nov-08 1:38 
GeneralRe: Help needed [ Problem in IDispatch::GetTypeInfo] Pin
mvkvibin13-Nov-08 22:14
mvkvibin13-Nov-08 22:14 
QuestionNeed to have a ClassFactory Pin
ShyamR11-Nov-08 18:44
ShyamR11-Nov-08 18:44 
QuestionReg:Output from Exe Method call Pin
swethasri11-Nov-08 18:13
swethasri11-Nov-08 18:13 
QuestionHow to retrieve document content or whole document on DocumentOpen Event Word Add-in Pin
PatilVijay9-Nov-08 19:49
PatilVijay9-Nov-08 19:49 
QuestionHow do you create and work a proxy used to Marshal an interface? (An IDropTarget to be precise) Pin
Code-o-mat9-Nov-08 11:11
Code-o-mat9-Nov-08 11:11 
QuestionError message "Overlapped I/O operation is in progress" Pin
Member 14340936-Nov-08 2:42
Member 14340936-Nov-08 2:42 
Hi there,

I have a strange error message that I would like to submit to you hoping you can help.

I have an MFC C++ application which communicates with a second MFC application through OLE Automation. This second application has a loop which constantly communicates with a hardware device through the serial port of the computer and updates some of its member variables reflecting the state of the hardware. The main application has a timer that periodically checks the values of the variables of the second application through OLE Automation.

My problem is that every now and then, apparently in a random fashion, I get the following error message "Overlapped I/O operation is in progress". If I close this message, it comes back up again almost immediately.

This is a rather generic message but I suspect it has something to do with my OLE communication. Does anyone have an idea? When that error occurs, the second application is still running fine and communicating fine with the hardware so I guess the serial communication is not the origin of the problem.

Could it be an issue linked to the lifetime of the handle on the OLE object?

In case that helps, here is how I start the second application from within the first one through OLE:

int CRXGemApp::StartRemoteApplication(void)
{
	if(m_RemoteApp != NULL)
		return 0;

	if(m_RemoteApp == NULL)
	{
		m_RemoteApp = new CRXMFX();

             		// Start Application and get Application object...
	        	COleException e;

       		 if(!m_RemoteApp->CreateDispatch("REMOTEAPP.Application", &e))
       		 {
			AddToErrorLog("could not startthe Application");
			delete m_RemoteApp;
			m_RemoteApp = NULL;
			return -1; //Application error return -1
       		 }

		// Make the server visible through automation.
		// i.e.: Application.Visible = TRUE
		DISPID dispID;
//		unsigned short *ucPtr;
		BYTE *parmStr;
//		ucPtr = L"visible";
		CString cx = "visible";
		BSTR szMember = cx.AllocSysString();
		m_RemoteApp->m_lpDispatch->GetIDsOfNames( IID_NULL, &szMember, 1, LOCALE_USER_DEFAULT, &dispID );
		::SysFreeString(szMember);
		parmStr = (BYTE *)( VTS_VARIANT );
	}		

	//Initialisation of the hardware is done in REMOTEAPP OnInitDlg() and is thus automatically called

	//Check that the communication works
	int Timeout = 5; //Timeout in seconds
	int IncTime = 1000; //increment in millisec = freqency of GetStatus Call
	CChrono Chrono;
	Chrono.InitChrono();
	Chrono.StartChrono();
	double t = 0.0f;
	while(m_RemoteApp->GetStatus() < 0 && t < Timeout) //wait 5 secs for the Status Ready
	{
		//Sleep(IncTime);
		//Timeout+=IncTime;
		Chrono.DureeChrono(t);
	}
	
	if (m_RemoteApp->GetStatus() < 0)// Communication failed
	{
		StopRemoteApplication();
		AddToErrorLog("Communication error with the hardware.");
		return -2; //Communication Error return -2
	}

	return 1;
}

AnswerRe: Error message "Overlapped I/O operation is in progress" Pin
Randor 9-Nov-08 21:48
professional Randor 9-Nov-08 21:48 
QuestionSerial Port Simulation Pin
pierrecor5-Nov-08 21:40
pierrecor5-Nov-08 21:40 
AnswerRe: Serial Port Simulation Pin
Roger Stoltz5-Nov-08 22:05
Roger Stoltz5-Nov-08 22:05 
QuestionOutlook Addin Pin
Member 36453113-Nov-08 6:03
Member 36453113-Nov-08 6:03 
AnswerRe: Outlook Addin Pin
Rajasekharan Vengalil4-Nov-08 10:19
Rajasekharan Vengalil4-Nov-08 10:19 
AnswerRe: Outlook Addin Pin
Randor 5-Nov-08 10:30
professional Randor 5-Nov-08 10:30 
QuestionNot sure how to do this(or if you can), COM object and vb6 and c++ stuff Pin
Matthew Cash1-Nov-08 11:42
Matthew Cash1-Nov-08 11:42 
AnswerRe: Not sure how to do this(or if you can), COM object and vb6 and c++ stuff Pin
Rajasekharan Vengalil4-Nov-08 10:15
Rajasekharan Vengalil4-Nov-08 10:15 
GeneralRe: Not sure how to do this(or if you can), COM object and vb6 and c++ stuff Pin
Matthew Cash4-Nov-08 18:48
Matthew Cash4-Nov-08 18:48 
QuestionCOM/DCOM singleton behavior not working [modified] Pin
ToriHino200830-Oct-08 11:31
ToriHino200830-Oct-08 11:31 
Questionbatch file writting commands Pin
coloradopad28-Oct-08 17:57
coloradopad28-Oct-08 17:57 
QuestionISpoolerHook Pin
Dr. Kelwin28-Oct-08 14:47
Dr. Kelwin28-Oct-08 14:47 
QuestionEditable datagrid validation. Pin
udaykatakam27-Oct-08 9:36
udaykatakam27-Oct-08 9:36 
QuestionHow to regsvr32 ***.ocx successful? Pin
huangdingjun25-Oct-08 16:29
huangdingjun25-Oct-08 16:29 
AnswerRe: How to regsvr32 ***.ocx successful? Pin
Wes Aday25-Oct-08 19:00
professionalWes Aday25-Oct-08 19:00 
GeneralRe: How to regsvr32 ***.ocx successful? Pin
huangdingjun27-Oct-08 1:26
huangdingjun27-Oct-08 1:26 
GeneralRe: How to regsvr32 ***.ocx successful? Pin
Rajasekharan Vengalil4-Nov-08 9:29
Rajasekharan Vengalil4-Nov-08 9:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.