Archived

This topic is now archived and is closed to further replies.

Windows Buttons

This topic is 5744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m making a simple Window Program to convert a text file to a dat file, and visa versa...and would like to know how to get the buttons working correctly. If you care about her/him, you''''ll listen If you love her/him, you''''ll heal his/her wounds If you like her/him, you''''ll do all of the above, and help her/him in need A person who cares is a person who never speaks

Share this post


Link to post
Share on other sites
why even use buttons? use a console interface or make it a commandline app. since you dont seem to need much input for what your doing (source file, dest file, and maybe conversion type if the converter cant figure out by the files extension/headers)

Share this post


Link to post
Share on other sites
If someone can tell me a link or something to a tutorial on how to do a console app with command lines, then i''ll be happy to do that instead.

If you care about her/him, you''''ll listen
If you love her/him, you''''ll heal his/her wounds
If you like her/him, you''''ll do all of the above, and help her/him in need

A person who cares is a person who never speaks

Share this post


Link to post
Share on other sites
quote:
Original post by Quantrizi
If someone can tell me a link or something to a tutorial on how to do a console app with command lines, then i''ll be happy to do that instead.



Um... are you serious?

Here''s some boilerplate...


  
/* --- The following code comes from c:\lcc\lib\wizard\textmode.tpl. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void Usage(char *programName)
{
fprintf(stderr,"%s usage:\n",programName);
/* Modify here to add your usage message when the program is
* called without arguments */
}

/* returns the index of the first argument that is not an option; i.e.
does not start with a dash or a slash
*/
int HandleOptions(int argc,char *argv[])
{
int i,firstnonoption=0;

for (i=1; i< argc;i++) {
if (argv[i][0] == ''/'' || argv[i][0] == ''-'') {
switch (argv[i][1]) {
/* An argument -? means help is requested */
case ''?'':
Usage(argv[0]);
break;
case ''h'':
case ''H'':
if (!stricmp(argv[i]+1,"help")) {
Usage(argv[0]);
break;
}
/* If the option -h means anything else
* in your application add code here
* Note: this falls through to the default
* to print an "unknow option" message
*/
/* add your option switches here */
default:
fprintf(stderr,"unknown option %s\n",argv[i]);
break;
}
}
else {
firstnonoption = i;
break;
}
}
return firstnonoption;
}

int main(int argc,char *argv[])
{
if (argc == 1) {
/* If no arguments we call the Usage routine and exit */
Usage(argv[0]);
return 1;
}
/* handle the program options */
HandleOptions(argc,argv);
/* The code of your application goes here */

return 0;
}

Share this post


Link to post
Share on other sites
Yes, I''m serious. If anyone here has played StarCraft, and used MPQ2K, they know what I want

If you care about her/him, you''''ll listen
If you love her/him, you''''ll heal his/her wounds
If you like her/him, you''''ll do all of the above, and help her/him in need

A person who cares is a person who never speaks

Share this post


Link to post
Share on other sites
quote:
Original post by Quantrizi
Yes, I''m serious. If anyone here has played StarCraft, and used MPQ2K, they know what I want


I''ve played StarCraft/Broodwar etc. I''ve also looked at a couple of MPQ ''rippers'' or what not - storm.dll comes to mind. I also recall an article describing the particulars of the mpq format - last I checked the page was 404. But - having that knowledge doesn''t translate into a program - there''s a lot more to it you know? I ask if you''re serious because using the command line seems like such a basic C/C++ task, that when you ask how to do it makes me wonder if you know how to program at all....

Share this post


Link to post
Share on other sites
Yes, I know how to do some really basic stuff*char, and stuff like that*

If you care about her/him, you''''ll listen
If you love her/him, you''''ll heal his/her wounds
If you like her/him, you''''ll do all of the above, and help her/him in need

A person who cares is a person who never speaks

Share this post


Link to post
Share on other sites
Thanx. I''m gonna d/l the source.

If you care about her/him, you''''ll listen
If you love her/him, you''''ll heal his/her wounds
If you like her/him, you''''ll do all of the above, and help her/him in need

A person who cares is a person who never speaks

Share this post


Link to post
Share on other sites