My app causes WordPad to hang

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 :

       ntdll.dll!_KiFastSystemCallRet@0()       
>      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?

XP SP3
Johnny_UnoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cupCommented:
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?
0
Johnny_UnoAuthor Commented:
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.
0
Johnny_UnoAuthor Commented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Johnny_UnoAuthor Commented:
No
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.