SWF Resource in Delphi DLL

F-IN-BOX for Delphi / Builder C++ / VCL
alphaville
Posts: 3
Joined: Wed Aug 16, 2006 9:12 pm

SWF Resource in Delphi DLL

Postby alphaville » Wed Aug 16, 2006 9:23 pm

Hello everyone,

I'm not sure whether this is the right forum for this topic. I just downloaded the trial version of TFlashPlayerControl and was looking at the samples. I was wodering whether it is possible for a snippet in delphi to load swf files from a resource in dll.

My apologies if it is in the samples but I did not see it.

Best Regards

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

Postby Softanics » Fri Aug 18, 2006 5:31 pm

Thank you for your question.

Yes, you can load swf from the resource that resides in a dll. Just get stream:

Code: Select all

HandleOfYourDLL := GetModuleHandle('YourDLL.dll'); // or use LoadLibrary
ResourceStream := TResourceStream.Create(HandleOfYourDLL, 'FLVPlayer', 'SWF');
FlashPlayerControl1.LoadMovieFromStream(0, ResourceStream);
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

alphaville
Posts: 3
Joined: Wed Aug 16, 2006 9:12 pm

Postby alphaville » Sat Aug 19, 2006 11:44 am

The GetModuleHandle is giving me the error EResNotFound however it works fine with LoadLibrary.

Thanks for your reply.

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

Postby Softanics » Sat Aug 19, 2006 2:49 pm

Yes, you are right, you should use LoadLibrary. Don't forget to call FreeLibrary after loading a movie.
Best regards, Artem A. Razin,

F-IN-BOX support

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


Return to “Delphi / Builder / VCL Edition”

Who is online

Users browsing this forum: No registered users and 13 guests

cron