User Tag List

Results 1 to 2 of 2

Thread: DLL & Binary Object - integer buffer

  1. #1
    Clicker Fusion 2.5Fusion 2.5 MaciOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2010
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    DLL & Binary Object - integer buffer

    Hi,

    I am trying to create a front end for some command line applications I have writ in C. The first thought that come into my mind was to create a DLL file, and call it from MMF using the DLL extension.

    I have got this running to a point - I can pass arguments and see output to disk as I expect, which means I have passed arguments correctly. The problem comes when I want to use the "argument integer buffer" as a means of getting values into MMF directly.

    This is my thinking (thanks to Phi for letting me know about the Binary Object):

    1) Setup the binary object to have an array size required (int's are 4 bytes, so the number of elements times 4).
    2) Pass the address of the binary object as the argument.
    3) Call the function, and modify the memory allocated by the binary object via the integer pointer.

    No matter what I do I can not pass by reference via the pointer. My DLL file passes strings by reference with no problems (the dll object specifiies buffer size so it does this part for you in mmf), but I get absolutely nothing using the binary object.

    Here is my silly function in my DLL:
    Code:
    DECLDIR void test ( int *inputarr )
    {
    	int i;
    
    	for ( i = 0 ; i < (512/4) ; i++)
    		inputarr[i] = i;
    	
    }
    Anyone have any thoughts on this or advice? I would love to be able to use MMF2 to do all the front end . All I get are zeroed bytes in the binary object, what am I missing?

    Cheers,
    Rich

  2. #2
    Clicker Fusion 2.5Fusion 2.5 MaciOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2010
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have solved this, for reference I passed the pointer just an integer argument, in my DLL I cast back to a pointer and everything works nicely.

    The "integer buffer" seems to have led me on a wild goose chase!

Similar Threads

  1. Audio buffer length?
    By Nifflas in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th March 2012, 11:28 PM
  2. How to get hold of a cSurface buffer?
    By Dines in forum Extension Development
    Replies: 3
    Last Post: 12th January 2012, 05:30 PM
  3. why always integer value when you set global val.?
    By EasySite in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 7th July 2010, 03:26 PM
  4. [DLL Object] Buffer + DLL chargée = crash
    By ouly in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 3rd June 2008, 01:23 PM
  5. Clearing string buffer
    By Nickydude in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 5th April 2007, 11:54 PM

Posting Permissions

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