User Tag List

Results 1 to 6 of 6

Thread: Making debugger items

  1. #1
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, ┼rhus
    Posts
    3,455
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Making debugger items

    I use this code to display the amount of moving objects in MoveIt in the debugger. The text I have in the string table is displayed correctly, but the number is missing at the end. I followed the example from the help file and used the format from the template but just can't make it work properly. Can anyone see whats wrong?
    Code:
    enum
    {
    	DB_NUMMOVINGOBJECTS,
    };
    // Items displayed in the debugger
    WORD DebugTree[]=
    {
    	DB_NUMMOVINGOBJECTS,
    	DB_END
    };
    Code:
    void WINAPI DLLExport GetDebugItem(LPSTR pBuffer, LPRDATA rdPtr, int id)
    {
    #if !defined(RUN_ONLY)
    	char temp[DB_BUFFERSIZE];
    	switch (id)
    	{
    	case DB_NUMMOVINGOBJECTS:
    		LoadString(hInstLib, IDS_NUMMOVING, temp, DB_BUFFERSIZE);
    		wsprintf(pBuffer, temp, rdPtr->Objects.size());
    		break;
    	}
    #endif // !defined(RUN_ONLY)
    }

  2. #2
    No Products Registered

    Join Date
    Jun 2006
    Posts
    150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Making debugger items

    I would change
    Code:
    void WINAPI DLLExport GetDebugItem(LPSTR pBuffer, LPRDATA rdPtr, int id)
    {
    #if !defined(RUN_ONLY)
    	char temp[DB_BUFFERSIZE];
    	switch (id)
    	{
    	case DB_NUMMOVINGOBJECTS:
    		LoadString(hInstLib, IDS_NUMMOVING, temp, DB_BUFFERSIZE);
    		wsprintf(pBuffer, temp, rdPtr->Objects.size());
    		break;
    	}
    #endif // !defined(RUN_ONLY)
    }
    to
    Code:
    void WINAPI DLLExport GetDebugItem(LPSTR pBuffer, LPRDATA rdPtr, int id)
    {
    #if !defined(RUN_ONLY)
    	switch (id)
    	{
    	case DB_NUMMOVINGOBJECTS:
    		wsprintf(pBuffer, "Moving objects: %d", rdPtr->Objects.size());
    		break;
    	}
    #endif // !defined(RUN_ONLY)
    }
    as I see no point in using a resource string for that.

  3. #3
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, ┼rhus
    Posts
    3,455
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Making debugger items

    Thanks alot! <img src="/center/images/graemlins/laugh.gif" alt="" /> I wonder why Yves likes to use the string tables so much. I guess it all depends on how you program. In large projects it would probably make sense with the string table, but not in my little object <img src="/center/images/graemlins/wink.gif" alt="" />

  4. #4
    No Products Registered

    Join Date
    Jul 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Making debugger items

    I think they become useful if you need to translate an extension - maybe there is someone in the world busily translating all the extensions that are released <img src="/center/images/graemlins/smile.gif" alt="" />

  5. #5
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, ┼rhus
    Posts
    3,455
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Making debugger items

    Hey Burkey <img src="/center/images/graemlins/laugh.gif" alt="" />
    Long time no see. People have been looking for you <img src="/center/images/graemlins/smile.gif" alt="" />

  6. #6
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,076
    Mentioned
    119 Post(s)
    Tagged
    2 Thread(s)

    Re: Making debugger items

    Yes, stringtables are useful when you translate the extensions. <img src="/center/images/graemlins/wink.gif" alt="" />

    Yves.

Similar Threads

  1. Add items every so often
    By AnonymouseK in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 25th August 2013, 06:38 PM
  2. How to add up numbers from items in an ini?
    By fwtep in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 27th January 2013, 02:51 PM
  3. Keeping items when making game
    By IIMikII in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 16th October 2008, 10:30 PM
  4. Making items & item slots for RPG, please help.
    By Iwantmyrpg in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 28th August 2008, 08:36 AM
  5. Items
    By Rabagast in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 25th July 2008, 06:26 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
  •