Overall design

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
Emil S
Posts: 3
Joined: 2003-09-09 12:31

Overall design

Post by Emil S » 2003-09-09 12:55

I'm very new to programming under the Windows environment in general, I've mostly been into programming for the GNU(what most refers to 'Linux') platform for the last five years. I decided it would be a nice start do some modifications to the DC++ source. The compiler suit of my choise is Visual Studio .NET. What crosses my mind is that Windows MFC programming is far more complex by design aspects. Specifically, meaning the API, resources files and the way GUI's are created.

All that was just kind of a welcome speech to the forum to introduce myself and to help you understand why I'll be asking stupid questions all the time in the near future. :D

My topic of today is the purpose of the StringDefs.cpp file, I sure can guess roughly what it does, but nothing concrete. For example, I'm trying to add a new tab to the settings dialog. I see the StringDefs.cpp file contains an array of strings being used by DC++, but how are they actually utilized? I can't seem to figure out how it could make use of just a plain array? How does it "know" when to pick what element? So, please tell why I should put my strings of use in it, and how to make use of them.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-09-09 13:10

In order to add a string to DC++'s string manager, insert an identifier into StringDefs.h, then the string into the appropriate position in StringDefs.cpp, and finally a short version lower in that same file. The first entry is used with the STRING(identifier) macro to get you a "string" of your string. The second is the string returned. The third is the short name that's used in the translation XML files.

:) Once you look a bit further, you'll see that DC++ doesn't have MFC dependencies as it uses ATL/WTL for its GUI coding.

Emil S
Posts: 3
Joined: 2003-09-09 12:31

Post by Emil S » 2003-09-09 13:27

GargoyleMT wrote:In order to add a string to DC++'s string manager, insert an identifier into StringDefs.h, then the string into the appropriate position in StringDefs.cpp, and finally a short version lower in that same file. The first entry is used with the STRING(identifier) macro to get you a "string" of your string. The second is the string returned. The third is the short name that's used in the translation XML files.
Okay, I get it, thanks! I have to say the code is written in a very structured and planned manner.
:) Once you look a bit further, you'll see that DC++ doesn't have MFC dependencies as it uses ATL/WTL for its GUI coding.
I like that, portability in mind. Think many Windows programmers aren't very aware of that, or am I just being prejudiced? :)

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-09-09 15:42

Emil S wrote:Okay, I get it, thanks! I have to say the code is written in a very structured and planned manner.
:) I'm sure arnetheduck will be pleased to read that.
I like that, portability in mind. Think many Windows programmers aren't very aware of that, or am I just being prejudiced? :)
Well, you see the Client and DCPlusPlus projects? All of the windows dependent code should be in DC++ and the client portion should be, largely, cross platform. Nobody has ported it, but it's written in such a way to make that less painful.

Emil S
Posts: 3
Joined: 2003-09-09 12:31

Post by Emil S » 2003-09-09 16:36

Well, you see the Client and DCPlusPlus projects? All of the windows dependent code should be in DC++ and the client portion should be, largely, cross platform. Nobody has ported it, but it's written in such a way to make that less painful.
I've noticed that. I even think someday I might eventually try to port it to the Linux platform. There's actually a big lack for a viable DC client under Linux. That would be a great excercise, no doubt!

TheParanoidOne
Forum Moderator
Posts: 1420
Joined: 2003-04-22 14:37

Post by TheParanoidOne » 2003-09-09 17:10

Emil S wrote:There's actually a big lack for a viable DC client under Linux.
Well, there are a few available, according to this thread. But of course the keyword that you used is "viable".
The world is coming to an end. Please log off.

DC++ Guide | Words

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-09-10 03:51

I have forced some Mac users to use DCGUI on my hub. (because we block nmdcv1.) and apart from a somewhat cumbersome installation, I've heard no complaints about it.
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

norti
Posts: 34
Joined: 2003-10-22 14:42
Location: Hungary
Contact:

Post by norti » 2004-01-14 13:17

Is there a way to get automatically an example.xml (language file) from the stringdefs.cpp instead of writing it manually?
.: Norti :.

Gratch06
Posts: 141
Joined: 2003-05-25 01:48
Location: USA

Post by Gratch06 » 2004-01-14 14:08

norti wrote:Is there a way to get automatically an example.xml (language file) from the stringdefs.cpp instead of writing it manually?
look into the makedefs project. It's part of the DC++ solution but isn't set to compile by default. The forums have info on a number of common problems with compiling and using it.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2004-01-14 15:03

And MakeDefs actually makes both StringDefs.cpp and Example.xml from StringDefs.h...

Quite a time saver. I discovered it a couple months after having a hard time with StringDefs.cpp (before arne converted it so it was one string per line)... It was a bitch to patch. ;)

norti
Posts: 34
Joined: 2003-10-22 14:42
Location: Hungary
Contact:

Post by norti » 2004-01-14 18:13

Thank you :D
.: Norti :.

Locked