|
Hi, I 've experiencing a quite weird problem. I overload new & delete. In new I allocate memory from malloc() and then I add the given pointer to a list. I use an std::list<void*>. So it's sth like that:
<br />
void* operator new(size_t size)<br />
{<br />
void* p = malloc(sizeof(byte)*size);<br />
...<br />
myList.push_back(p);
<br />
return p;<br />
}<br />
However as I 've seen with debug the list in order to create a new node uses the new operator, that comes back to me that I 've overload it! I suppose you can see the eternal recursion. What is weird though is that exactly the same code works perfectly fine in unix using the std::list and the g++ for compiler (in windows I use VC++ .NET).
I 'm open to suggestions, it 's driving me crazy
Thanks, Themis
|
|
|
|
|
This would make sense if you're overloading the global new & delete operators. std::list makes a copy of the items, which would explain the recursion problem. Not sure how GCC would resolve this, are you maybe just overloading it for a single class there?
|
|
|
|
|
I guess what happens is this: std:list uses an allocator object (std::allocator by default) which in VC++ happens to call new for memory allocation. To break the loop, write your own allocator and use it when definining the type myList belongs.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I would like to create a MDI project without the caption bar and the border. Is it possible? Also, I would like the child windows to be without Caption and border bar.
Any ideas?
Thanks
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Anyone have trouble building the release version of their MFC project w/ ATL support after it builds and runs just fine in debug mode? If so, what did you do to solve the problem? Thanks again.
Matt (Padawan Learner)
|
|
|
|
|
It might be helpful to tell people what error you get. We are all master psychics, but the guild rules are very strict....
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
peterchen wrote:
We are all master psychics, but the guild rules are very strict
But of course we all knew you'd say that
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I am trying to automate word in an MFC application. I have followed the various tutorials for other office applications. When I try to automate word, what is the same of the header file I need to include. For example I was using excel.h for Excel2002. TIA.
Matt (Padawan Learner)
|
|
|
|
|
If you created the Word classes by importing the type library (msword.olb), the .CPP and .H files will automatically be added to your project via ClassWizard.
|
|
|
|
|
I'm trying to set Terminal font in my CEdti control using the follow code:
[code]
font.CreateFont(8, 0, 0, 0, FW_DONTCARE,
0, 0, 0,
OEM_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
FIXED_PITCH, "Terminal"
);
[/code]
The font chages to some Courier like font and lines is ovelap each other.
But how to get the Terminal font worked?
I did google and this site search but no luck. If I chage Terminal to Courier all seems to wark fine but I need exactly Terminal font which surely installed on my system.
|
|
|
|
|
Oh! When I tried exactly the code I have typed in previous post all works fine!
This site really helps me! )))
|
|
|
|
|
Hi,
I would like to know what is the difference between a child window and a sibling window?
Thanks!
Everything's beautiful if you look at it long enough...
|
|
|
|
|
A is a child window of B , if A 's parent is B . A is a sibling of B if A and B have the same parent.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks!!
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Hiya how do I open an SQL database using DAO?? I know I have to use the member function open of CDAODatabase, but can't get it to work for me..
Thanks,
grahamoj.
|
|
|
|
|
Here is a simple example.
CDaoDatabase db;
char requetesql[300];
db.Open(_T("db1.mdb"));
CDaoRecordset rs(&db);
rs.Open(dbOpenDynaset, _T("SELECT count([Mis1]) AS numMis1 FROM comptes WHERE Mis1=200 and Mis3=200;"));
COleVariant varName;
//...etc
varName= rs.GetFieldValue("numMis1");
rs.Close();
db.Close();
}
don't forget to #include <afxdao.h>.
Good luck!
|
|
|
|
|
Any source code examples on how to merge multiple mpeg files or maybe a commandline utility that would do it?
|
|
|
|
|
Just use
c:\copy 1.mpeg /B + 2.mpeg /B myMpeg.mprg /B
This is the command that I merge porn mpeg clips into a mpeg "movie". Is this what you need?
|
|
|
|
|
No, I am NOT saying that you want to merge porn mpeg clips into a mpeg "movie". Nooooooooo
|
|
|
|
|
Heh. It's powervcr that's my problem. Cuts recorded mpegs to 600mb. But the problem with using copy /b is that it uses the movie length (total time) of the last mpeg. So seeking only seeks within the first part of the final mpeg.
|
|
|
|
|
Anonymous wrote:
This is the command that I merge porn mpeg clips into a mpeg "movie".
Too much information.
|
|
|
|
|
Hi!
I am trying to use CString in my project, after including the file afx.h I received the following error:"G:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afx.h(15) : fatal error C1189: #error : MFC requires C++ compilation (use a .cpp suffix)". I went to project->settings->C/C++ and I choosed "category"->precompiled headers->use precompiled headers and I added stdafx.h
I don't understand! the error is still there!
Please help!!
|
|
|
|
|
Include windows.h.
Kuphryn
|
|
|
|
|
One of the files that include afx.h has a .c or similar ending (VC++ decides whether to use it's C or C++ compiler based on the file extension).
Using CString is not as easy as just #including stdafx.h - you need to link with MFC, change compile settings, etc, and get a whole lot of dependencies.
You can either use WTL[^], which comes with a perfectly compatible CString class, or "extract" the CString class from the MFC sources (again, complicated, but there#s a Macro on CodeGuru that can do that. Lost the link though...)
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
I tried to link with MFC, change compile settings...etc but many other errors appeared...I still don't know how to convert from C to C++...beginner's problem!
Maybe I will create a dll with all the MFC functions that I'll need and I'll call them from my application.
Thanks a lot for your help.
|
|
|
|