My app causes WordPad to hang

Posted on 2013-08-29
Medium Priority
Last Modified: 2013-09-09
When I run my server app it causes WorkPad to hang when you attempt to insert an object.  When I attach a debugger it tells me that WordPad is deadlocked.  The stack trace shows :

>      user32.dll!_NtUserMessageCall@28()  + 0xc bytes      
       ole32.dll!wInitiate()  + 0x3e bytes      
       ole32.dll!CDdeObject::CProxyManagerImpl::Connect()  + 0x5f bytes      
       ole32.dll!CDdeObject::DocumentLevelConnect()  + 0x3f bytes      
       ole32.dll!DdeBindToObject()  + 0xde bytes      
       ole32.dll!CPackagerMoniker::BindToObject()  + 0xc7 bytes      
       ole32.dll!_BindMoniker@16()  + 0x60 bytes      
       ole32.dll!wCreateFromFileEx()  + 0x1f bytes      
       ole32.dll!_OleCreateFromFileEx@52()  + 0xfb bytes      
       ole32.dll!_OleCreateFromFile@32()  + 0x45 bytes      
       mfc42u.dll!COleClientItem::CreateFromFile()  + 0x54 bytes      
       mfc42u.dll!COleInsertDialog::CreateItem()  + 0x48 bytes      
       wordpad.exe!CRichEdit2View::OnInsertObject()  + 0x8a bytes      
       wordpad.exe!CWordPadView::OnInsertObject()  + 0x1b bytes      
       mfc42u.dll!_AfxDispatchCmdMsg()  + 0x80 bytes      
       mfc42u.dll!CCmdTarget::OnCmdMsg()  + 0x108 bytes      
       mfc42u.dll!CView::OnCmdMsg()  + 0x20 bytes      
       mfc42u.dll!CFrameWnd::OnCmdMsg()  + 0x37 bytes      
       mfc42u.dll!CWnd::OnCommand()  + 0x51 bytes      
       mfc42u.dll!CFrameWnd::OnCommand()  + 0x71 bytes      
       mfc42u.dll!CWnd::OnWndMsg()  + 0x2f bytes      
       mfc42u.dll!CWnd::WindowProc()  + 0x22 bytes      
       mfc42u.dll!AfxCallWndProc()  + 0x91 bytes      
       mfc42u.dll!AfxWndProc()  + 0x34 bytes      
       mfc42u.dll!AfxWndProcBase()  + 0x39 bytes      
       user32.dll!_InternalCallWinProc@20()  + 0x28 bytes      
       user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7 bytes      
       user32.dll!_DispatchMessageWorker@8()  + 0xdc bytes      
       user32.dll!_DispatchMessageW@4()  + 0xf bytes      
       mfc42u.dll!CWinThread::PumpMessage()  + 0x3a bytes      
       mfc42u.dll!CWinThread::Run()  + 0x46 bytes      
       mfc42u.dll!AfxWinMain()  + 0x68 bytes      
       wordpad.exe!_wWinMainCRTStartup()  + 0x198 bytes      
       kernel32.dll!_BaseProcessStart@4()  + 0x23 bytes      

My app is dialog based.  I have stepped thru my code and the problem first occurs when InitDialog runs.  My code is not doing anything at all.  Just basic Windows init.  If I terminate my app then WordPad resumes and the object is inserted.  What can my app be doing to cause this?

Question by:Johnny_Uno
  • 3
LVL 11

Expert Comment

ID: 39453381
If I terminate my app then WordPad resumes and the object is inserted.

What object are you trying to insert into wordpad and how are you doing it?

Author Comment

ID: 39460472
From the Wordpad Insert menu I select Insert Object and insert any text file.  

I think my app must have an OLE server half-way implemented and it does not respond with the required ACK.  I inherited this app so I am not trying to implement an OLE server.  My server is TCP based.  I am not OLE aware myself so I do not see evidence that there is an OLE server in my app.

Accepted Solution

Johnny_Uno earned 0 total points
ID: 39464163
I solved this problem.  A thread in the program uses CAsyncSocket.  Somehow this interfered with OLE windows messages.  I replaced CAsyncSocket with Berkley sockets and it works now.

Author Closing Comment

ID: 39475776

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question