Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Helping Out
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
3
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #30 on Fri 09 Oct 2009 06:20 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #31 on Fri 09 Oct 2009 09:15 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #32 on Sat 10 Oct 2009 08:45 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #33 on Sun 11 Oct 2009 03:59 AM (UTC) |
| Message
| |
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #34 on Sun 11 Oct 2009 06:11 AM (UTC) 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 | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #35 on Mon 12 Oct 2009 09:10 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #36 on Tue 13 Oct 2009 06:00 AM (UTC) |
| 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 | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #37 on Sat 17 Oct 2009 02:57 AM (UTC) |
| 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 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #38 on Sat 17 Oct 2009 10:48 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #39 on Sat 17 Oct 2009 11:05 PM (UTC) 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 | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #40 on Sat 17 Oct 2009 11:28 PM (UTC) 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 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #41 on Sat 17 Oct 2009 11:50 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #42 on Sat 17 Oct 2009 11:53 PM (UTC) Amended on Sun 18 Oct 2009 07:03 AM (UTC) by Twisol
|
| Message
|
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 | | 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.
146,850 views.
This is page 3, subject is 3 pages long:
1
2
3
It is now over 60 days since the last post. This thread is closed.
Refresh page
top