FSCommand closewindow crashes the application

DLL Edition of the F-IN-BOX
Bikram Thapa
Posts: 29
Joined: Mon Nov 17, 2008 3:24 pm
Location: India

FSCommand closewindow crashes the application

Postby Bikram Thapa » Mon Nov 17, 2008 3:43 pm

Hi !
I am evaluating the f_in_box dll version. I have created a MFC application using the sample 4 translucency. I am using vs2005 without sp1. Every thing works well but the fs command onclose is generating run time exception in

strcore.cpp
void CAfxStringMgr::Free( CStringData* pData ) throw()
{
free(pData);
}

Thanks

Here is the Event Listener and other functions

Code: Select all

void WINAPI FPCAlertListener(HWND hwndFlashPlayerControl, LPARAM lParam, NMHDR* pNMHDR)
{   
   CMainFrame *pThis = (CMainFrame*)lParam;
   if(pThis == NULL) return;    
   switch (pNMHDR->code)  {

        case FPCN_FSCOMMAND: {

            SFPCFSCommandInfoStruct* pInfo = (SFPCFSCommandInfoStruct*)pNMHDR;
         CString cmdString(pInfo->command);   CString argList(pInfo->args);
         //MessageBox(NULL, pInfo->command, _T("FSCommand(): command"), MB_OK | MB_ICONINFORMATION);
            //MessageBox(NULL, pInfo->args, _T("FSCommand(): args"), MB_OK | MB_ICONINFORMATION);
         
         if((cmdString.CompareNoCase(_T("closewindow"))==0) || (cmdString.CompareNoCase(_T("closeself"))==0)) {
            for(int i=0; i < mycmdMap.GetCount(); i++)
            {
               if(myNewAlertMap[0].romName.CompareNoCase(mycmdMap[i].romName)==0 && mycmdMap[i].romMenuName == _T("Show Flash"))
               {   
                  ALERTCMDID = mycmdMap[i].cmdID;                  
                  myNewAlertMap[0].showStatus = false;
                  myNewAlertMap[0].shownStatus = true;
                        SendMessage(hwndFlashPlayerControl,WM_COMMAND, (WPARAM)ID_CLOSE,0);//Send close command to flash dialog window
                  return;
               }
            }
            return;
         }

////////////////

void CTransparentFlashPlayerControlWnd::OnClose()
{
if(myNewAlertMap.GetCount()>0){
         if(myNewAlertMap[0].shownStatus==true && myNewAlertMap[0].showStatus==false){
            myNewAlertMap.RemoveAt(0);            
            DestroyWindow();            
            return;            
         }
      }      
}



Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Mon Nov 17, 2008 3:52 pm

Thank you for your question.

Just one quick test: what if to change SendMessage to PostMessage?

Thank you.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

Bikram Thapa
Posts: 29
Joined: Mon Nov 17, 2008 3:24 pm
Location: India

Thanks

Postby Bikram Thapa » Tue Nov 18, 2008 5:24 am

Thanks it worked.

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Thu Nov 20, 2008 2:55 pm

The problem is one can't destroy a f-in-box window within a handler of a flash event. That's why PostMessage works well instead of SendMessage.

Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html


Return to “DLL Edition”

Who is online

Users browsing this forum: No registered users and 25 guests

cron