loading .swf into dll

DLL Edition of the F-IN-BOX
Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Fri Jul 04, 2008 4:25 pm

tmillhouse@gmail.com wrote:I guess another question I could ask to help solve the problem is: where is m_hWnd defined?


It's a member field of CWnd.

You should pass parent window handle. If you use WS_CHILD, parent window is necessary.

tmillhouse@gmail.com wrote:In my code, I put NULL. Could this be a possible reason?


Yes, I think it's a reason!
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

tmillhouse@gmail.com
Posts: 29
Joined: Wed Jul 02, 2008 5:54 pm

Postby tmillhouse@gmail.com » Fri Jul 04, 2008 4:45 pm

Using '%d' I'm still getting:

[1396] ????????

This is the exact line:

sprintf(msgbuf, "Error [err=%d]\n", GetLastError());
OutputDebugString(msgbuf);

[/quote]

tmillhouse@gmail.com
Posts: 29
Joined: Wed Jul 02, 2008 5:54 pm

Postby tmillhouse@gmail.com » Fri Jul 04, 2008 4:59 pm

I changed my create window to the following and it is no longer null; however, it still does not seem to be working properly. My .swf initialization code should invoke my AIR file upon initialization, but it doesn't seem to be doing anything. I think if I can get my GetLastError formatted correctly to the debug console, I'll be in a position to debug this. Also, Thanks again for your feedback.

FPC_CreateWindow(m_hFPC,
0,
NULL,
NULL,
0,
0,
0,
0,
NULL,
NULL,
NULL,
NULL);

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

Postby Softanics » Sat Jul 05, 2008 4:20 pm

tmillhouse@gmail.com wrote:I changed my create window to the following and it is no longer null; however, it still does not seem to be working properly.


Could you please try create new thread and create the window inside it. Also include standard GetMessage / DispatchMessage cycle.

Also you can send me all SWF files to support (at) f-in-box.com and I will try to create a demo for you.

Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

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

tmillhouse@gmail.com
Posts: 29
Joined: Wed Jul 02, 2008 5:54 pm

Postby tmillhouse@gmail.com » Sat Jul 05, 2008 4:48 pm

I'll do that now.

In the meantime, I was able to print out the last error to the system debugger using TCHAR and wspringf. Directly after the create window call, I'm receiving an error code of 126. I looked this up on msdn and it is

"ERROR_MOD_NOT_FOUND
126
0x7E
The specified module could not be found."

Are you familiar with this error at this location? I also printed out the last error after calling the FPC_LoadMovie and the code was 0.

Thanks,
Tim

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

Postby Softanics » Sat Jul 05, 2008 5:21 pm

tmillhouse@gmail.com wrote:Directly after the create window call, I'm receiving an error code of 126.


But you create window successfully now, so we don't need GetLastError() more... right?
Best regards, Artem A. Razin,

F-IN-BOX support

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

tmillhouse@gmail.com
Posts: 29
Joined: Wed Jul 02, 2008 5:54 pm

Postby tmillhouse@gmail.com » Sat Jul 05, 2008 5:59 pm

Well I know that it is instantiating the hwnd to some extent since it is not null after calling FPC_CreateWindow;however, why would there be an error afterwards? It leads me to believe that there is still something wrong with the initialization of the hwnd.

When I call loadMovie, there is no error code, but I'm certain that it is not loading properly b/c of the .swf's initialization code. When the .swf loads, it should call my AIR file. Here is my .swf file code:

import flash.external.*;

// prepare the sending connection ---
_sendConn = new LocalConnection();
_sendConn.allowDomain('*');


_sendConn.send('connA', 'methodToCalll', 'this is a test message to test initialization');

ExternalInterface.addCallback("sendURL", this, sendURL);

function sendURL(url:String):void{
_sendConn.send('connA', 'processUrl', url);
}


As you can see, upon initialization, the .swf should execute the _sendConn.send('connA', 'methodToCalll', 'this is a test message to test initialization');

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

Postby Softanics » Sat Jul 05, 2008 6:04 pm

OK... what's value FPCCallFunction returns?
Best regards, Artem A. Razin,

F-IN-BOX support

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

tmillhouse@gmail.com
Posts: 29
Joined: Wed Jul 02, 2008 5:54 pm

Postby tmillhouse@gmail.com » Sat Jul 05, 2008 6:24 pm

FPCCallFunctionBSTR == S_OK

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

Postby Softanics » Sun Jul 06, 2008 9:33 am

What if to place the same code into usual windows application? The same result?
Best regards, Artem A. Razin,

F-IN-BOX support

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

tmillhouse@gmail.com
Posts: 29
Joined: Wed Jul 02, 2008 5:54 pm

Postby tmillhouse@gmail.com » Mon Jul 07, 2008 6:08 pm

I'm downloading VS express right now to try it out. I was using Borland's C++ compiler to compile my DLL code, but since the example is using MFC, I'll need it.

In the meantime, I've been reviewing the example source code and there is a couple of initialization calls, AfxEnableControlContainer() being one of them. Are these required to load .swf movies. Currently, I have my initialization in the DLLMain method under case ATTACH.

Would this be a problem? After VS finishes installation, I'll build your example with my .swf and test.

Thanks,
Tim

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

Postby Softanics » Mon Jul 07, 2008 8:02 pm

tmillhouse@gmail.com wrote:AfxEnableControlContainer() being one of them. Are these required to load .swf movies


No, it's not required, it's just an MFC call.

Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

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

tmillhouse@gmail.com
Posts: 29
Joined: Wed Jul 02, 2008 5:54 pm

Postby tmillhouse@gmail.com » Tue Jul 08, 2008 1:51 pm

I have a feeling that I know a propable cause. Since I'm loading the SWF file within the DLLMain function, could it be possible that it doesn't have time to initialize/load the entire SWF from the remote location? I read on the 'usage' page that there is a FPCPutMovieUsingStream. Would you mind sending me an example of loading a remote SWF file using this approach? I would greatly appreciate it. I searched in the demo code and there is only an example of it leading a FLV file. I want to make sure that what I have is consistent with your usage.

Also, I built the example 7 using a windowed application, and all works fine, so the problem has to deal with loading it within the DLL Main function. Hopefully this stream method will work for me.

Again, thank you for your help and your feedback is greatly appreciated.

Thanks,
Tim

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

Postby Softanics » Tue Jul 08, 2008 1:56 pm

tmillhouse@gmail.com wrote:I have a feeling that I know a propable cause. Since I'm loading the SWF file within the DLLMain function, could it be possible that it doesn't have time to initialize/load the entire SWF from the remote location? I read on the 'usage' page that there is a FPCPutMovieUsingStream. Would you mind sending me an example of loading a remote SWF file using this approach? I would greatly appreciate it. I searched in the demo code and there is only an example of it leading a FLV file. I want to make sure that what I have is consistent with your usage.


I thought about that too, that's why I proposed to try to create a new thread...
Best regards, Artem A. Razin,

F-IN-BOX support

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

tmillhouse@gmail.com
Posts: 29
Joined: Wed Jul 02, 2008 5:54 pm

Postby tmillhouse@gmail.com » Tue Jul 08, 2008 2:02 pm

Good thought. As I was going back through your responses, I realized that is what you must have meant. I"m working on that right now. Is there a good example somewhere loading a SWF file? In the meantime, I'll follow the examples I see and put something together.

Thanks,
Tim


Return to “DLL Edition”

Who is online

Users browsing this forum: No registered users and 14 guests

cron