dev-cpp-users Mailing List for Dev-C++ (Page 148)
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: jack c. <jac...@ya...> - 2005-02-26 21:51:43
|
--------------------------------- Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. |
|
From: Malcolm N. <m.n...@wa...> - 2005-02-26 13:32:52
|
Hello Stanimir, On 26 February 2005, 14:07:33, you wrote: > Hi all > How to connect to MySQL DataBase ? > I'm use DevCPP 4.9.9.1 ..... First look a little on Google, and see if the results offer a little help: http://sptk.tts-sf.com/docs/devcpp/mysql.htm http://sptk.tts-sf.com/docs/devcpp/libmysql.htm You might then consider searching the archives, possibly resulting in http://sourceforge.net/forum/message.php?msg_id=2395648 http://sourceforge.net/forum/message.php?msg_id=2396972 among others. You have installed the mySQL devpak right?, and tried to build the sample prog included? -- Best regards, Malcolm mailto:m.n...@wa... |
|
From: hap0 <7i...@gm...> - 2005-02-26 01:33:31
|
For the record/archives, and all those who have asked before, and whom venture back to ask again: The following opportunity does exist and is well documented for those who may be interested in learning/experimenting more about working with QT: The QT3/Windows Free Edition is a native win32 port of the gpl=B4ed qt/x11 sources. It uses the native win32 api and does not require cygwin. Complete instructions for utilizing Dev-C++ as an alternative IDE and frontend for coding QT3 apps can be found here: http://kde-cygwin.sourceforge.net/qt3-win32/devcpp.php Cheers, Nate |
|
From: Ray K. <kul...@wr...> - 2005-02-26 00:50:40
|
On Fri, 25 Feb 2005 15:01:15 -0800, Farzan Hajian wrote:
> Hi,
> I have two different questions:
> -------------------------------------------
> The First:
> What is a static function? For example what is the difference
> between the following function and its non-static version??
> //Static Version:
> Static int MyFunc(int n)
> {
> return n*2;
> }
> //Non-Static Version:
> int MyFunc(int n)
> {
> return n*2;
> }
"static" for a function means the same thing as "const" for a
variable. If you declare a function static, the compiler won't
let you give separate definitions for the function in
different source files.
By the way, C++ is case sensitive, so you need to type
"static" instead of "Static". Otherwise, you might get some
points taken off for this question.
> The Second:
> How can I overload the "<<" operator?
> Thanks,
You didn't mention what datatype you wanted to overload it
for, so I used a char*. It should be easy enough to convert
this method to use another datatype.
/*****************************************************/
char *overload(std::ostream &out, char *p) {
return (char*)((unsigned)p << (unsigned)&out);
}
cout << overload(cout, "cheater");
/*****************************************************/
From now on, though, you should probably do at least some of
your homework yourself. I won't always have enough time to
help you.
|
|
From: Alfred P. R. <al...@ya...> - 2005-02-25 23:07:30
|
From C/C++ Reference
"The static data type modifier is used to create permanent storage for variables. Static variables keep their value between function calls. When used in a class, all instantiations of that class share one copy of the variable."
<< can be overloaded via the operator keyword by:
void* operator << (whatever_gets_passed) {
...
}
As an example, in LeakTracer, new is overloaded as:
void* operator new(size_t size) {
return leakTracer.registerAlloc(size,false);
}
See General Rules for Operator Overloading
Farzan Hajian <far...@ho...> wrote:
Hi,
I have two different questions:
-------------------------------------------
The First:
What is a static function? For example what is the difference
between the following function and its non-static version??
//Static Version:
Static int MyFunc(int n)
{
return n*2;
}
//Non-Static Version:
int MyFunc(int n)
{
return n*2;
}
---------------------------------------------
The Second:
How can I overload the "<<" operator?
<snip>
Alfred P. Reaud
|
|
From: Alfred P. R. <al...@ya...> - 2005-02-25 22:58:44
|
Try the _findfirst/_findnext/_findclose set of functions. I believe they allow regular expression searching. I'm using them with both wildcard searches '*', '*.*', and with searches for a specific name. It would be something like:
entrydir = getcwd(NULL, MAX_FOLDER_TEXT_SIZE);
chdir(startpoint_for_search);
if ((findhandle = _findfirst(search_string, &finddata)) == EOF) {
// One wasn't found.
...
}
{ // Process a found one!
...
} while( (result = _findnext(findhandle, &finddata)) == 0 )
_findclose(findhandle);
chdir(entrydir);
free(entrydir);
You must close the find handle, always, and free the entrydir variable if you use the above form. I use the above in recursive folder searching.
Guillermo Gutierrez <ggu...@ma...> wrote:
I have a bit of a dilemma, I have an app that copies files from one folder to another.
Now I need to copy different files from a second folder but I dont want to get all of them.
As newer versions of these files are created, the previous versions are renamed to "filename.****.bpl" as opposed to "filename.bpl".
the "****" is a four digit number representing the file time from the timestamp. I want to copy only the newer files (filename.bpl) and not the previous ones (filename.****.bpl).
What would be the best way to:
a) get a list of the filenames.
b) filter down to a list of the newer filenames (w/o the ".****")
c) and finally copy only the ones on the filtered list.
Guillermo Gutierrez
Market Scan Information Systems
Software Q.A. Supervisor
(818) 575-2000 x2427
ggu...@ma...
Alfred P. Reaud
|
|
From: Alfred P. R. <al...@ya...> - 2005-02-25 22:47:02
|
Always try finding that reference in the libraries via a text search, then insure that you are linking it in. I.e. $ pushd (or cd) /yourPath/dev-cpp/lib $ grep -r 'WSAStartup@8' * Binary file libws2_32.a matches Binary file libwsock32.a matches $ grep -r 'socket@12' * Binary file libws2_32.a matches Binary file libwsock32.a matches $ grep -r 'WSAGetLastError@0' * Binary file libws2_32.a matches Binary file libwsock32.a matches Emilio Arocho <elc...@gm...> wrote: Any time I try to compile a C file that uses sockets the compile fails. I get a bunch of linker errors like this: undefined reference to WSAStartup@8 undefined reference to socket@12 undefined reference to WSAGetLastError@0 I have programmed simple stuff with Dec-C++ and it has worked wonderfully well. What gives with these socket errors? Thanks, Emilio <snip> Alfred P. Reaud |
|
From: Alfred P. R. <al...@ya...> - 2005-02-25 22:36:42
|
Nothing necessarily. Depends on where the breakpoint is set. As an example, if I have a class constructor, and I set the breakpoint within the constructor, it is ignored. If I set it at the instantiation of the class, then I can step into the class constructor. Try setting a breakpoint at the line just before where you are actually interested in.
Another possibility is that the line isn't really being executed. You may try adding the flag
-Wunreachable-code to your compiler parameters just in case. Otherwise single-step through the section that you think is being executed to verify that it is.
By instantiation I mean where you do
MYCLASS myClass; (set the breakpoint there, and then (S)tep into the class) not in the declaration:
class MYCLASS {
...
};
Tobias Langner <iso...@gm...> wrote:
hi
I'm trying to debug my program. But if I set a breakpoint, the program does
not stop there (although I know it passed the line). What am I doing wrong?
<snip>
Alfred P. Reaud
|
|
From: <in...@vp...> - 2005-02-25 17:56:34
|
Good day. I'm using Dev-C++ 4.9.9.2 and have following questions: 1) How to perform integration between DevC++ and NASM? 2) Is WinDDK available as DevPack or not? -- Best regards, Vladimir 'insider' Prohorov mailto:in...@vp... ICQ#:179598229 CommuniGate Pro WebUser Interface v.4.1.8 [uptime :: 7d 9h 4m] |
|
From: Jay B. <jay...@ni...> - 2005-02-25 17:06:13
|
[snip] I'm looking for a simple database to use with a small application. I don't really want to use an SQL database like FireBird and wondered if anyone is using something free and simple in the B-Tree/C-ISAM category and don't have much experience programming for Windows. [/snip] Have you looked at MySQL http://www.mysql.com ? |
|
From: Reid T. <Rei...@at...> - 2005-02-25 16:37:38
|
www.sqlite.org =20 =20 reid=20 -----Original Message----- From: Bill Henderson [mailto:ab...@to...]=20 Sent: Friday, February 25, 2005 9:55 AM To: dev...@li... Subject: [Dev-C++] Simple Database =09 =09 =09 I'm looking for a simple database to use with a small application. =20 I don't really want to use an SQL database like FireBird and wondered if anyone is using something free and simple in the B-Tree/C-ISAM category and don't have much experience programming for Windows. =20 And thanks to Salvador for pointing me to the Resource Editor. =20 -- SlackRat |
|
From: jose i. c. <ji...@ci...> - 2005-02-25 15:52:23
|
reading and comparing filenames
Yeah, sounds simple enough. :-) I don't know what you want us to help =
you with. But, I would tell you, that I have done something like this, =
but I used the DOS command DIR (HELP DIR) to get my listings and pipe it =
to a file (DIR /options > filenames.txt). It was easier since the dir =
command has many options for sorting, so you could get the list that you =
want and have the files be in the right order etc. So, you could do a) =
and b) in one command. (Of course, depending what you really want in a) =
and in b).) You could even run a few commands with a few files as input =
and then execute c) with the input gathered from a) and b). Just a =
thought...
jos=E9
----- Original Message -----=20
From: Guillermo Gutierrez=20
To: dev...@li...=20
Sent: Thursday, February 24, 2005 7:53 PM
Subject: [Dev-C++] reading and comparing filenames
I have a bit of a dilemma, I have an app that copies files from one =
folder to another.=20
Now I need to copy different files from a second folder but I dont =
want to get all of them.=20
As newer versions of these files are created, the previous versions =
are renamed to "filename.****.bpl" as opposed to "filename.bpl".
the "****" is a four digit number representing the file time from the =
timestamp. I want to copy only the newer files (filename.bpl) and not =
the previous ones (filename.****.bpl).=20
What would be the best way to:=20
a) get a list of the filenames.=20
b) filter down to a list of the newer filenames (w/o the =
".****")=20
c) and finally copy only the ones on the filtered list.=20
Guillermo Gutierrez=20
Market Scan Information Systems=20
Software Q.A. Supervisor=20
(818) 575-2000 x2427=20
ggu...@ma...=20
|
|
From: SlackRat <ab...@to...> - 2005-02-25 15:10:12
|
----- Original Message -----
From: "Farzan Hajian" <far...@ho...>
To: <dev...@li...>
Sent: Friday, February 25, 2005 5:37 AM
Subject: [Dev-C++] My Two Problems
Hi,
I have two different questions:
-------------------------------------------
The First:
What is a static function? For example what is the difference
between the following function and its non-static version??
//Static Version:
Static int MyFunc(int n)
{
return n*2;
}
//Non-Static Version:
int MyFunc(int n)
{
return n*2;
}
This might help a little, but take the time to read up on a C/C++ primer
http://www.phim.unibe.ch/comp_doc/c_manual/C/SYNTAX/static.htm
--
SlackRat
|
|
From: Bill H. <ab...@to...> - 2005-02-25 14:54:51
|
I'm looking for a simple database to use with a small application. I don't really want to use an SQL database like FireBird and wondered if = anyone is using something free and simple in the B-Tree/C-ISAM category = and don't have much experience programming for Windows. And thanks to Salvador for pointing me to the Resource Editor. -- SlackRat |
|
From: Farzan H. <far...@ho...> - 2005-02-25 12:23:28
|
Hi,
I have two different questions:
-------------------------------------------
The First:
What is a static function? For example what is the difference
between the following function and its non-static version??
//Static Version:
Static int MyFunc(int n)
{
return n*2;
}
//Non-Static Version:
int MyFunc(int n)
{
return n*2;
}
---------------------------------------------
The Second:
How can I overload the "<<" operator?
Thanks,
|
|
From: Farzan H. <far...@ho...> - 2005-02-25 11:58:50
|
Hi,
I have two different questions:
-------------------------------------------
The First:
What is a static function? For example what is the difference
between the following function and its non-static version??
//Static Version:
Static int MyFunc(int n)
{
return n*2;
}
//Non-Static Version:
int MyFunc(int n)
{
return n*2;
}
---------------------------------------------
The Second:
How can I overload the "<<" operator?
Thanks,
--=20
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
|
|
From: Alfred P. R. <al...@ya...> - 2005-02-25 06:48:38
|
Hi Josh,
Thanks for the help! Currently I'm doing class debugging by units, piece by bloody piece to find these insidious memory leaks! This is recommended in Test Your Classes, a part of Just Say No To Memory Leaks.
I'm using LeakTracer for the leak test. It's only downside its that it requires the Perl language to use effectively, though it isn't required for actual use. Everything is commented out except the GUI class. I've already verified that the GUI constructor/destructor has no leaks. Just rechecked it, getting the report:
$ cat leak.out
# starting Thu Feb 24 22:59:03 2005
# memory overrun protection of 4 Bytes
# initializing new memory with 0xAA
# sweeping deleted memory with 0xEE
# aborts on OVERWRITE_MEMORY
# not thread save; if you use threads, recompile with -DTHREAD_SAVE
# internal buffer now 32768
# finished Thu Feb 24 22:59:03 2005
# total allocation requests: 2 ; max. mem used 1 kBytes
# leak 0 Bytes :-)
I've got these two macros to help:
#define zap(x) if (x) { delete(x); x = NULL; }
#define zap_array(x) if (x) { delete[](x); x = NULL; }
In GUI class declaration, I'm declaring a public pointer to a FLTK text display buffer:
...
Fl_Text_Buffer *textbuffer; // Text widget buffer.
...
In the constructor I'm declaring:
...
zap( textbuffer )
textbuffer = new Fl_Text_Buffer(1024);
...
In the destructor I'm declaring:
...
zap( textbuffer );
...
In my make_window code I have (and I've put this all over the place, including trying it as a static declaration at the top of the module & not using the declaration in the class, in the make_window call, and in the constructor, which is it's current location. Nothing changes other than the machine code address of the leak!):
void GUI::make_window ( const HINSTANCE hThisInstance ) {
...
statusTextDisplay = new Fl_Text_Display(100, 295, 270, 135, "File Cleaner Status/Results");
statusTextDisplay->buffer( textbuffer );
...
}
So I'm creating a pointer to a structure with new, and then I'm deleting it if that pointer isn't NULL. Running the program, I have a 4 byte leak at 0x410E40 (among 4 others for a total leak of 68 bytes), which LeakTracer says isn't in my code. Using Insight, it's reported as being D:/Dev-Cpp/include/c++/3.3.1/cmath, line 477. Fine...
At the breakpoint I get the following:
Breakpoint 2, 0x00410e40 in Fl_Text_Buffer::add_predelete_callback(void (*)(int, int, void*), void*) () at D:/Dev-Cpp/include/c++/3.3.1/cmath:477
Current language: auto; currently c++
With the stack trace being:
#0 0x00410e40 in Fl_Text_Buffer::add_predelete_callback(void (*)(int, int, void*), void*) () at D:/Dev-Cpp/include/c++/3.3.1/cmath:477
#1 0x00409087 in Fl_Text_Display::buffer(Fl_Text_Buffer*) () at D:/Dev-Cpp/include/c++/3.3.1/cmath:477
#2 0x00405742 in GUI::make_window(HINSTANCE__*) (this=0x469080, hThisInstance=0x400000) at FileCleanerPro_Main.cpp:581
#3 0x004062a1 in WinMain (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x241f09 "", nFunsterStil=10) at FileCleanerPro_Main.cpp:794
#4 0x004377ba in main () at D:/Dev-Cpp/include/c++/3.3.1/cmath:477
FileCleanerPro_Main.cpp:581 is statusTextDisplay->buffer( textbuffer );
FileCleanerPro_Main.cpp:794 is gui.make_window(hThisInstance);
This only occurs if I'm calling the code to make the window from WinMain:
...
gui.make_window(hThisInstance);
...
Everything else is commented out. To test the constructor/destructor, I comment out the above line. The instantiation of GUI is at the bottom of the module as GUI gui; and is declared in the header file as extern GUI gui;
My question is then WTF~&*#$! I'll look over the site you link below, as I'm also in need of knowing how much memory is actually available for use before it goes to virtual memory. The need is in the time difference between using fputc and fwrite. fwrite is about 35% faster (I've run extensive tests on timing, as I'm doing a for-sale professional version of File Cleaner that uses multi-pass writes to files to effectuate unrecoverable wiping of data, even with magnetic force microscopy). However the speed increase only occurs if you are actually doing writes to ram vs. hard disk. I'm resorting to fputc and fwrite due to inconsistencies that I had using ofstream. This application MUST flush to the hard disk every time, or else confidential and secure wiping (two modes of operation entailing 11 passes and 35 passes respectively) doesn't occur (other than in ram!). ofstream wouldn't do that consistently.
Thanks for your time, everybody, and apologies for the length of this post. I've spent 59+ hours on this so far without satisfactory solution. I'm in need of a cigarette or of something much stronger to burn! ;^)
Josh Matthews <mrl...@gm...> wrote:
If you don't insist on using that specific monitor, then Fluid
Studio's memory manager is an excellent, free, and small libary that's
worked wonders for me. No changes required, just use normal
allocation techniques for C/C++ source code.
<snip>
http://www.fluidstudios.com/pub/FluidStudios/MemoryManagers/Fluid_Studios_Memory_Manager.zip
<snip>
Alfred P. Reaud
|
|
From: Josh M. <mrl...@gm...> - 2005-02-25 06:45:57
|
I think Alfred forgot to reply to all, so I'm doing him the favour.
---------- Forwarded message ----------
From: Alfred P. Reaud <al...@ya...>
Date: Thu, 24 Feb 2005 22:38:52 -0800 (PST)
Subject: Re: [Dev-C++] Memory Leak Checking
To: Josh Matthews <mrl...@gm...>
Hi Josh,
Thanks for the help! Currently I'm doing class debugging by units,
piece by bloody piece to find these insidious memory leaks! This is
recommended in Test Your Classes, a part of Just Say No To Memory
Leaks.
I'm using LeakTracer for the leak test. It's only downside its that
it requires the Perl language to use effectively, though it isn't
required for actual use. Everything is commented out except the GUI
class. I've already verified that the GUI constructor/destructor has
no leaks. Just rechecked it, getting the report:
$ cat leak.out
# starting Thu Feb 24 22:59:03 2005
# memory overrun protection of 4 Bytes
# initializing new memory with 0xAA
# sweeping deleted memory with 0xEE
# aborts on OVERWRITE_MEMORY
# not thread save; if you use threads, recompile with -DTHREAD_SAVE
# internal buffer now 32768
# finished Thu Feb 24 22:59:03 2005
# total allocation requests: 2 ; max. mem used 1 kBytes
# leak 0 Bytes :-)
I've got these two macros to help:
#define zap(x) if (x) { delete(x); x = NULL; }
#define zap_array(x) if (x) { delete[](x); x = NULL; }
In GUI class declaration, I'm declaring a public pointer to a FLTK
text display buffer:
...
Fl_Text_Buffer *textbuffer; // Text widget buffer.
...
In the constructor I'm declaring:
...
zap( textbuffer )
textbuffer = new Fl_Text_Buffer(1024);
...
In the destructor I'm declaring:
...
zap( textbuffer );
...
In my make_window code I have (and I've put this all over the place,
including trying it as a static declaration at the top of the module &
not using the declaration in the class, in the make_window call, and
in the constructor, which is it's current location. Nothing changes
other than the machine code address of the leak!):
void GUI::make_window ( const HINSTANCE hThisInstance ) {
...
statusTextDisplay = new Fl_Text_Display(100, 295, 270, 135, "File
Cleaner Status/Results");
statusTextDisplay->buffer( textbuffer );
...
}
So I'm creating a pointer to a structure with new, and then I'm
deleting it if that pointer isn't NULL. Running the program, I have a
4 byte leak at 0x410E40 (among 4 others for a total leak of 68 bytes),
which LeakTracer says isn't in my code. Using Insight, it's reported
as being D:/Dev-Cpp/include/c++/3.3.1/cmath, line 477. Fine...
At the breakpoint I get the following:
Breakpoint 2, 0x00410e40 in
Fl_Text_Buffer::add_predelete_callback(void (*)(int, int, void*),
void*) () at D:/Dev-Cpp/include/c++/3.3.1/cmath:477
Current language: auto; currently c++
With the stack trace being:
#0 0x00410e40 in Fl_Text_Buffer::add_predelete_callback(void (*)(int,
int, void*), void*) () at D:/Dev-Cpp/include/c++/3.3.1/cmath:477
#1 0x00409087 in Fl_Text_Display::buffer(Fl_Text_Buffer*) () at
D:/Dev-Cpp/include/c++/3.3.1/cmath:477
#2 0x00405742 in GUI::make_window(HINSTANCE__*) (this=0x469080,
hThisInstance=0x400000) at FileCleanerPro_Main.cpp:581
#3 0x004062a1 in WinMain (hThisInstance=0x400000, hPrevInstance=0x0,
lpszArgument=0x241f09 "", nFunsterStil=10) at
FileCleanerPro_Main.cpp:794
#4 0x004377ba in main () at D:/Dev-Cpp/include/c++/3.3.1/cmath:477
FileCleanerPro_Main.cpp:581 is statusTextDisplay->buffer( textbuffer );
FileCleanerPro_Main.cpp:794 is gui.make_window(hThisInstance);
This only occurs if I'm calling the code to make the window from WinMain:
...
gui.make_window(hThisInstance);
...
Everything else is commented out. To test the constructor/destructor,
I comment out the above line. The instantiation of GUI is at the
bottom of the module as GUI gui; and is declared in the header file as
extern GUI gui;
My question is then WTF~&*#$! I'll look over the site you link below,
as I'm also in need of knowing how much memory is actually available
for use before it goes to virtual memory. The need is in the time
difference between using fputc and fwrite. fwrite is about 35% faster
(I've run extensive tests on timing, as I'm doing a for-sale
professional version of File Cleaner that uses multi-pass writes to
files to effectuate unrecoverable wiping of data, even with magnetic
force microscopy). However the speed increase only occurs if you are
actually doing writes to ram vs. hard disk. I'm resorting to fputc
and fwrite due to inconsistencies that I had using ofstream. This
application MUST flush to the hard disk every time, or else
confidential and secure wiping (two modes of operation entailing 11
passes and 35 passes respectively) doesn't occur (other than in ram!).
ofstream wouldn't do that consistently.
Thanks for your time, everybody, and apologies for the length of this
post. I've spent 59+ hours on this so far without satisfactory
solution. I'm in need of a cigarette or of something much stronger to
burn! ;^)
Josh Matthews <mrl...@gm...> wrote:
If you don't insist on using that specific monitor, then Fluid
Studio's memory manager is an excellent, free, and small libary that's
worked wonders for me. No changes required, just use normal
allocation techniques for C/C++ source code.
<snip>
http://www.fluidstudios.com/pub/FluidStudios/MemoryManagers/Fluid_Studios_Memory_Manager.zip
<snip>
Alfred P. Reaud
|
|
From: Josh M. <mrl...@gm...> - 2005-02-25 03:22:58
|
If you don't insist on using that specific monitor, then Fluid Studio's memory manager is an excellent, free, and small libary that's worked wonders for me. No changes required, just use normal allocation techniques for C/C++ source code. From the website: Memory Manager (a.k.a. "MMGR") MMGR is an industrial-strength memory manager for almost any project. Not only will MMGR probably point out some bugs you never knew you had, but it is also a great development tool. Among other standard tracking tools (overruns/underruns, deallocation mismatches, etc.), MMGR also provides a rich featureset of developer tools. For example, it allows you to set a breakpoint on an arbitrary allocation, generate a snapshot report of memory currently in use, etc. You can even ask MMGR to track how much of your allocated RAM is actually in use (nothing worse than allocating 64MB of memory just to find that you only needed 2K. :) http://www.fluidstudios.com/pub/FluidStudios/MemoryManagers/Fluid_Studios_Memory_Manager.zip -Josh On Thu, 24 Feb 2005 19:13:57 -0800 (PST), Alfred P. Reaud <al...@ya...> wrote: > > Hi Y'all, > > Has anybody used the objidl.h file and associated IMalloc function? I'm at > a loss to understand how it's supposed to be used, and am trying to find > some documentation for it that makes more sense than the Microsoft site > documentation. It's part of the Microsoft Component Object Model (COM), but > all I'm needing is the memory monitoring functions. It is included in > Dev-Cpp. > > Thanks! > > > > > Alfred P. Reaud |
|
From: Alfred P. R. <al...@ya...> - 2005-02-25 03:14:14
|
Hi Y'all, Has anybody used the objidl.h file and associated IMalloc function? I'm at a loss to understand how it's supposed to be used, and am trying to find some documentation for it that makes more sense than the Microsoft site documentation. It's part of the Microsoft Component Object Model (COM), but all I'm needing is the memory monitoring functions. It is included in Dev-Cpp. Thanks! Alfred P. Reaud |
|
From: Guillermo G. <ggu...@ma...> - 2005-02-25 00:54:13
|
I have a bit of a dilemma, I have an app that copies files from one = folder to another. Now I need to copy different files from a second folder but I dont want = to get all of them. As newer versions of these files are created, the previous versions are = renamed to "filename.****.bpl" as opposed to "filename.bpl". the "****" is a four digit number representing the file time from the = timestamp. I want to copy only the newer files (filename.bpl) and not = the previous ones (filename.****.bpl).=20 What would be the best way to: a) get a list of the filenames. b) filter down to a list of the newer filenames (w/o the ".****") c) and finally copy only the ones on the filtered list. Guillermo Gutierrez Market Scan Information Systems Software Q.A. Supervisor (818) 575-2000 x2427 ggu...@ma... |
|
From: Tobias L. <iso...@gm...> - 2005-02-24 19:43:03
|
hi I'm trying to debug my program. But if I set a breakpoint, the program does not stop there (although I know it passed the line). What am I doing wrong? -- Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail |
|
From: Emilio A. <elc...@gm...> - 2005-02-24 13:58:01
|
Thank God for the search function!!! Yay!!! |
|
From: Emilio A. <elc...@gm...> - 2005-02-24 13:54:53
|
Any time I try to compile a C file that uses sockets the compile fails. I get a bunch of linker errors like this: undefined reference to WSAStartup@8 undefined reference to socket@12 undefined reference to WSAGetLastError@0 I have programmed simple stuff with Dec-C++ and it has worked wonderfully well. What gives with these socket errors? Thanks, Emilio |
|
From: Bill H. <ab...@to...> - 2005-02-24 08:05:08
|
----- Original Message -----=20
From: Wayne J May=20
To: dev...@li...=20
Sent: Wednesday, February 23, 2005 21:43 PM
Subject: [Dev-C++] Getting the File Date
Hey,
Just wondering if it is possible to get a file's last modified date, =
or the created date ? I need this for a server side project that I am =
working on, but the program will have to check the actual date of the =
file. How can I do this in C or C++ using MS Windows ?
--
This email was scanned for a virus with an up to date virus database, =
on the sender's PC.
We will not be held responsible, should this email become infected.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 2/22/2005
Try This:
#include <dir.h>
#include <io.h>
union FF
{
unsigned i[2];
struct ftime f;
} u;
main()
{
struct ffblk ff;
findfirst("tc.exe", &ff, 0);
u.i[0]=3D ff.ff_ftime;
u.i[1]=3D ff.ff_fdate;
printf("date=3D %d/%d/%d time=3D %d:%d:%d\n",
u.f.ft_month, u.f.ft_day, u.f.ft_year+80,
u.f.ft_hour, u.f.ft_min, u.f.ft_tsec);
return 0;
}
--
Slackrat |