-
June 30th, 2014, 09:44 AM
#1
interphace graphique en C/c++ bloodshed dev c++
I'm not smart in graphic interface, can somebody help me to write a source code that creates menu browser/
here is my small programme
#include <istream>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <ctype.h>
#include <sys\stat.h>
#include <fcntl.h>
#include <io.h>
#include <conio.h>
#include <errno.h>
#include <cstring>
#include <fstream>
#include <windows.h>
#include <unistd.h>
//==============================================================
int restart;
char xfile[81];
char xfile1[81];
char code1[10000] = "0123456789";
char next[10];
char input[50] = "word1.doc";
char output[50] = "word2.doc";
unsigned char code,coded,recoded,unsigneddata,data,erase1 = 44;
unsigned doublecode = 150;
char lettre,size,bell1=07;
char char1,choice1[1];
FILE *text_file1 = NULL;
FILE *text_file2 = NULL;
int choice,len_input,len_output,flag;
int n,n2,length_code, end_file;
double length_file,max_size=3000000;
//=====================
inline void get();
//==============================================================
// this function gets the in put and output
inline void get()
{
SYSTEMTIME t;
GetSystemTime(&t);
printf("%d-%d-%d %d:%d:%d \n",t.wDay,t.wMonth,t.wYear,t.wHour,t.wMinute,t.wSecond);
start4:;
printf ("====>minimum size 10 characters, maximum size 10000 characters \n");
printf ("====>Type the vector then enter\n");
fgets(code1, sizeof(code1),stdin);
length_code = strlen(code1)-1;
if ((length_code> 9)&& (length_code<10001)) {goto start2;};
system("cls"); printf("\n");
printf("====>The length of vector is equal to %d\n",length_code );
printf("\n");
goto start4;
start2:
choice = 0;
printf("\n");printf("\n");
printf ("====>Type 1 for process 1 or type 2 for process 2 and then enter\n");
printf ("====>Type 3 to exit\n");
scanf("%d", &choice);
while (getchar()!= '\n');// empty buffer
if ( choice == 1 ){goto ahead1;}
if ( choice == 2 ){goto ahead1;}
printf("\n");printf("\n");
system("cls");
printf("====>Wrong choice \n");
goto start4;
ahead1:
//=========================================================
start3:
printf("\n");
if (choice == 1)
{
printf ("====>Type the name of the input file, EXAMPLE name1.doc then enter\n");
scanf("%s", &input);
printf ("====>The name of the input is %s\n",input);
};
if (choice == 2)
{
printf ("====>Type the name of the output file, EXAMPLE name2.doc then enter\n");
scanf("%s", &output);
printf ("====>The name of the input is %s\n",output);
};
}
//==============================================================
// the main program
//==============================================================
int main()
{
printf("\n");
printf("============================\n");
printf("\n");
printf("DESIGNED BY JOSEPH NDURIRI TOULOUSE FRANCE\n");
printf("Email nduriri@voila.fr\n");
printf("Phone +33(0)679922232 FRANCE\n");
printf("\n");
printf("============================\n");
SYSTEMTIME t;
GetSystemTime(&t);
printf("%d-%d-%d %d:%d:%d \n",t.wDay,t.wMonth,t.wYear,t.wHour,t.wMinute,t.wSecond);
start1:;
get();
printf("====>end ++++++++++++++++++++++++++++++++++\n");
printf("====>To go on type a character to start once more\n");
scanf("%s", xfile1);
while (getchar()!= '\n');// empty buffer
system("cls"); //clear screen
goto start1;
return 0;
}
-
June 30th, 2014, 10:46 AM
#2
Re: interphace graphique en C/c++ bloodshed dev c++
First, please read Announcement: Before you post.... and learn how to use Code tags while posting code snippet. Without Code tags it is impossible to read/understand the code.
Second, what do you mean by "graphic interface"? Nothing in your code snippet looks like something "graphical".
Third, C++ is the language that allows you to write code without using goto and lables. So please, consider to rewrite it!
Victor Nijegorodov
-
July 8th, 2014, 10:39 AM
#3
Re: interphace graphique en C/c++ bloodshed dev c++
-
July 8th, 2014, 10:44 AM
#4
Re: interphace graphique en C/c++ bloodshed dev c++
Originally Posted by VictorN
First, please read Announcement: Before you post.... and learn how to use Code tags while posting code snippet. Without Code tags it is impossible to read/understand the code.
Second, what do you mean by "graphic interface"? Nothing in your code snippet looks like something "graphical".
Third, C++ is the language that allows you to write code without using goto and lables. So please, consider to rewrite it!
You know long time ago I used to program in basic language wheen I was young and there was alot of goto instructions
-
July 8th, 2014, 10:50 AM
#5
Re: interphace graphique en C/c++ bloodshed dev c++
Originally Posted by nduriri
You know long time ago I used to program in basic language wheen I was young and there was alot of goto instructions
Well I remeber the the epoch of basic!
But now we are in the world of C++. So try to forget that goto ever existed!
Victor Nijegorodov
-
July 9th, 2014, 10:36 AM
#6
Re: interphace graphique en C/c++ bloodshed dev c++
Originally Posted by VictorN
Well I remeber the the epoch of basic!
But now we are in the world of C++. So try to forget that goto ever existed!
Thanks, do you have an example where I can create a window? Just to create a window with a screen where to type choices.
Please help me. Thanks in advance
-
July 9th, 2014, 10:41 AM
#7
Re: interphace graphique en C/c++ bloodshed dev c++
Do you mean an example of some console application or the one with GUI?
Victor Nijegorodov
-
July 9th, 2014, 11:54 AM
#8
Re: interphace graphique en C/c++ bloodshed dev c++
Originally Posted by VictorN
Do you mean an example of some console application or the one with GUI?
A console please of a code source under windows XP. please.
Thanks in advance
-
July 9th, 2014, 11:55 AM
#9
Re: interphace graphique en C/c++ bloodshed dev c++
I do not develop console applications. Try to google for examples yourself.
Victor Nijegorodov
-
July 9th, 2014, 02:42 PM
#10
Re: interphace graphique en C/c++ bloodshed dev c++
Originally Posted by nduriri
Thanks, do you have an example where I can create a window? Just to create a window with a screen where to type choices.
Please help me. Thanks in advance
I don't quite understand what you are after. If you want to create windows then you use the WIN32 STK API's or MFC or some other graphical/window package. If the application is a console program then you can use the console as a window by using the console set of API's. You can create 'windows' from a 'console' application but unless you have experience of the WIN32 STK I won't suggest it.
Perhaps if you explained in more detail of what you are trying to achieve we may be able to advise further.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
July 10th, 2014, 07:37 AM
#11
Re: interphace graphique en C/c++ bloodshed dev c++
Originally Posted by 2kaud
I don't quite understand what you are after. If you want to create windows then you use the WIN32 STK API's or MFC or some other graphical/window package. If the application is a console program then you can use the console as a window by using the console set of API's. You can create 'windows' from a 'console' application but unless you have experience of the WIN32 STK I won't suggest it.
Perhaps if you explained in more detail of what you are trying to achieve we may be able to advise further.
I want to write an application on crypting, if you have a small program on win32 please send me the copy
-
July 10th, 2014, 07:53 AM
#12
Re: interphace graphique en C/c++ bloodshed dev c++
Originally Posted by nduriri
I want to write an application on crypting, if you have a small program on win32 please send me the copy
What does that have to do with your original post? You really need to clarify, hopefully with more than one sentence, what it is you're really trying to do.
-
July 10th, 2014, 08:20 AM
#13
Re: interphace graphique en C/c++ bloodshed dev c++
Crypting what? There are several 'free' encryption programs around that can be incorporated into your own program (eg see http://cboard.cprogramming.com/c-pro...fish-algo.html) for one example. I would strongly advise against writing your own crypting program from scratch. These crypting programs can be used with 'c' or 'c++' whether you use console, WIN32, gui etc.
As GCDEF mentioned, you need to provide more detailed info about what it is you are trying to achieve.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
July 10th, 2014, 08:42 AM
#14
Re: interphace graphique en C/c++ bloodshed dev c++
Originally Posted by 2kaud
Crypting what? There are several 'free' encryption programs around that can be incorporated into your own program (eg see http://cboard.cprogramming.com/c-pro...fish-algo.html) for one example. I would strongly advise against writing your own crypting program from scratch. These crypting programs can be used with 'c' or 'c++' whether you use console, WIN32, gui etc.
As GCDEF mentioned, you need to provide more detailed info about what it is you are trying to achieve.
My cryting is vectorial, the pass word can go up to 1 million alphanumeric characters. The pass is written in a texte file. There is no way of getting the pass word. Im waiting for the french authorities to get permission. My application can crypte any file .doc, .pdf, .jpg, audio or DVD. Its better than EFS. Wait Ill release it next year. Thanks for your reply
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|