User Tag List

Results 1 to 7 of 7

Thread: Problem with changes in the extension's structure

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    May 2007
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with changes in the extension's structure

    Hi, guys.

    After three hours lost that I've tried looking for a nasty bug in my code that would crash almost anywhere I finallly realized this wasn't a bug at all. :mad:

    The extension was crashing on an example that used an old version of the same extension ( version 1.0) but when I compiled the new MFX file with the same name ( version 2.0 ) the example was crashing everywhere most notably in the rdPtr->rRd.GenerateEvent(x) lines.

    But I have a dilemma with this: my users would have to rewrite their applications using this new extension. Funny thing is that the filename of the extension is the same, the order of events is the same.

    Things that could possbily have made it incompatible with older versions:

    -- I've added stuff to my rdPtr structure (variables);
    -- I've commented out some of my code

    Do you guys know what I can do in order to revert this? I want this new extension version be compatible with examples that use the old version. Sorry if I seemed vague here. If more details are needed, I will provide them.

    Thanks in advance.

    Regards,

    Andre Guerreiro

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Problem with changes in the extension's structure

    Adding variables to the rdPtr shouldn't affect older applications.

    If the old structure was

    int apples; [color:#000099]offset 00[/color]
    int bananas; [color:#000099]offset 04[/color]
    int pies; [color:#000099]offset 08[/color]
    int oranges; [color:#000099]offset 12[/color]

    and now it's

    int apples; [color:#000099]offset 00[/color]
    int bananas; [color:#000099]offset 04[/color]
    int pies; [color:#000099]offset 08[/color]
    int oranges; [color:#000099]offset 12[/color]
    [color:red]int totalfruits;[/color] [color:#000099]offset 16[/color]

    all the variables point to the same offset as before.

    but if you changed it to

    int apples; [color:#000099]offset 00[/color]
    int bananas; [color:#000099]offset 04[/color]
    [color:red]int totalfruits;[/color] [color:#000099]offset 08[/color]
    int pies; [color:#000099]offset 12[/color]
    int oranges; [color:#000099]offset 16[/color]

    pies and oranges would paint 4 bytes further in the memory, since there is an int before them.

    So if you accessed rdPtr->pies now, and the rdPtr comes from an older version, it would return oranges - since that was the old offset of oranges, which is now pies' offset.

    Luckily, you don't really need to care: You don't deal with older pointers. You do have to care if you're working with edittime data. There's a function for that in General.cpp - You have to check for the editdata version and port all variables from the old pointer to a new pointer.

    As I said, the runtime pointer is completely allocated at runtime, and NO variables from older pointer versions are being used at all...

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    May 2007
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with changes in the extension's struct

    Hi, Looki.

    Thanks for the useful information. That's very appreciated.
    I have nothing in the EDITDATA structure. Only in the RUNDATA (rdPtr). That's why I spent three hours looking for a bug that didn't exist.

    The fact is: once I replace the extension keeping the same events and frame stuff all works well. I don't know what else gets stored in the MFA file but I think something has changed greatly.

    And I'm pretty sure I have nothing different in the edit time variables and structure. The problem really lies in the RUNDATA.
    Most of the Acces Violations have to do with the rdPtr->rRd->GenerateEvent(x) line.

    When I replace the extension with the new one keeping the same events and objects, all goes fine.


  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Problem with changes in the extension's struct

    Yes, these errors sound familiar, but I really don't know what it could be.

  5. #5
    Clicker Fusion 2.5 Developer

    Join Date
    May 2007
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with changes in the extension's struct

    Thanks anyway.
    I'm gonna see if I can solve this. But since time is not on my side I can just release it the way it is right now.

  6. #6
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,247
    Mentioned
    176 Post(s)
    Tagged
    3 Thread(s)

    Re: Problem with changes in the extension's struct

    byo,

    SQL EDITOR, EXAMPLE

    Attached files Attached files
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  7. #7
    Clicker Fusion 2.5 Developer

    Join Date
    May 2007
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with changes in the extension's struct

    Thanks a lot.
    It's good that now I can sit down and work on it. But I think I nailed it already while we're talking in PM.

Similar Threads

  1. XML/Other Data structure?
    By macca02 in forum Android Export Module Version 2.0
    Replies: 3
    Last Post: 4th October 2013, 11:48 AM
  2. Structure de donné
    By Nekorai in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 25th September 2010, 06:12 PM
  3. RUNDATA structure and Class
    By Cocodrilo in forum Extension Development
    Replies: 4
    Last Post: 9th October 2007, 05:37 PM
  4. [Suggestion] Object folder structure when copying.
    By RaiFox in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 21st March 2007, 08:25 AM

Posting Permissions

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