dev-cpp-users Mailing List for Dev-C++ (Page 120)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: yakir a. <ya...@za...> - 2005-07-11 18:33:03
|
Hi Hey man!,are you joking with me? Wow,I can send emails and such?... That is a bit unnice of you to say sucha thing There are lots of blind programmers hoo are 16 or 18 years old,so don't think I'm the first! And today's technology lets us [blind or vi people] do every thing a sighted person would do with his comp,including programming! There are people my age[16] that programm very highly complikated audio games using not only x and y axess But the z axes that makes it even more difficult So that is not the problem, the problem is understanding some basics , and then from there make it grow and grow! And that's mainly what I wanna know! How do you get to the min gw compilet with out using the ide? Thanks yakir |
|
From: yakir a. <ya...@za...> - 2005-07-11 15:14:33
|
Hi To verne: I don't think you know it yet,but in a privius post I sed I am blind,and therefor use a screen reader So I can't really understand what you are talking about if you don't explain it in a rother more text langwij ,other then telling me to clik on compiler tab or what ever. In a privius post someone rote I'd better use notepad then using an ide, because wile writing your code with an ide it can get confusing [to someone like me that uses a screen reader] So I just nead to understand the simple things for now It's not the complicated stuf I nead to know right now,I have the books for that perpes I also have "thinking in c++ second adition"[vol one and two] But that's not what I'm talking about; What I nead to do in order tu write,compile,and run something I write[even if it's just a "hello world"program] Someone sed It's better I write my code in notepad or wordpad And then paste it to the compiler Can someboddy tell me how do I access the compiler with out runing devc.exe But don't get my word[ maby I'm mistaking]and there is another method of doing this simple thing in an easer way So please try to explain the steps for that ,and what is the command line Thanks again yakir |
|
From: yakir a. <ya...@za...> - 2005-07-11 13:26:46
|
Hi per w, Thanks about the info man,that pruves to be very helpful to me But let me just understand ya: So you say it's better I write the code in notepad,and save it as"hello.cpp",and don't use devc.exe I mean,how can I use the tules with out the ide? How do I get to the command line from the dev-c++ directory? And after I save the file as"hello.cpp",I just go to the command line and type"hello.cpp o- hello.exe"? And it will be compiled for me? Thanks a lot,you are really helping me a lot man! Thanks Regards yakir |
|
From: Jonathan D. <gri...@ho...> - 2005-07-11 12:51:13
|
Hey, It doesn't seem like you ever got the answers to your questions. The guys on this list are really advanced users mostly and might mistake your questions for higher level ones. First of all, to compile with Dev-C++ into a .exe file, you must create a project. If you didn't do this, it could be your problem. Create a new project then add a source file to it (make sure that the source file is added to the project). Type in your code and compile the project. That'll put it into an executable in the same directory as the project file. The whole situation of namespaces and all that C++ language stuff is unneccessary to know unless you plan on being a professional or otherwise really need to use up-to-date language. The book you've been using is perfectly fine if you're just starting out. Don't worry about the complicated reasons of why they decided to remove the ".h" and all that. If you'd like to open Verne's book, you need Adobe Acrobat Reader. You can run a search for it on Google (www.google.com) and go to the official website. I believe it comes in every language, so that should help a lot. I hope this all helps. _________________________________________________________________ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement |
|
From: Per W. <pw...@ia...> - 2005-07-11 12:51:03
|
It's a bit hard to read the output you cut from the display - and I guess
it is even harder for you to get an idea of the output by the use of a
screen reader.
Note that DevC++ can generate both graphical Windows applications, and
text-only console applications.
The line "return DefWindowProc(...)" is part of a graphical application.
It looks from your dump that you have both a couple of lines remaining
from a graphical application (automatically created by DevC++ when you
created a new project) and your new lines for the "hello world"
application. This results in a lot of strange error messages, since the
compiler doesn't know what you are trying to do.
DevC++ is an IDE for generating applications. For a blind, it might
actually be better to write the code in a normal text editor instead of
using a full IDE. Compilation can then be made directly from the command
line in another window.
A graphical environment often "helps" with a lot of automatic actions that
are hard to notice by the use of a screen reader. When writing code, the
IDE can pop up code-completion dialogs above the source code. The
syntax highlighting changes the look of the text to describe
variables, numeric constants and so on. When writing a parenthesis,
the corresponding parenthesis is automatically visually enhanced and
so on. When compiling, the output gets filtered and put in different
output tabs etc.
When starting to learn a new language, it is easiest to write command line
applications. Then it is possible to focus on the language, instead of
learning how to code for a specific target system. With increased
knowledge of language and tools, it is then easier to start targeting a
specific platform.
The book file you have with extension pdf is read using a program called
Acrobat Reader. However, it isn't so simple to give a link for direct
download - when reaching the web page for Adobe, you have to answer a
number of questions before finally being able to download and install the
reader software. There are a couple of freeware applications that can
display pdf files, but they are not so simple to install or use. Adobe
have a lot of money available to make the reader easy to use - they charge
a lot for the application that creates pdf files.
The compiler available with DevC++ is very good. It's called MinGW, and is
a Windows version of the gcc compiler that exists for just about all
computer systems in existence. The only compiler I know about that can
auto-correct errors is a IBM-developed compiler that makes guesses when
finding incorrectly spelled symbols. However, even if this feature might
sound nice, you don't want it. It isn't too hard to manually correct any
errors, and by doing so, the code can build using onther compilers too.
In short: I would say simplicity is best. Use the available tools in a way
that your screen reader can perform to it's best. My guess is that this
means to ignore the use of an integrated development environment and make
use of the build tools directly.
If a "hello world" application is stored in the file "hello.cpp", it is
possible to build it with the command:
g++ hello.cpp -o hello.exe
and then run it with the command
hello
from the commad line.
/Per W
On Mon, 11 Jul 2005, yakir arbib wrote:
> Hi to all
> So I tried compiling again "hello world"
> I went to new project, and there was another pees of code before what I
> rote ,witch I didn't know what to do with
> And hear is the result:
> Dev-C++ 4.9.9.2 - [ Project1 ] - starting.dev
> File Edit Search View Project Execute Debug Tools CVS Window Help
> New Insert Toggle Goto
> (globals)
> Project main.cClasses Debug
> Project1 return DefWindowProc (hwnd, message, wParam,
> lParam);
> }
> return 0;
> }
> include <iostream>
> include <csdlib>
> using namespace std;
> int main();
> Compiler Resources Compile Log Debug Find Results Close
> Line File Message
> 89 C:\Dev-Cpp\main.c syntax error before '<' token
> 94 C:\Dev-Cpp\main.c syntax error before '{' token
> 96 C:\Dev-Cpp\main.c syntax error before string constant
> 96 C:\Dev-Cpp\main.c [Warning] data definition has no type or storage
> class
> C:\Dev-Cpp\Makefile.win [Build Error] [main.o] Error 1
> 91: 1 Insert 99 Lines in file
> Now,it is all like chinese to me[smile],but can you help me
> With understanding what the errors wher,and what I have to do in order
> to get it right?
> Thanks a lot
> Best regards
> yakir
>
|
|
From: yakir a. <ya...@za...> - 2005-07-11 08:46:23
|
Hi to all
So I tried compiling again "hello world"
I went to new project, and there was another pees of code before what I
rote ,witch I didn't know what to do with
And hear is the result:
Dev-C++ 4.9.9.2 - [ Project1 ] - starting.dev
File Edit Search View Project Execute Debug Tools CVS Window Help
New Insert Toggle Goto
(globals)
Project main.cClasses Debug
Project1 return DefWindowProc (hwnd, message, wParam,
lParam);
}
return 0;
}
include <iostream>
include <csdlib>
using namespace std;
int main();
Compiler Resources Compile Log Debug Find Results Close
Line File Message
89 C:\Dev-Cpp\main.c syntax error before '<' token
94 C:\Dev-Cpp\main.c syntax error before '{' token
96 C:\Dev-Cpp\main.c syntax error before string constant
96 C:\Dev-Cpp\main.c [Warning] data definition has no type or storage
class
C:\Dev-Cpp\Makefile.win [Build Error] [main.o] Error 1
91: 1 Insert 99 Lines in file
Now,it is all like chinese to me[smile],but can you help me
With understanding what the errors wher,and what I have to do in order
to get it right?
Thanks a lot
Best regards
yakir
|
|
From: yakir a. <ya...@za...> - 2005-07-11 07:31:26
|
Hi So ok,I got some backrounds and other usefull stuf from a lot of people hear,and I'm glad they are willing to help But now,I think it'll be better I continue with my book"teach your self c++ in 21 days" And some other books I downloaded like "thinking in c++[second adition]"; And I'll ask somquestions when I run in to problems But how ever,to get me started ,I think I nead a cupple more questions answered: I have the devc++ compiler[that comes with ide packej] But maby I should use another compiler like borlands compiler,or some thing like that. Because,I don't want to include other lines in the code , just because I have this compiler If there is a better compiler,that you don't have to write special things in the code in order to get it to work,I'll be glad to know [it will be useful to have a compiler that corects your code also] And another thing,to vene: So ok,you sed I'm to stik with my book,wile reading your book at the same time,but can you give me a simple way to open the book in a way I'll be able to read it? Thanks a lot You've bin a grate help yakir |
|
From: lordSauron <lor...@gm...> - 2005-07-11 03:34:12
|
On 7/10/05, yakir arbib <ya...@za...> wrote: > Hi verne=20 >=20 > You told me to slo down=20 >=20 > Well, you are saying things I cant understand=20 >=20 > What's that code you pasted there?=20 >=20 > And can't I open the book with note pad or word?=20 >=20 > If not, please give me the readers url,so I can download it and read the > book=20 >=20 > And do you think I should leav the book I'm reading now aside?=20 Read them both, use them both. I find that some authors leave some things rather in the dark, whereas others go into them in great detail. I have one book which spends 5 pages on arrays, and another that spends 50! Don't worry, arrays aren't that hard, and once you've got the idea, they're really quite handy. Also, ensure that you're all replying to <dev...@li...> b/c I think we're missing parts of conversations. |
|
From: Rov <yel...@co...> - 2005-07-10 23:05:15
|
I have downloaded the latest version of Dev-C++ and when I went to = install it, I saw the message, "Do not install on top of an existing = installation". Ok then, There is no un-install on the previous version, = and it does not appear in the add & Remove menu either. So could I just = delete the previous folder to do the install? or is there a trick I = should know about first? Norm. |
|
From: yakir a. <ya...@za...> - 2005-07-10 21:47:31
|
Hi verne You told me to slo down Well, you are saying things I cant understand What's that code you pasted there? And can't I open the book with note pad or word? If not, please give me the readers url,so I can download it and read the book And do you think I should leav the book I'm reading now aside? Or read them both Thx yakir |
|
From: Per W. <pw...@ia...> - 2005-07-10 20:48:08
|
Yes, the MinGW compiler that is supplied with DevC++ do support applications using older standards. All compilers should support the previous standard, so as not to break existing applications. However, I really recommend that you from the start try to learn the changes needed to follow the most recent standard. I recommend that someone else help you with the available keystrokes to create a new project and compile run it. I too often use tools in ways they were not intended to be used ;) /Per W On Sun, 10 Jul 2005, yakir arbib wrote: > Hi > So you say ,I can stil learn with my book [all though it doesn't > represent the new updates and chainjes in c++?] > You say that if I learn all the basics in c++,it wont be hard to learn > the minor updates after I learn the langwij? > P.s about word checker or what ever, I can't use it[I use a screen > reader, and it doesn't all ways work good with those spelling programs] > So please forgive me for that > Regards > yakir > |
|
From: yakir a. <ya...@za...> - 2005-07-10 20:46:57
|
Hi verne Thanks for the book man Only problem is,I don't know with what I should open the book[.pdf],what does it mean? I tried opening it with notepad,but it just shos ya a lot of numbers and simballs,and not the book it self Can you tell me how should I open it And do you think I should leav my current book I'm reading now "teach your self c++ in 21 days"? Thanks yakir |
|
From: lordSauron <lor...@gm...> - 2005-07-10 20:43:39
|
okay yeah, and that's why we're here too... to help people. |
|
From: lordSauron <lor...@gm...> - 2005-07-10 20:41:46
|
On 7/10/05, yakir arbib <ya...@za...> wrote:
> =20
>=20
> Hi per w=20
>=20
> So if you say I can stil use the .h extention,why should I use another
> thing?=20
It's more uptodate. The other is still there more as a matter or
convienience, that's all.
> And do you perhaps know about a book for starters[that has those updates=
?]=20
notoff the top of my head, no.
> And my skope with c++ for now is to get to objekt oriented programming=20
do you think mispelling things is funny, or are you really having a
problem here?
class whatever {
public:
whatever () {
// something goes here
}; // don't forget the semicolon
}; // don't forget the semicolon
> I mean ,I want to creat audio games[that use only sound as it's mane
> invirenment]=20
Good luck. I'm not aware of much demand, though.
> So please, If some one knows,please give me a book name [that has the new
> c++ updates]=20
> And I stil want a step by step explanation on how I compile link and run =
my
> code[with short cuts]=20
Step 1: write code
Step 2: compile code [control+F9]
IF (errorless_compile =3D=3D false) GOTO Step 1;
Step 3: run program [control+F10]
REPEAT AS NECESSARY
|
|
From: yakir a. <ya...@za...> - 2005-07-10 20:34:14
|
Hi So you say ,I can stil learn with my book [all though it doesn't represent the new updates and chainjes in c++?] You say that if I learn all the basics in c++,it wont be hard to learn the minor updates after I learn the langwij? P.s about word checker or what ever, I can't use it[I use a screen reader, and it doesn't all ways work good with those spelling programs] So please forgive me for that Regards yakir |
|
From: yakir a. <ya...@za...> - 2005-07-10 20:07:43
|
Hi per w So if you say I can stil use the .h extention,why should I use another thing? And do you perhaps know about a book for starters[that has those updates?] And my skope with c++ for now is to get to objekt oriented programming I mean ,I want to creat audio games[that use only sound as it's mane invirenment] So please, If some one knows,please give me a book name [that has the new c++ updates] And I stil want a step by step explanation on how I compile link and run my code[with short cuts] Thanks Regards yakir |
|
From: William Mc C. <wil...@ms...> - 2005-07-10 19:48:00
|
Hi:
Does anyone know of any Tutorials or examples using TAPI.
Thanks, in advance.
Sincerely,
William McCoy
p.s. It was very easy to use under IBM's REXX language. |
|
From: Per W. <pw...@ia...> - 2005-07-10 19:38:10
|
Yes, you can use #include <iostream.h> as it says in the book. However, the recommendation is to write #include <iostream> and then either write using std::cout; using std::endl; or change the output line to: std::cout << "Hello world" << std::endl; /Per W |
|
From: Per W. <pw...@ia...> - 2005-07-10 19:33:10
|
That book was written before the latest C++ standard update. A large number of older C include files have now received new names, such as stdio.h is renamed to cstdio.h, stdlib.h is renamed to cstdlib and so on. Second, all new C++ include files (and the old C include files hat got renamed) have dropped the ".h" extension. Third, the C++ symbols have moved into a new std:: namespace, to reduce problems with updates of the C++ standard resulting in name collisions with symbols already in use in existing software. By using the old include file names, you can still build "hello world" applications according to the old standard. However, the recommendation is that all new code should be rewritten to follow the current C++ standard. Buy following the current standard, you will have fewer problems in the future, where the size of your code increases or with future C++ standard updates. The code you supplied - with the exception of capital characters at start of a number of symbols - is correct for an old-style "hello world". The code you seem to have already received by other people will most probably be the recommended coding style for a new-style "hello world" application. /Per W |
|
From: yakir a. <ya...@za...> - 2005-07-10 19:22:21
|
Hi Thanks a lot for the info But there is something you puzled me with,you probobly ment c++ didn't you? And now the moast moast moast inpportant thing for me to know: Ok,there are a lot of ways to wright "hello world"or any other programs what ever But can I use any one I like ,I mean Can I type: #include <iostream.h> Instead of: #include <iostream> Or there is something I should know regarding bloodshed particularly Cause in my book it says to wright it that way[.h>] And now! Can someone familyare with bloodshed tell me the steps in order to creat a program from starting point I mean, I wright the code then?... Can you tell me the key strokes for doing all the linking and compiling actions? I'd really be happy and glad to know Thanks yakir |
|
From: yakir a. <ya...@za...> - 2005-07-10 18:06:52
|
Dear dave
In fackt,you have bin a grate help for me
You gave me a good backround on everything[witch is wright what I nead
rite now]
But there are stil some questions I would like you to answer if you can:
From what I can understand in your mail, you say I can use ansi or iso
with all compilers
But can I use ansi and iso wile in the same code?
I mean,I don't know if you know it but "teach your self c++ in 21
days",is the book that I'm reading
And from what I can remember ,it uses ansi, but after giving the code
for wrighting "hello world!",they sed to check something[I can't
remember what exaktly], with your compiler ,and that maby there is
another line of code requiered for your compiler to code"hello world!"
So do you think I should stik with the book?
Oh,maby it will be good that I'll wright the code given in the book:
#include <iostream.h>
Int main()
{
Cout << "Hello World!\n";
Return 0;
}
Can you tell me,if with this form of code I can code "hello world!" with
bloodshed
I'm sorry to sound so stupid
Thanks a lot again for your first mail
Best regards
yakir
|
|
From: yakir a. <ya...@za...> - 2005-07-10 16:08:37
|
Hi Verne, the code you gave me is longer then the one in "teach your self c++ in 21 days" And also the other dude gave me another code for this problem Maby it doesn't really matters how you wright it , I mean,maby there are more then one ways to wright "Hello World!" And do you nead to learn an all moast intaier other tipe of c++ to compile with bloodshed? There gos your answer man You asked me what compiler do I use I use the latest version of bloodshed But if you have another [and maby more simple] compiler to recommand me, I'll appreciate that But I'm getten despret, so every thing I'll learn,will have to be chainjed by the new tipe of c++? Or I can learn it with another book perhaps,cause I don't wanna lear something,and find it unusefuall after Thanks yakir |
|
From: yakir a. <ya...@za...> - 2005-07-10 14:04:50
|
Hi to all I'm a new c++ user, I downloaded several online books,like "teach your self c++ in21 days"and so and so. Now I'm in wrighting my first program "hello world!" Now my problem is : I type in the code from the book And choos compile[control+f9] Then when the prosess finishes[5 seks or so], I choos run But it says:worning!,not compiled Where do I find the .obj file that I can run Please help me, I really don't know what to do[considering I don't know the c++ langwij yet] P.s I'm blind,so I use a screen reader for my codings and all other computer actions I'd appreciate any help Thanks a lot yakir |
|
From: Robert A. <ral...@gm...> - 2005-07-09 13:58:29
|
Also, note that not all line wraps actually add a newline...sometimes
they ONLY wrap the display and allow the line to remain a long line in
the file. Possibly without a linefeed at all.
-Robert
On 7/8/05, Noorez Kassam <lor...@ho...> wrote:
> I am having trouble with reading from a text file in my program. For
> testing, I used notepad and typed and let word-wrap put text on the next
> line. I typed a lot into this file. I then used my program to try and ope=
n
> it but it froze. If I use the enter key to put in the newline then my
> program works. Whats wrong with it?
>=20
> #include "SML.h"
>=20
> // Function called from WindowProcedure to open text
> void OpenText(HWND main, HWND hEdit)
> {
> ifstream openTextFile; // Handle to file
>=20
> // Filter files visible in the open dialog box
> char* filter =3D "Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0\0";
>=20
> char* inLine =3D new char[900];
>=20
> int nLength;
>=20
> // Init the properties of the open dialog box
> getOFNproperties(main, &dialogProperties, currentFileName, filter);
>=20
> // Show the dialog and get the information
> if( !GetOpenFileName(&dialogProperties) )
> {
> return; // Return if user cancels
> }
>=20
> openTextFile.open(currentFileName);
>=20
> SetDlgItemText(main, IDC_MAIN_EDIT, ""); // Clear the edit control
>=20
> int cntr =3D 1;
>=20
> // Loop unitl the end of file is reached
> while( !openTextFile.eof() )
> {
> nLength =3D GetWindowTextLength(GetDlgItem(main, IDC_MAIN_EDIT));
> openTextFile.getline(inLine,9000);
>=20
> // A new line must have a "\r\n" so test for both
> if( inLine[ strlen(inLine) -1 ] !=3D '\r' )
> {
> strcat(inLine,"\r");
> }
> if( inLine[ strlen(inLine) -1] !=3D '\n' )
> {
> strcat(inLine,"\n");
> }
>=20
> // And the message onto the edit control
> SendMessage( GetDlgItem(main, IDC_MAIN_EDIT), EM_SETSEL,
> (WPARAM)nLength,
> (LPARAM)nLength );
>=20
> SendMessage( GetDlgItem(main, IDC_MAIN_EDIT), EM_REPLACESEL,
> (WPARAM)FALSE,
> (LPARAM)inLine );
> delete inLine;
> inLine =3D new char[900];
> }
>=20
> untitled =3D false;
> edited =3D false;
> return;
> }
>=20
> _________________________________________________________________
> Designer Mail isn't just fun to send, it's fun to receive. Use special
> stationery, fonts and colors.
> http://join.msn.com/?pgmarket=3Den-ca&page=3Dbyoa/prem&xAPID=3D1994&DI=3D=
1034&SU=3Dhttp://hotmail.com/enca&HL=3DMarket_MSNIS_Taglines
> Start enjoying all the benefits of MSN(r) Premium right now and get the
> first two months FREE*.
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happen=
ing
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by H=
P,
> AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Per W. <pw...@ia...> - 2005-07-09 10:19:32
|
Ever heard anyone say that constant numbers within the code is bad? char* inLine = new char[900]; ... openTextFile.getline(inLine,9000); How do you expect 9000 characters to fit into a 900 char buffer? And more - how to you expect to have the extra room to possibly concatenate "\r\n" to the end of the line? By the way, why do you mix C and C++ code? Why not use the std::string class? /Per W On Fri, 8 Jul 2005, Noorez Kassam wrote: > I am having trouble with reading from a text file in my program. For > testing, I used notepad and typed and let word-wrap put text on the next > line. I typed a lot into this file. I then used my program to try and open > it but it froze. If I use the enter key to put in the newline then my > program works. Whats wrong with it? |