A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 36

Thread: Support for calling DLL files through third party stand alone applications

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    2

    Support for calling DLL files through third party stand alone applications

    I work for a software firm and we are developing prototypes using Macromedia Flash, and currently, Northcode's Swf Studio. I need to be able to call functions in .dll files for various reasons.

    My understanding is SwfStudio can not do this without writing a plug-in to handle the call. I do not have the time to develop a plugin for this so I am looking at purchasing another 3rd party program to handle this for me.

    After some research I see that the new version of FlashProjector claims to do this for me:
    FlashProjector Features

    Load and call third party DLL's.
    Load and call third party DLL's functions and procedures, using simple ActionScript.

    Load DLL's Directly from memory.
    Include third party DLL's and call them directly from the internal package without ever extracting them to the users drive. All run from memory, keeping your files protected.
    However, after reading this thread:
    http://www.flashkit.com/board/showth...&highlight=dll I am not too comfortable with the FlashProjector company or the claims they make about the capabilities of their software. The attitude displayed is quite childish in all parties concerned.

    My question is this:
    How can I call a function in a dll?

    Any direction or advice is greatly appreciated.

    Edit: I also noticed there are a handfull of others who have basicly asked the same question as me... and no one ever responds to them. Why do people avoid this question?
    Last edited by Krit; 10-06-2005 at 01:51 PM. Reason: Additional Question

  2. #2
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Supporting basic DLL calls isn't hard if they all have simple function signatures that deal with scalar variable types and not with structs, pointers or memory allocation. This is a no-brainer and easy to implement, but it's only a partial solution so we decided not to include it in V3.

    Adding support for generic DLL calls where the caller needs to provide a chunk of memory for the DLL to populate or where it needs to read a chunk of memory allocated by the DLL and then free it and handle many more parameter types is a harder job, but it's the right solution and this is what we're working on... a way to really be able to call any DLL function from Flash.

    If you don't have time to develop a plugin, we can definitely help. The V3 plugin SDK hasn't been documented yet, but we can provide you with an example plugin showing how to call any DLL function(s) you need and you can take it from there or we can build and maintain a custom plugin for you.

    Note: If your DLLs are actually COM objects (automation objects) you can already call them from SWF Studio V3 using our JScript feature and it's really easy.
    Last edited by Northcode; 10-06-2005 at 06:17 PM.

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    2
    Thanks for the quick reply Northcode. If you could provide me a sample that would be greatly appreciated. We use V2 atm but im submitting the order for V3 this morning. Im trying to avoid making the move to Director so hopefully this will work out.

    Thanks again,
    Kris

  4. #4
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Got your PM and will send you an email shortly.

  5. #5
    Junior Member
    Join Date
    Aug 2005
    Posts
    18
    Hello Krit,
    FlashProjector version 2.0.0.4 was just released today. it includes a really powerful Dll calling feature like no other, here is what you can do:
    1. you can load DLL's and call their functions directly from the internal package (from inside the exe) without ever extracting the DLL to Disk, meaning your DLL's are loaded directly into memory. Thanks to our Smart Compiler/Linker where your DLL are linked into the exe.
    2. When a DLL has a Form inside it and it is being loaded from a Skinned FlashProjector application the DLL form will be skinned automatically, matching your Skinned FP application see the Demo here ( www.flashprojector.com/files/fpDll.zip ) includes exe, .fla, .swf, .fpp
    3. All loaded DLL are managed automatically for you so you don't have to worry about loading duplicates and things like that.
    4. you can receive results back from a dll functions as well.

    And for more Advanced features you can use ActiveX Controls and use them with FP, with which you can hook to the AX events, call methods and change the AX properties by using a standard Flash Object, see the Browser demo found at our site www.flashprojector.com and here is one that loads a VB ActiveX Control and shows it's Form Skinned, This AX allows you to add tip of the day to your application. get it here: www.flashprojector.com/files/tipoftheday.zip (includes: exe, .fla. swf, .fpp and VB Source Project).

    In the next few days the online Help will be updated with all of the new features, we have tons of them. so keep an eye out.

    The new build 2.0.0.4 has every single feature we claim on our web site, and even more features that haven't been listed on the site yet, also the above demos clearly demonstrate the use of ActiveX Control and the DLL calling features.


    If you already have version 2.0.0.0 Open FP and click on "Help">>"Check for Update" to get the latest version

    PS: In regards to that "childish post" just want to say that we greatly regret participating in that post, and I can assure that we have matured (all of us have) and you'll never see such actions or remarks from any of our staff.

    If you still have questions please feel free to contact us by Phone:

    E-mail us at support@flashprojector.com and we'll send you the phone number.

    Regards,
    FlashProjector Team.

  6. #6
    Junior Member
    Join Date
    Aug 2005
    Posts
    18
    Just wanted to update everyone reading this post, that we have implemented all of the suggestions we received in regards to the DLL Object, so that every knows about them: here they are:
    1. some of have asked to be able to call your own Flash functions directly from your DLL, well you will be happy to know that this is implemented. and will be available in the next build 2.0.0.6
    2. some of you wanted to call dll functions without loading an instance of the DLL's kind of like calling a function where the dll is loaded the function is called and the dll is freed automatically, it has been implemented.

    and Thank you all for your suggestions and recommendation we truly appreciate it, if you have any other suggestions please use our forum: www.flashprojector.com/forum just to keep FlashKit for general purpose help and NOT tool specific.

    Thank you,

  7. #7
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    I tried fpDLL to see what kind of DLL support you added, but I got the attached error when I pressed the "load project1 and show a form.." button.

    Everything after the crash is really a side effect and should be considered part of the same bug, but it might when you're debugging to know that the skin disappeared from the main window too.
    Attached Images Attached Images

  8. #8
    Junior Member
    Join Date
    Aug 2005
    Posts
    18
    Hello NorthCode,
    Thanks for the note.
    the only reason it would crash is if you don't have a library Called "BORLNDMM.DLL" which is used with that dll, so to solve the just replace project1.dll with your own dll that has a form. or you can download the attached project1.dll and source code below, this new dll doesn't rely on "BORLNDMM.DLL".


    PS: the Original File was updated with the new DLL, so please download and try it again, this new DLL has a button that will call a Flash Function from the dll, it will only work on FlashProjector Version 2.0.0.6 and up. which will be relased in a couple of days.

    Enjoy!!

    Complete Project :
    www.flashprojector.com/files/fpDll.zip

    new replacement dll:
    Attached Files Attached Files
    Last edited by FlashProjector; 10-12-2005 at 12:56 PM.

  9. #9
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Yep, the dependency viewer says borlndmm.dll is missing from project1.dll. If you're going to keep that example as-is you might want to link that DLL statically (uncheck the "Use dynamic RTL" option in the Delphi linker options) or use LoadLibrary to make sure the DLL is there before trying to load project1 in your example so it provides an error message instead of just crashing. It might save you some support calls/questions.

  10. #10
    Junior Member
    Join Date
    Aug 2005
    Posts
    18
    Thanks for the suggestion, but it is easier to remove the dll reference instead of linking it, the demo has no use for it, the Example was updated so it isn't using "Borlndmm.dll" and it should work on any win32 bit system from win95 and up. just grab the updated file form the link above, and you should have no troubles.

    also Version 2.0.0.6 has a better error trapping for loading dlls, which will help prevent similar crashes in the future.

    So I take it that the new updated sample worked, Correct? What do you think?

    Thanks again for bringing it to my attention.

    Regards,
    Last edited by FlashProjector; 10-12-2005 at 01:16 PM.

  11. #11
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Project1.dll doesn't have a hard dependency on the Borland DLL any more and the application isn't forcibly terminated, but it generates two UAEs followed by a runtime error (#216). See attachment.
    Attached Images Attached Images

  12. #12
    Junior Member
    Join Date
    Aug 2005
    Posts
    18
    Yes the current version you have 2.0.0.4 has a small bug, when loading the dll from within the internal package which has been addressed and fixed, but you can still use 2.0.0.4 to see the DLL Form skinned, just load the dll from Disk:

    replace this :
    var myDllFrm = fpDll.createObject("<internal>project1.dll");
    with this:
    var myDllFrm = fpDll.createObject("project1.dll");

    and place a copy of project.dll in the same folder as the exe then compile and run, click show form.

    The fixed release will be available later tomorrow.

    BTW: what OS are you testing this on?

    Thanks,
    Cheers,

  13. #13
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    I'm running Windows 2000 SP4 with all the latest updates.

    I wasn't rebuilding the project, just running the example you uploaded.

  14. #14
    Junior Member
    Join Date
    Aug 2005
    Posts
    18
    Thanks for the tests,
    Here is a sample that was compiled in version 2.0.0.6, this file was tested on the following platforms and it worked:
    WinMe, WinXp (home/Pro), win2k (SPp4), Win2k3, and windows Vista. and performed as expected on all platforms.

    Oh yah this new file demonstrates how to call your Own Flash Functions Directly from the DLL and pass them an ARRAY of Parameters, plus get results back from the Flash function into the DLL, Its a TWO Way Communication.

    www.flashprojector.com/files/fpdll.exe

    here are the current Flash functions inside the swf that you can try calling in the above sample file: (Case Sensitive)
    1. testFunc (this function will receive your strings from the dll and show them in the trace window and send a return string back to your dll.)
    2. loadDll (this function will load the DLLTest.dll)
    3. callDllFunc (this will call a function in the DLLTest.dll) so it should be called after number 2.

    see the attached screenshot.




    Once more thank you for the report.

    Regards,

  15. #15
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    Quote Originally Posted by FlashProjector
    ...windows Vista...
    i'm so jealous...i'm trying to get the company that I work for to get an MSDN subscription.
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

  16. #16
    Junior Member
    Join Date
    Aug 2005
    Posts
    18
    LOL,
    If you do a lots of Microsoft Developpment, it is well worth the money, because you get access to almost all of Microsofts Tools. and if you become a Microsoft Partner that's even Better more access.

  17. #17
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    We have some kind of subscription and get all of the software shortly before it comes out (like quarterly) but none of the early beta's...unfortunately a website design firm doesn't really have more need than that.
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

  18. #18
    Junior Member
    Join Date
    Aug 2005
    Posts
    18
    Hello everyone,

    Due to the popularity of this feature, just wanted to let everyone know that we have implemented all of your requests, and they are as follow: get the latest (exe, dll, fla, fpp) files from here: www.flashprojector.com/files/fpdll.zip

    New feature: Available on 2.0.0.6
    1. Added the ability to Call a Flash Function and pass it multiple Arguments from your DLL, these arguments can be anything from, Numbers, String, Objects, Classes, Pointers and so on.. they will be converted to a Format Flash Understand .
    2. not only the DLL Main Form is Skinned, now all of its Child Components are as well, like buttons, Checkboxes, Comboboxes and so on....
    3. Testing and works on the following windows OS: win95, win98, winMe,winXp,win2k,Win2K3, Windows Vista Beta1. in other words it works on every win32 windows .

    well that's it for now, keep an eye out for the public release of 2.0.0.6

    once again Thank you for everyone's suggestions and for your help with the tests, if you have any issues please let us know.

    Here are a few screen shots of what the dlls look like:
    DELPHI DLL DEMO (Source Included) (created by us)


    VC++ DLL DEMO (Source included) (Downloaded from the CodeProject).


    Regards,
    FlashProjector Team.

  19. #19
    Junior Member
    Join Date
    Oct 2005
    Posts
    3
    WOW, i got to this link when i search google.com for a way to extend Flash and Man this is really awesome, i mean i tried almost all of other third party tools, and none had the freedom of design and programming you get with this tool...
    Thank you for designing such a great tool, I will recommend it to everyone i know . the third party tools have really come a long way, i almost feel like i can code anything in Flash that i used to do in VB and if i can't do it in Flash alone, now i can create an activex dll to do the job, this is hot stuff.

    and I like this site too...

    cheers y'all.

  20. #20
    imagination through stupidity
    Join Date
    Apr 2001
    Location
    P3X-3113
    Posts
    1,238
    try www.multidmedia.com Zinc V2 supports custom .dlls i believe.
    Nothing to see here, move along.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center