|
No I'm not inclined to use it in release version, I'm sure I've got debug compiler option and I included it as you said:
#include "stdafx.h"
#include "sGen.h"
#include "sGenDlg.h"
#include ".\sgendlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#include "Lib\lib.h"
#include "Lib\quantize.h"
#include "LibST\scomplexity.h"
// CsGenDlg dialog
#include "leaktracker.h"
CsGenDlg::CsGenDlg(CWnd* pParent /*=NULL*/)
: CDialog(CsGenDlg::IDD, pParent)
, m_freq(10)
, m_sr(128)
, m_len(30), data(0)
, m_asize(2)
, qt(0)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
All the same compiler errors again? it doesnt want to be compiled, I use VS2003.
As for the first time I did not include leaktracker.h in any cpp file at all, which is not proper as I've read from its manual that it should be included at least in one file, and I ran it in debug mode (which we select from proj settings->config manager->active solution config), and to test it I used on purpose allocation of memory with new command without deleting it.
What is your suggestions?
look at the errors again:
Compiling...
sGenDlg.cpp
**************************************************************************************
Note: Including leaktracker implementation... DO NOT USE THIS BUILD FOR PRODUCTION!!!
**************************************************************************************
c:\Documents and Settings\yc274\My Documents\Visual Studio Projects\COMPL\sGen\leaktracker.h(184) : error C2433: 'new' : 'inline' not permitted on data declarations
c:\Documents and Settings\yc274\My Documents\Visual Studio Projects\COMPL\sGen\leaktracker.h(184) : error C2365: 'new' : redefinition; previous definition was a 'member function'
c:\Documents and Settings\yc274\My Documents\Visual Studio Projects\COMPL\sGen\leaktracker.h(184) : error C2078: too many initializers
c:\Documents and Settings\yc274\My Documents\Visual Studio Projects\COMPL\sGen\leaktracker.h(184) : error C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\Documents and Settings\yc274\My Documents\Visual Studio Projects\COMPL\sGen\leaktracker.h(184) : error C2143: syntax error : missing ';' before '('
c:\Documents and Settings\yc274\My Documents\Visual Studio Projects\COMPL\sGen\leaktracker.h(184) : error C2226: syntax error : unexpected type 'size_t'
c:\Documents and Settings\yc274\My Documents\Visual Studio Projects\COMPL\sGen\leaktracker.h(184) : error C2059: syntax error : ')'
c:\Documents and Settings\yc274\My Documents\Visual Studio Projects\COMPL\sGen\leaktracker.h(184) : error C2143: syntax error : missing ';' before '{'
and so on...
9ine
|
|
|
|
|
I see the problem. This is an over-sight on our part.
In your above code, you have the following:
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
If you include the leaktracker.h file after the above line, that will cause the compile errors.
I've updated the leaktracker.h file so that it does an #undef for new.
#ifdef new
#undef new
#endif //new
You can download the new version, or just add the above 3 lines in the leaktracker.h file around line 177 (right before the new operator).
http://code.axter.com/leaktracker.h[^]
FYI:
If you're using MFC, also make sure to include the header after macros like IMPLEMENT_DYNCREATE.
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
Thanks, great tool, now it works.
9ine
|
|
|
|
|
Please have a look at umdh.exe
Vipin - MVP
|
|
|
|
|
What is umdh.exe?
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
|
Rational Purify?
-Prakash
|
|
|
|
|
In your application, (if it is a MFC application, add the following in the InitInstance())
_CrtSetBreakAlloc(715);
it will break when it tries to allocation the leakage memory and you can find the source code.
Details can be "Memory Leak Detection" in VS.
|
|
|
|
|
Hello,
I have the Ascii Code from a character, for example: 101, which is e. How can I convert this int Value into a char or better CString ?
With best regards,
RedDragon2kx
|
|
|
|
|
itoa for int to string
never say die
|
|
|
|
|
Sorry but I think I wasn't clear enough. I need the integer(101) represtented as a char(e).
So I need to convert the ASCII code(101) back to the character it represents
|
|
|
|
|
what i understood is that u want to convert the ASCII value into char
char c=char(101);
another way
int i= 101;
char=static_cast<char>(101);
but keep in mind with range of c
never say die
-- modified at 6:15 Thursday 29th December, 2005
|
|
|
|
|
int asc_int;
CString S_temp;
S_temp.Format("%c",asc_int);
thats it
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
If you remember that a char is just an int with a smaller range, then assigning an int to a char is just that, a simple assignment.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
int i_value;
char c_value;
c_value = static_cast<char>(i_value);
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|
|
If i have an access database with a table called "USER" with fields ID, AGE, NAME, ADDRESS, and i want address of all users with age = 23, a simple sql query will do (SELECT * FROM USER WHERE blah blah)..
But when I have data in a CSV File, how would i build this sql query? select * from what?
Any help or pointers in this direction is highly appreciated.
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Rajesh R. Subramanian wrote: But when I have data in a CSV File, how would i build this sql query? select * from what?
Hi Rajesh,
csv file is nothing, just a comma seperated data and whole line denotes a record.
for executing query AFAIK, you have to import that in access and proceed in similiar way you mentioned above.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi Alok,
ThatsAlok wrote: csv file is nothing, just a comma seperated data
Thanks for your reply, but I too know its Comma separated text data. My concern is that it would be faster to use CSV instead of Access database.
ThatsAlok wrote: you have to import that in access and proceed in similiar way you mentioned above.
Dude, I have exported values from Access and created the CSV because it would be faster. You are asking me to create a MDB out of it again
Best Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Rajesh R. Subramanian wrote: created the CSV because it would be faster.
How Come ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Rajesh is correct.
1. Create a CSV file by exporting 10000 records.
2. Perform data operation on your MDB and CSV file.
3. You will surely find csv to be faster since it is text based.
|
|
|
|
|
hi,
Use OpenRowSet for performing data operations on .CSV files. I do not know if you could edit data, but you could query for sure.
-- modified at 0:48 Thursday 29th December, 2005
|
|
|
|
|
Thank you so much. That was the keyword I was looking for.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Hai,
CSV is just a text file...You cannot perform any operations on that.
I think you have to Convert that text File in Table/Excel Format..
For this ..first you have to check ...
1.weather your file is variable length/Fixed length....
(...means weather your file is following any format..or not)
2.How it is parsed...(with coma,semicolon, space,tab etc)
VamsiDhar.MBC
SoftwareEngineer
|
|
|
|
|
mbcvamsidhar wrote: CSV is just a text file...You cannot perform any operations on that.
Sir, it is possible to perform operations on that. Atleast query operations. This can be done by using the xls driver. (select * from Sheet1 where blah blah).
mbcvamsidhar wrote: 2.How it is parsed...(with coma,semicolon, space,tab etc)
CSV = Comma separated values. Parsed with comma.
Regards and Thanks
Rajesh R. Subramanian.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|