Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Windows programming "commands" in C
Goto page 1, 2  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  c switch problem Post :: Post league manager  View next topic  
Author Message
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Wed Apr 25, 2007 9:28 pm    Post subject: Windows programming "commands" in C Reply to topic Reply with quote

I'm looking for a list of windows programming "commands" such as MB_CREATE
MB_DESTROY

and things like that. maybe message box too. a real nice tutorial would be nice too with lots of examples, that's how i learn best :)
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
tansey
Novice


Joined: Nov 03 2004
Posts: 53
Offline

PostPosted: Wed Apr 25, 2007 11:31 pm    Post subject: Reply to topic Reply with quote

MSDN seems like the obvious choice...

I'm not sure by what you mean commands, but between MSDN and codeproject.com, you can find 90% of the stuff you will need to get to an intermediate level.
Back to top
View users profile Send private message Add User to Ignore List
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Thu Apr 26, 2007 4:58 pm    Post subject: Reply to topic Reply with quote

url? i can't seem to find MSDN.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
SamHughes
Server Help Squatter


Joined: Jun 30 2004
Posts: 249
Location: Greenwich
Offline

PostPosted: Thu Apr 26, 2007 5:01 pm    Post subject: Reply to topic Reply with quote

http://msdn.microsoft.com/
Back to top
View users profile Send private message Add User to Ignore List
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Fri Apr 27, 2007 5:23 pm    Post subject: Reply to topic Reply with quote

I'm using visual basic, and i'm having problems with opening files. i can open it, but the "visual" part, that lets you practially place buttons on you're program by clicking and dragging doesn't open. if it does, it's not "visual" but just code. how do i open it right?

-----------------------------
got that to work


a little help on going about using files that the user creates as part of the data so each use is different?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:35
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3604
Location: Las Vegas
Offline

PostPosted: Fri Apr 27, 2007 8:59 pm    Post subject: Reply to topic Reply with quote

I'd heavily suggest moving to C#. It is more powerful, easily to use (for the most part), more supported, and is a popular language to get a job with as well. VB is a running joke among programmers for a reason.
Back to top
View users profile Send private message Add User to Ignore List Send email
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sat Apr 28, 2007 9:45 am    Post subject: Reply to topic Reply with quote

Could you still help me though?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:31
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Sat Apr 28, 2007 12:16 pm    Post subject: Reply to topic Reply with quote

Erm, it will probably be easier to get help if you switch to C#. Basically, just stay away from VB. Though I'm not sure why the two languages are associated, myself.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sat Apr 28, 2007 12:31 pm    Post subject: Reply to topic Reply with quote

Ok i switched to c#. i wasn't very far on my vb project, and i'm already caught up. i'm trying to recgonize mouseclicks and there for trigger dialogs and such. eventdriven programming. a more complete tutorial would be nice if anyone knows one.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Sat Apr 28, 2007 12:51 pm    Post subject: Reply to topic Reply with quote

Animate Dreams wrote:
Though I'm not sure why the two languages are associated, myself.


They never used to be, the last real version of VB was VB6

VB.net and C# use the same VM, they just have different syntax.
_________________
Rediscover online gaming. Get Subspace | STF The future...prehaps
Back to top
View users profile Send private message Add User to Ignore List
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Wed May 02, 2007 7:45 pm    Post subject: Reply to topic Reply with quote

So...no one knows of a good tutorial... does anyone else even make apps in c#? maybe we can start a project or something.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:35
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3604
Location: Las Vegas
Offline

PostPosted: Thu May 03, 2007 4:42 am    Post subject: Reply to topic Reply with quote

In C#? I try not to, because they did a very good job of wrapping everything. Of course, it allows you to make direct C calls on any library, so you can still do any function that C can, just need to make sure you enable the 'not safe' flags during compiling.
Back to top
View users profile Send private message Add User to Ignore List Send email
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Thu May 03, 2007 5:25 am    Post subject: Reply to topic Reply with quote

I'm currently devlopeing a commercial program in c# with a sqlite data store. Quite alot of websites use c# (most websites with with .aspx pages). Its not a bad language to learn. But its not a language that is very useful to code games in (too slow).

If you want to learn c#
http://www.csharp-station.com/Tutorials/Lesson01.aspx
Doesnt look like a bad place to start.

The hardest bit of c# is understanding the OOP stuff and how it can make things alot easier. If you are going to code in c# and can't get hold of a copy of visual studio (don't use the express versions they have annoying restrictions) use sharpdevlop
http://www.icsharpcode.net/OpenSource/SD/
Back to top
View users profile Send private message Add User to Ignore List
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Thu May 03, 2007 9:16 pm    Post subject: Reply to topic Reply with quote

Actually i found a better website

http://www.samspublishing.com/library/content.asp?b=STY_Csharp_24hours&seqNum=178&rl=1

but anyways, i get this error(loook at website for more info) when i try to make a save dialog box, and open dialog box, i'm using docflabby's compiler that he suggested. here is the error:


Code: Show/Hide
Static member 'System.Windows.Forms.DialogResult.Cancel' cannot be accessed with an instance reference; qualify it with a type name instead (CS0176)


this seems like a good and thorough/up to date website. any ideas? ty for any.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:35
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3604
Location: Las Vegas
Offline

PostPosted: Thu May 03, 2007 11:48 pm    Post subject: Reply to topic Reply with quote

Doc Flabby wrote:
But its not a language that is very useful to code games in (too slow).

With OpenGL, any language can be good for normal games. Sure, you won't see the next Unreal or Half-Life engine written in C#, but with things like PyGame, any language can do what top line games 2-3 years ago did.
Back to top
View users profile Send private message Add User to Ignore List Send email
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Fri May 04, 2007 7:14 am    Post subject: Reply to topic Reply with quote

My suggestion would be learn about classes and objects before even trying any to do with windows forms. The error is related to using a class method in the incorrect way as you are trying to call it from an object.
System.Windows.Forms.DialogResult.Cancel is a static (class level) variable. You don't need need to create an object to access it.
The code from the tutorial is correct:
Code: Show/Hide

if (saveFileDialog1.ShowDialog() != DialogResult.Cancel)
   txtDestination.Text = saveFileDialog1.FileName;


Mine GO BOOM wrote:
[..]
With OpenGL, any language can be good for normal games. Sure, you won't see the next Unreal or Half-Life engine written in C#, but with things like PyGame, any language can do what top line games 2-3 years ago did.

I have to admit i just assumed it would be too slow, as i have never done any game programming in languages like python,c# or java, thats interesting.

So would they be any reason why a new subspace client could not be coded in a language such as those?
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:32
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Fri May 04, 2007 8:24 am    Post subject: Reply to topic Reply with quote

Doc Flabby wrote:
So would they be any reason why a new subspace client could not be coded in a language such as those?


Lack of examples, since everyone that's tried hasn't really known what they were doing.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Fri May 04, 2007 2:27 pm    Post subject: Reply to topic Reply with quote

Could someone tell me what a function in C/C++ would be in c#. that way i can look into it more. i'm guessing it's a class or an object by what the tutorial is saying. it be nice to have a comparision is all.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:35
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3604
Location: Las Vegas
Offline

PostPosted: Fri May 04, 2007 7:43 pm    Post subject: Reply to topic Reply with quote

Functions in C# are called methods. If you want a generic function like making your own power of two:
Code: Show/Hide
int pow2(int number)
{
   return number * number;
}

Code: Show/Hide
static class MyMath
{
   static public int pow2(int number)
   {
      return number * number;
   }
}

The static means you can call the function by name MyMath.pow2(3) without having to do anything special about classes. Everything has to be inside a class, but those classes don't have to be treated like objects.
Back to top
View users profile Send private message Add User to Ignore List Send email
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Fri May 04, 2007 10:28 pm    Post subject: Reply to topic Reply with quote

another question, if i wanted to add text into a text box, instead of declaring the text like this:

Code: Show/Hide
textbox.Text = label1.text


what would i do? i suppose you could obtain the current text and then declare the next text;something like this:

Code: Show/Hide
textbox.Text = old_text;
   textbox.text = "%s%s", old_text, new_text;


the only problem there is that i don't know if that is correct in line 2, i'm just using my C language knowledge, i'll have to look more into that.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Samapico
No, these DO NOT look like penises, ok?


Age:32
Gender:Gender:Male
Joined: May 08 2003
Posts: 1252
Location: Montreal, Canada
Offline

PostPosted: Sat May 05, 2007 1:12 am    Post subject: Reply to topic Reply with quote

Code: Show/Hide
string newtext = "thisisnewstuff";

textbox.Text = textbox.Text + newtext;

or
Code: Show/Hide
string newtext = "thisisnewstuff";
textbox.Text += newtext;

would work as well
_________________
DCME co-developer
17th Parallel Head Sysop
Subspace: The Future
Back to top
View users profile Send private message Add User to Ignore List
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Mon May 14, 2007 9:10 pm    Post subject: Reply to topic Reply with quote

back to the idea of savedialog and open dialogue.

i got it to work, although, i am required to have a textbox named "txtSource" on my application according to this website:
http://www.samspublishing.com/library/content.asp?b=STY_Csharp_24hours&seqNum=178&rl=1

i KNOW theres a way w/out a textbox. could someone explain where im going wrong? gracias.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:35
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3604
Location: Las Vegas
Offline

PostPosted: Tue May 15, 2007 12:51 am    Post subject: Reply to topic Reply with quote

That is only an example they use to show you that it selected that file. You can save the open dialog result to any string variable.
Back to top
View users profile Send private message Add User to Ignore List Send email
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Tue May 15, 2007 6:21 pm    Post subject: Reply to topic Reply with quote

Ok, so i don't even need that coding? I'll try that. Also, my savedialogue doesn't seem to work. It acts as if it is saving, but when i go to open it it isn't there. Do i need to code the saving part?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Bak
?ls -s
0 in


Age:19
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Tue May 15, 2007 7:36 pm    Post subject: Reply to topic Reply with quote

yes, all the save dialog will do it tell you where they want to save the file.
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 82 page(s) served in previous 5 minutes.

phpBB Created this page in 0.142786 seconds : 49 queries executed (34.2%): GZIP compression disabled