Need to unload movie from flash control

DLL Edition of the F-IN-BOX
Flecks
Posts: 4
Joined: Thu Aug 23, 2007 1:18 pm
Location: Ukraine, Dnepropetrovsk

Need to unload movie from flash control

Postby Flecks » Tue Mar 04, 2008 4:43 pm

There are a lot of FPC_Load functions to load swf movies from different sources, but there's no Unload one.

Previously we were using DestroyWindow() function, but the repeated Destroy-Create calls were causing the issues connected with the strange output to the desktop DC...
CreateCompatibleDC(GetDC(myHWindow)) returns FALSE and GetLastError() = 1400; even if the window exists

Please advice.
Last edited by Flecks on Tue Mar 04, 2008 6:36 pm, edited 1 time in total.

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

Postby Softanics » Tue Mar 04, 2008 4:52 pm

To unload you can load a movie from non-existant path:

FPC_LoadMovie(hwnd, 0, _T("___"));
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

RobertG
Posts: 10
Joined: Mon Apr 28, 2008 2:45 pm

Postby RobertG » Mon Apr 28, 2008 3:11 pm

Does this also applies to FPC_PutMovie(hwndFlashPlayerControl, emptyPath);

Br Rob.

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

Postby Softanics » Tue Apr 29, 2008 6:06 am

RobertG wrote:Does this also applies to FPC_PutMovie(hwndFlashPlayerControl, emptyPath);


Yes, it should work properly too.
Best regards, Artem A. Razin,

F-IN-BOX support

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

RobertG
Posts: 10
Joined: Mon Apr 28, 2008 2:45 pm

GDI Leaks

Postby RobertG » Wed May 07, 2008 4:08 pm

I am having problems with GDI leaks,

I am statically loading the OCX file. so that I can use it as many times I would like during app life time, I also do a FPC_LoadOCXCodeFromMemory once... I have even tested to load/unload the ocx between each movie... However the problem seem to be connected with creating a window and destroying the window.
For some wierd reason after a destruction of a window wich works visually fine, it still allocates more GDI objects???? this is a wierd behaviour. After running my app which shows several movies after 24 h or so.. My GDI objects are up to 9999 and then windows behaves wierdly aswell. I have no other memory leaks, no thread leaks, and now I don't even grabb the textures i let the flash player do its job on this window, I have localized the problem solely to the creation and destruction of the windows.

I Use the FPC_CreateWindows...
_hwndFlashCtrl = FPC_CreateWindow(m_hFPC,
0,
NULL,
WS_POPUP|WS_VISIBLE,
rw,
0,
_renderWidth,
_renderHeight,
/*parentHWND*/ NULL,
NULL,
NULL,
NULL);


And once the movie is finnished playing I'll do Ò‘
DestroyWindow(_hwndFlashCtrl)


Visually everything works properly except for the GDI objects are still growing in numbers?

I am within the same thread for the constructing and destroying the windows?? I am lost, this doesn't make any sense?

Even tried to unload the movie as stated above but with no difference in behaviour.

Br Robert.

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

Re: GDI Leaks

Postby Softanics » Wed May 07, 2008 7:30 pm

RobertG wrote:I am within the same thread for the constructing and destroying the windows?? I am lost, this doesn't make any sense?


Yes, you should call CreateWindow and DestroyWindow in the same thread.

Could you please send me the source code to test to support (at) f-in-box.com ?
Best regards, Artem A. Razin,

F-IN-BOX support

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

luckmstone
Posts: 8
Joined: Tue Jul 22, 2008 9:48 am

I am having problems with GDI leaks in Delphi Edition!

Postby luckmstone » Wed Aug 20, 2008 11:05 am

How to solve the problem?

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

Re: I am having problems with GDI leaks in Delphi Edition!

Postby Softanics » Wed Aug 20, 2008 3:41 pm

luckmstone wrote:How to solve the problem?


What is the problem exactly?
Best regards, Artem A. Razin,

F-IN-BOX support

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

RobertG
Posts: 10
Joined: Mon Apr 28, 2008 2:45 pm

GDI Leak solved-

Postby RobertG » Fri Jan 16, 2009 10:19 am

F.Y.I

Just want to mention that the GDI Leak got solved, we later found out that our app is mostly dynamically linked towards several dll

Each time we killed a thread (Flash movie) in our case, other DLLMain()
got called with a flag DLL_THREAD_ATTACH & DLL_THREAD_DETACH

Another part of the Application did not handle these ThreadLibraryCalls properly! They where basically restarting it self, and creating of a new window with new GDI icons :( (That was the leak!) took us 2 month to find... we had around 50 DLL's to walk through.

quite tricky to know if you are not custom to the DLL ways of dev win app.


Return to “DLL Edition”

Who is online

Users browsing this forum: No registered users and 19 guests