Valhalla Legends Forums Archive | C/C++ Programming | Starting C++. Again.

AuthorMessageTime
JoeTheOdd
Yeah, I downloaded Dev-C++ yesterday, and messed arround with it for a while. Anyhow, I need some help. Can anyone show me how to (or link me to a tutorial that explains how to)..

- Create a richtextbox, and recieve its events.
- Create a textbox, and recieve its events.
- Create a CSocket.

Thanks to everyone who posts here, and has supported me this far.
August 24, 2005, 3:25 AM
UserLoser.
Win32 API Functions: CreateWindow(Ex), SetWindowLong (possibly)
Callback functions:  WindowProc
CSocket: ?? What's CSocket?

Btw, these are not just C++ specific
August 24, 2005, 3:35 AM
JoeTheOdd
Well, theres a CSocket class module that a ton of battle.net bots (and other things) use. Its basically the Winsock control, except its not a control, its a class that you use WithEvents. Anyhow, I figured it was ported from C++, so I could reference that class to have a VB-ish Winsock control instead of C++ type blocked socket.
August 24, 2005, 6:10 AM
R.a.B.B.i.T
#include <winsock2.h>

Read some tutorials, kthx?
August 24, 2005, 6:16 AM
K
[quote author=Joe[x86] link=topic=12601.msg125177#msg125177 date=1124863810]
Well, theres a CSocket class module that a ton of battle.net bots (and other things) use. Its basically the Winsock control, except its not a control, its a class that you use WithEvents. Anyhow, I figured it was ported from C++, so I could reference that class to have a VB-ish Winsock control instead of C++ type blocked socket.
[/quote]

Uh, nah. It's probably just another wrapper for the standard berkley sockets functions  + winsock initialization code.

Check out this website. It's got a good overview of creating and using a socket.
August 24, 2005, 6:19 AM
Yegg
You could always switch to wxDec-C++ and use wxWidgets instead. wxWidgets is much easier to use while also supporting all major platforms.
August 24, 2005, 1:36 PM
Myndfyr
There's a CSocket class, but it's part of MFC.

Window events (any GUI widget you create in Windows is generally a Window) that you would use for a textbox or whatnot will be handled by your WndProc function.  This function is specified when (I believe) you register your window subclass at creation time, prior to displaying it (at the very start of your application).  These are handled through Windows Messages, also called "Notifications" in MSDN documentation.
August 24, 2005, 3:11 PM
JoeTheOdd
I think I'll download VC++ off Limewire and go watch TV for a few hours.
August 24, 2005, 11:36 PM
Myndfyr
Personally, instead of pirating software, I would just go with wxSocketBase in the wxWidgets library.
August 24, 2005, 11:42 PM
Mangix
[quote author=Joe[x86] link=topic=12601.msg125302#msg125302 date=1124926605]
I think I'll download VC++ off Limewire and go watch TV for a few hours.
[/quote]
or instead of getting that garbage, get the free VC++ 2005 Beta 2 from microsoft. it's a way shorter download
August 25, 2005, 1:09 AM
Yegg
That beta takes a long time to install (not that it matters in the end). But if I remember correctly it expires in 30 days?
August 25, 2005, 3:17 PM
Quarantine
2005 is garbage.
August 25, 2005, 3:23 PM
Mangix
[quote author=Yegg link=topic=12601.msg125392#msg125392 date=1124983078]
That beta takes a long time to install (not that it matters in the end). But if I remember correctly it expires in 30 days?
[/quote]

yes but getting a cdkey for it is free as well

@warrior:VC++ 6.0 is bigger garbage

edit:Visual Studio 6.0 takes even longer to install
August 25, 2005, 4:21 PM
KkBlazekK
[quote author=Warrior link=topic=12601.msg125395#msg125395 date=1124983421]
2005 is garbage.
[/quote]
Agreed, but its the future.
August 25, 2005, 4:40 PM
Quarantine
2003 IDE is nicer, that or use gcc wussies.
August 25, 2005, 4:48 PM
R.a.B.B.i.T
I personally love my gcc :)
August 25, 2005, 4:50 PM
Mangix
why would you need an IDE for writting C++ anyways?

just download the Visual C++ 2003 Toolkit and compile it with the compiler. it's not hard
August 27, 2005, 8:46 PM
Quarantine
....Mangix...just shutup. Please.

You'd need an IDE to keep large programs organized if your aim isn't at a low level but at a user level of programming.
IDE's also tend to offer optimizations to the exe and offer handy things such as syntax highlighting/
August 27, 2005, 9:13 PM
kamakazie
[quote author=Warrior link=topic=12601.msg125738#msg125738 date=1125177239]
....Mangix...just shutup. Please.

You'd need an IDE to keep large programs organized if your aim isn't at a low level but at a user level of programming.
IDE's also tend to offer optimizations to the exe and offer handy things such as syntax highlighting/
[/quote]

I dunno, I have worked on some large collaborative projects without using an IDE. Just a makefile, emacs, a terminal, and cvs.

I don't quite understand how "IDE's also tend to offer optimizations to the exe" when that seems like the compiler's job?
August 27, 2005, 9:28 PM
Kp
[quote author=Warrior link=topic=12601.msg125738#msg125738 date=1125177239]You'd need an IDE to keep large programs organized if your aim isn't at a low level but at a user level of programming.
IDE's also tend to offer optimizations to the exe and offer handy things such as syntax highlighting/[/quote]

Perhaps you're confused on terminology.  Large programs can be easily maintained without an IDE.  IDEs do not offer optimizations on anything; though some IDEs do wrap compilers that can do very good optimizations.  Syntax highlighting is also commonly available outside an IDE.  The only reason I can see that you'd want an IDE is so that if your editor crashes, it takes everything else down with it. :)
August 27, 2005, 9:29 PM
Mangix
[quote author=Warrior link=topic=12601.msg125738#msg125738 date=1125177239]

IDE's also tend to offer optimizations to the exe and offer handy things such as syntax highlighting/
[/quote]

...lmao. how do IDEs optimize the exe? do they hack the compiler and make it l33t?

as for syntax highlightning, Notepad2 is always the best
August 27, 2005, 10:31 PM
KkBlazekK
[quote author=Mangix link=topic=12601.msg125751#msg125751 date=1125181887]
...lmao. how do IDEs optimize the exe? do they hack the compiler and make it l33t?

as for syntax highlightning, Notepad2 is always the best
[/quote]

@1st comment:  It could use an optimizing switch on the compiler, that it chose is best suited for your code. *shrug*
@2nd comment: :)
August 28, 2005, 5:44 AM
Mangix
an optimizing switch huh? i dont think you would need an IDE to do that though
August 28, 2005, 5:51 AM
KkBlazekK
It was a made up example... and now that I think about it, it was stupid.

I personally like ide's for thier features, such as function completion and managability.
August 28, 2005, 6:13 AM
FrOzeN
@Joe: Before bothering on adding objects such as RichTextBox's, I'd suggest learning how to make a basic 'form'. If you had done that already you'd realise how the objects get handling.

As for CSocket, wasn't it developed in VB6 as a result of many Winsock API tutorials.. turning into an API equivalent of Winsock.ocx?
August 28, 2005, 6:50 AM
KkBlazekK
Yes, CSocket is a api version of winsock.ocx
August 28, 2005, 7:25 AM
Quarantine
[quote author=Kp link=topic=12601.msg125741#msg125741 date=1125178193]
[quote author=Warrior link=topic=12601.msg125738#msg125738 date=1125177239]You'd need an IDE to keep large programs organized if your aim isn't at a low level but at a user level of programming.
IDE's also tend to offer optimizations to the exe and offer handy things such as syntax highlighting/[/quote]

Perhaps you're confused on terminology. Large programs can be easily maintained without an IDE. IDEs do not offer optimizations on anything; though some IDEs do wrap compilers that can do very good optimizations. Syntax highlighting is also commonly available outside an IDE. The only reason I can see that you'd want an IDE is so that if your editor crashes, it takes everything else down with it. :)
[/quote]

Well, I personally don't feel like writing a makefile with all of the command line arguments and find it easier to maintain large products which are made for a single platform at a user level inside an IDE since like you said all of the options wrap around arguments applicable to the compiler it'self

Now, it's probably my fault for not explaining deeper what I was talking about.

Emacs..*shudder*. I'd rather use something where I don't have to use all 10 fingers to perform a command.
I can also see the advantage of keeping a CVS and maybe you're used to your method of doing things, what I said was merely personal
preference and was providing my opinion on a comment made.

I hope I cleared most of everything up in this response.
August 28, 2005, 5:39 PM
Kp
[quote author=Warrior link=topic=12601.msg125794#msg125794 date=1125250793]I hope I cleared most of everything up in this response.[/quote]

You did, but some of your remarks lead me to believe you're trying to take a brute force approach when working without an IDE.  There are better ways to do makefile-driven development. :)

[quote author=Warrior link=topic=12601.msg125794#msg125794 date=1125250793]Well, I personally don't feel like writing a makefile with all of the command line arguments and find it easier to maintain large products which are made for a single platform at a user level inside an IDE since like you said all of the options wrap around arguments applicable to the compiler it'self[/quote]

Most modern make utilities support several features to make this much less painful.  You can use make variables to remember common settings.  Traditionally, the variable CFLAGS holds all the options which you wish to pass to your C compiler.  CXXFLAGS holds options specific to invocations of your C++ compiler.  Make also supports including other Makefiles, so you could have a Makefile of environment-wide settings that all your projects include.  Implicit rules allow you to write a few definitions for files (e.g. build .c files this way, .cc files that way, and .l files with flex), and then not worry about it anymore.  If you're clever, you can put the implicit rules in your environment-wide makefile, and use make variables in the implicit rules so that individual projects can specify different settings.  For example:[pre]# In environment.mak
# Default projects are built without optimization
CFLAGS=-O0
%.o :: %.c
$(CC) -c $(CFLAGS) $< -o $@

# In per-project Makefile
# Use a different gcc version for this project
CC=gcc-3.4.2
# Optimize and don't generate debugging information
CFLAGS=-O2 -g0[/pre][quote author=Warrior link=topic=12601.msg125794#msg125794 date=1125250793]Emacs..*shudder*. I'd rather use something where I don't have to use all 10 fingers to perform a command.[/quote]

No contest there.  Vim is much better than emacs. :)

[quote author=Warrior link=topic=12601.msg125794#msg125794 date=1125250793]I can also see the advantage of keeping a CVS and maybe you're used to your method of doing things[/quote]

Versioning systems are nice for large projects (even when used with an IDE), but Subversion is a much better choice than CVS.
August 28, 2005, 6:46 PM
Quarantine
I'm realatively new to Makefile's that's why maybe I tend to pick the more "new user friendly" approach to things.
I knew about makefile's being able to include others (that's the only way I can see to compile everything in different directories by using $@  and $v and calling the next directories makefile respectively but outputting all object files into the same directory for easy linking)
August 28, 2005, 6:50 PM
Mangix
[quote author=Warrior link=topic=12601.msg125409#msg125409 date=1124988513]
2003 IDE is nicer, that or use gcc wussies.
[/quote]
can the 2003 IDE do this?

http://img180.imageshack.us/img180/8716/vc20059rp.jpg
September 2, 2005, 12:28 AM
KkBlazekK
MVC++ 6 can do that...
September 2, 2005, 12:38 AM
Myndfyr
[quote author=Mangix link=topic=12601.msg126565#msg126565 date=1125620881]
[quote author=Warrior link=topic=12601.msg125409#msg125409 date=1124988513]
2003 IDE is nicer, that or use gcc wussies.
[/quote]
can the 2003 IDE do this?

http://img180.imageshack.us/img180/8716/vc20059rp.jpg
[/quote]

Yes, during debugging.  It's called the "call stack" window.
September 2, 2005, 12:53 AM
Quarantine
Sure why not?
September 2, 2005, 1:04 AM
Mangix
hrm

[me=Mangix]tinkers with his VC++[/me]

edit: w00t "[me]" tags w00t
September 2, 2005, 3:48 AM

Search