[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Helping Out
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Helping Out

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1  2  3 

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #30 on Fri 09 Oct 2009 06:20 PM (UTC)  quote  ]
Message
Last question for a while, hopefully... How do I edit the MUSHclient resources? I'm trying to add a new identifier IDC_ARRAYS (for the Import XML dialog) but I can't figure out where to set it up.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (19,607 posts)  [Biography] bio   Forum Administrator
Date Reply #31 on Fri 09 Oct 2009 09:15 PM (UTC)  quote  ]
Message
Twisol said:

After a LOT of debugging to figure this out - I will have a lifelong hatred of varargs because of this! - it's as simple as casting the ts.Get*() return values to longs.



    CString strDuration = TFormat("--- Connected for %i day%s, %i hour%s, %i minute%s, %i second%s. ---",
                  PLURAL((long)ts.GetDays()),
                  PLURAL((long)ts.GetHours()),
                  PLURAL((long)ts.GetMinutes()),
                  PLURAL((long)ts.GetSeconds()));


The above code is in worldsock.cpp, in the CWorldSocket::OnClose method.


EDIT: As you can see from this cached page[1], all of the Get*() functions utilized in that code return 'int's, except for GetDays() which is a long. No wonder it worked flawlessly in VC6.



Yes, they must have changed that definition since my version. Shows how subtle changes can screw you up.

Well done for finding that. I must admit when it crashes on TFormat or CFormat I look for accidentally using a CString without casting it (eg. (LPCTSTR) mystring), however since that particular case didn't use strings I didn't mention it.

I have amended the official source to incorporate that change, to save future problems. Also the DoAfter change you mentioned (changing DoAfter to always work that is).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #32 on Sat 10 Oct 2009 08:45 PM (UTC)  quote  ]
Message
Thanks! Are you interested in the changes for the array saving/loading perhaps? And if I wanted to edit a dialog and add/remove a control, how would I do that?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (19,607 posts)  [Biography] bio   Forum Administrator
Date Reply #33 on Sun 11 Oct 2009 03:59 AM (UTC)  quote  ]
Message
Yes I wouldn't mind seeing that.

As for the resources you need to compile the project that builds the resources DLL. I'm not sure, it might be this file:

http://www.gammon.com.au/files/mushclient/mc_resources_4.24_large.zip

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #34 on Sun 11 Oct 2009 06:11 AM (UTC)  quote  ]

Amended on Sun 11 Oct 2009 08:59 AM (UTC) by Twisol

Message
How should I go about getting the diff files to you?

EDIT: Okay, I've generated a diff file. I was using WinMerge, but its patch creator gave infinite context around changes instead of just three lines. The main things it contains are:

1) Changes to allow the source to compile under VS2005, back when this whole thing started. I think you more or less have all of these.

2) The DoAfter fix and TFormat() casting fix. I'm positive you already have these but I'm including them for completeness.

3) The array serialization code. This is the bulk of the patch; I'm working on adding an arrays option to the Import XML dialog right now, but for now the patch ignores arrays there. It should save/load in the world and in plugins, though.

I understand that you have full authority over which changes get merged into the official source. However, it would be much appreciated - regardless of the eventual usage of the changes - to have some feedback on the changes themselves. Did I miss anything important?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #35 on Mon 12 Oct 2009 09:10 PM (UTC)  quote  ]
Message
Hi Nick, did you perhaps overlook my above post from a couple days ago? Just checking in; if it was a more complex question I'd've waited longer to bother you again.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (19,607 posts)  [Biography] bio   Forum Administrator
Date Reply #36 on Tue 13 Oct 2009 06:00 AM (UTC)  quote  ]
Message
Sorry, I got distracted. I've sent you a private message with my email address.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #37 on Sat 17 Oct 2009 02:57 AM (UTC)  quote  ]
Message


Hmm, that just contains 'en.dll'. I'm still unable to find exactly where the visual dialog controls and such are set up and created. 'resource.h' #defines the various identifiers used to refer to the resources, but I can't find the actual .rc that creates them.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (19,607 posts)  [Biography] bio   Forum Administrator
Date Reply #38 on Sat 17 Oct 2009 10:48 PM (UTC)  quote  ]
Message
You had:


***************
*** 47,53 ****
  // lines of code and more reliable than turning on SS_NOTIFY in OnCtlColor
  // because Windows doesn't send WM_CTLCOLOR to bitmap static controls.
  //
! UINT CStaticLink::OnNcHitTest(CPoint point)
  {
  	return HTCLIENT;
  }
--- 47,53 ----
  // lines of code and more reliable than turning on SS_NOTIFY in OnCtlColor
  // because Windows doesn't send WM_CTLCOLOR to bitmap static controls.
  //
! LRESULT CStaticLink::OnNcHitTest(CPoint point)
  {
  	return HTCLIENT;
  }


However I had already changed it back (to the current state), see this post:

http://www.gammon.com.au/forum/bbshowpost.php?id=7746&page=2


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #39 on Sat 17 Oct 2009 11:05 PM (UTC)  quote  ]

Amended on Sat 17 Oct 2009 11:08 PM (UTC) by Twisol

Message
Odd, because when I change it back to UINT (in both places), I get this error:


Error	507	error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'	c:\Users\Link\Documents\Visual Studio 2005\Projects\MUSHclient\MUSHclient\StatLink.cpp	27


VS2005 barfs if it's UINT, but compiles fine with LRESULT.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #40 on Sat 17 Oct 2009 11:28 PM (UTC)  quote  ]

Amended on Sat 17 Oct 2009 11:31 PM (UTC) by Twisol

Message
Perhaps use the _MFC_VER macro [1] to selectively compile one line or the other? Something like...


#if _MFC_VER >= 0x0800
    // ...
#else
    // ...
#endif


Now that I found that _MFC_VER macro, I think you could replace the (custom) _USING_MFC8 conditional I put in forcelib.h with it as well.


[1]: http://msdn.microsoft.com/en-us/library/b0084kay.aspx

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (19,607 posts)  [Biography] bio   Forum Administrator
Date Reply #41 on Sat 17 Oct 2009 11:50 PM (UTC)  quote  ]
Message
Twisol said:

Hmm, that just contains 'en.dll'. I'm still unable to find exactly where the visual dialog controls and such are set up and created. 'resource.h' #defines the various identifiers used to refer to the resources, but I can't find the actual .rc that creates them.


Try this:

http://www.gammon.com.au/files/mushclient/resources/mushclient_resources_4.24.zip

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #42 on Sat 17 Oct 2009 11:53 PM (UTC)  quote  ]

Amended on Sun 18 Oct 2009 07:03 AM (UTC) by Twisol

Message
Nick Gammon said:

Twisol said:

Hmm, that just contains 'en.dll'. I'm still unable to find exactly where the visual dialog controls and such are set up and created. 'resource.h' #defines the various identifiers used to refer to the resources, but I can't find the actual .rc that creates them.


Try this:

http://www.gammon.com.au/files/mushclient/resources/mushclient_resources_4.24.zip


Brilliant, that's the one. Thanks!


EDIT (later that night): I modified the resources to add a control to the Import XML dialog, and made further changes to the actual source to support the change. I'll be sending you this patch as well once I put together the diffs.

(Please let me know if I'm stepping on your toes or anything else at all. I'm just excited to be contributing!)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,709 views.

This is page 3, subject is 3 pages long:  [Previous page]  1  2  3 

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]