External Interface Fails in MFC Unicode Application

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

External Interface Fails in MFC Unicode Application

Postby Bikram Thapa » Thu Jan 15, 2009 2:23 pm

Hi Support,
I am having a MFC application in Unicode.

My following call is failing

Code: Select all

LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{   
   if (WM_NOTIFY == message)
    {
        LPNMHDR lpNMHDR = (LPNMHDR)lParam;
      switch (lpNMHDR->code) {
         case FPCN_FLASHCALL: {
            SFPCFlashCallInfoStruct* pInfo = (SFPCFlashCallInfoStruct*)lParam;
            CString xmlStrResult,xmlStrReturned;
            xmlStrResult = pInfo->request;
            ....

            xmlStrReturned = _T("<invoke name='SetPath' returntype='xml'><arguments><string>C:\Documents and Settings\cipl\Application Data\APP\data\ccc\content\df731222-57a8-49b7-a9a1-8f3b2f17e47c.flv</string></arguments></invoke>");
            FPCSetReturnValue(myflashMap[i].m_hwndFlashPlayerControl,xmlStrReturned.GetBuffer(xmlStrReturned.GetLength()));

                  break;
               }
            }
            return CFrameWnd::WindowProc(message, wParam, lParam);                                                         
         } // case flashcall
      } // switch ends
   }
   return CFrameWnd::WindowProc(message, wParam, lParam);
}



The xml string sent to flash fails.

Regards
Bikram

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

Postby Softanics » Thu Jan 15, 2009 8:09 pm

Thank you for your question.

What if you change character settings to ANSI?

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

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

Postby Softanics » Thu Jan 15, 2009 8:26 pm

BTW, you should replace each '\' with '\\' of xmlStrReturned...
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

No it did not work

Postby Bikram Thapa » Tue Jan 20, 2009 3:57 pm

Hi Support,
I did put extra '\' in the above code, but still no luck. The same xml string works in .net edition. I did to run the MFC Sample provided for external interface in Unicode and it works.
Do I need to do any thing differently.
Please guide.

Thanks and Regards
Bikram

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

Postby Softanics » Tue Jan 20, 2009 4:12 pm

What if to change:

Code: Select all

FPCSetReturnValue(myflashMap[i].m_hwndFlashPlayerControl,xmlStrReturned.GetBuffer(xmlStrReturned.GetLength()));


into

Code: Select all

FPCSetReturnValue(myflashMap[i].m_hwndFlashPlayerControl, (LPCWSTR)xmlStrReturned);


?

Thank you.[/quote]
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

Postby Bikram Thapa » Wed Jan 21, 2009 7:16 am

Hi Support,
No luck with following change either,

FPCSetReturnValue(myflashMap[i].m_hwndFlashPlayerControl, (LPCWSTR)xmlStrReturned);

I tried to extend MFC Sample sample4 this way

Code: Select all

//MemberAdded To TransparentFlashPlayerControlWnd.h
public:   
   HWND m_hwndFlashPlayerControl;


Changes in Sample04_Translucency.cpp

Code: Select all

pFlashProjectorWnd->hwndFlashPlayerControl = hwndFlashPlayerControl;
.....................
FPC_LoadMovie(hwndFlashPlayerControl,0,_T("c:\\main.swf"));


Changes in TransparentFlashPlayerControlWnd.cpp

Code: Select all

LRESULT CTransparentFlashPlayerControlWnd::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
   switch (message)
   {
      case WM_NOTIFY:
      {
         LPNMHDR lpNMHDR = (LPNMHDR)lParam;
         if (hwndFlashPlayerControl == lpNMHDR->hwndFrom)
         {
            switch (lpNMHDR->code)
            {
               case FPCN_FLASHCALL:
                  SFPCFlashCallInfoStruct* pInfo = (SFPCFlashCallInfoStruct*)lParam;
                  CString xmlStrResult,xmlStrReturned,romName;
                  xmlStrResult = pInfo->request;                     
                  FPCSetReturnValue(hwndFlashPlayerControl,_T("<invoke name=\"SetPath\" returntype=\"xml\"><arguments><string>C:\\b1fd4eb0-6db9-4810-a3cb-0063700cd0af.flv</string></arguments></invoke>"));
                  break;
            }
         }
         break;
      }
......................


The Application does not enter the WM_NOTIFY section.
I can provide you the main.swf file. this file first makes an external api request and then simply shows back the data send through FPCSetReturnValue(), in message box.
To which email ID should I send the testing main.swf file.[/code]

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

Postby Softanics » Wed Jan 21, 2009 8:38 am

Bikram Thapa wrote:The Application does not enter the WM_NOTIFY section.


WM_NOTIFY is sending to a parent window of a f-in-box control, not to the f-in-box window.

Bikram Thapa wrote:I can provide you the main.swf file. this file first makes an external api request and then simply shows back the data send through FPCSetReturnValue(), in message box.
To which email ID should I send the testing main.swf file.[/code]


support (at) f-in-box.com

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

Test swf file sent thru email

Postby Bikram Thapa » Wed Jan 21, 2009 9:54 am

I have sent an email attaching the test swf file.
Thanks
Bikram

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

Any luck with test swf file

Postby Bikram Thapa » Wed Jan 28, 2009 2:42 pm

Hi Support,
I had emailed, the test swf file. Where you able to run the fs external interface.

Regards
Bikram Thapa

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

Postby Softanics » Wed Jan 28, 2009 2:58 pm

Sorry for the delay.

What I can't undestand is why do you use "<invoke>...</invoke>" as a return value (btw, I've just tried it and FPCSetReturnValue returns S_OK). Usually, if you want return, for example, a string you use something like that:

Code: Select all

FPCSetReturnValue(m_hwndFlashPlayerControl, _T("<string>tratata</string>"))


Can it be a problem?

What does FPCSetReturnValue return in your test?

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

No it did not work

Postby Bikram Thapa » Thu Feb 05, 2009 10:31 am

Hi,

Sorry for the delay in replying; had been busy with other issues. I did try to do what you suggested, but no success. Though the function returns S_OK, no movie is played nor any response from flash movie.(the dot net code works fine.) I will email you the screen shot of what is shown, when a successful request is made.

Regards
Bikram.

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

Waiting for response

Postby Bikram Thapa » Mon Feb 09, 2009 5:24 am

Hi Support,
I had emailed the main.swf file, and then a screen shot of what main.swf shows as output. Where you able to run it successfully?

Thanks and Regards
Bikram...

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

Postby Softanics » Mon Feb 09, 2009 7:20 am

I've just emailed you.

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

Test MFC Project sent thru email

Postby Bikram Thapa » Wed Feb 11, 2009 5:02 am

Hi Artem,
I have sent the mfc test project, please try at your end.
Thanks and Regards
Bikram

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

MFC test solution for testing external api

Postby Bikram Thapa » Tue Feb 17, 2009 7:54 am

Hi Artem,
Any luck with the mfc test project, I had sent earlier?
Thank you
Bikram


Return to “DLL Edition”

Who is online

Users browsing this forum: No registered users and 12 guests