|
i hope u trying to print the text from some fixed location.you dint tell the x1 and y2 values. you will get the correct solution if you adjust these values.
dffsfsdfdsfs
|
|
|
|
|
Use the text alignment options of CDC; see here[^].
It's time for a new signature.
|
|
|
|
|
use settextalign() property......
|
|
|
|
|
If you have a suggestion for the original questioner then please reply to them and not to me.
It's time for a new signature.
|
|
|
|
|
Hi
What all the properties to be changed while creating a FormView in splitter wnd.
I am trying to insert a list control in report view..
I couldnt able to set the columns names...
I m setting it in Oncreate or OnShowWindow,but neithr works..
Help me ...
|
|
|
|
|
See my answer to your later question. And please do not repost the same question.
It's time for a new signature.
|
|
|
|
|
Here is a code for create and delete a 3D array!
when i try to catch memory leak by the following code, It alerts that i have exactly 1600 bytes memory leak!
Where is the problem of my Code?
#define VAR_TYPE double
VAR_TYPE ** Create2Darray(int n, int l)
{
VAR_TYPE **temp = new VAR_TYPE*[n];
for (int i =0 ; i< n ; i++) temp[i] = new VAR_TYPE[l];
return temp;
}
VAR_TYPE *** Create3DArray(int x,int y,int z)
{
VAR_TYPE *** arrayd;
arrayd = new VAR_TYPE**[x];
for (int i =0 ; i< x ; i++) arrayd[i] = Create2Darray(y,z);
return arrayd;
}
void Delete3DArray(VAR_TYPE *** darray,int Xdim,int Ydim,int Zdim)
{
for (int k =0; k<Xdim;k++)
{
for (int j=0; j<Ydim;j++)
{
delete [] darray[k][j];
darray[k][j]=NULL;
}
delete [] darray[k];
darray[k] = NULL;
}
delete [] darray;
darray = NULL;
}
#ifdef _DEBUG
CMemoryState msOld,msnew, diffMemState;
msOld.Checkpoint();
double *** Sample_Temp = Create3DArray(182,218,182);
Delete3DArray(Sample_Temp,182, 218, 182);
msnew.Checkpoint();
if( diffMemState.Difference(msOld, msnew) )
{
TRACE( "Memory leaked!\n" );
diffMemState.DumpStatistics();
}
#endif
the output ofter running diffMemState.DumpStatistics() :
Memory leaked!
0 bytes in 0 Free Blocks.
120 bytes in 2 Normal Blocks.
0 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
0 bytes in 0 Client Blocks.
Largest number used: 57659956 bytes.
Total allocations: 57661556 bytes.
Best,
MJM
|
|
|
|
|
I got no memory leaks with the code you provided (I'm using VS2010).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
But i got memory leak in VS2008 SP1!!!
Is it a bug? or there is something wrong in my code?
Best,
MJM
|
|
|
|
|
I didn't scrutinize your code.
How did you test it (I used,of course, just the code provided. Do you test it inside a larger application?)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes, I test it inside a large application. But Does it depend?
|
|
|
|
|
I tested with VS2008 SP1 - no leak.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
|
Why don't you check with WinDbg?
It is essential for a programmer like u.
Величие не Бога может быть недооценена.
|
|
|
|
|
I used to be able to do this in my earlier version but can't work out how to do it now. It was a quick and useful way to check the syntax of an individual file was OK before compiling.
Thanks
Greg
|
|
|
|
|
Member 868926 wrote: ...check the syntax of an individual file was OK before compiling.
Maybe I'm missing something, but the compiler is checking the syntax.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
It's probably a third party macro or something similar.
I remember having written a program that parses all .CPP and .H files in a folder and its sub-folders to check for syntax. It even did a little formatting.
|
|
|
|
|
«_Superman_» wrote: ...a program that parses all .CPP and .H files in a folder and its sub-folders to check for syntax.
So wouldn't that be a C/C++ compiler but without the resulting .obj file(s)?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
and without a project and a solution.
Let's call it Parformatter (Parser + Formatter).
|
|
|
|
|
Unless it's an esoteric add in, the only thing I can think of is that 2008 does not have a "compile this active document" button - so you're doing a compile all instead.
I customised 2008 and added the toolbar button myself. I think ctrl-f7 does the same job.
Iain.
I have now moved to Sweden for love (awwww).
|
|
|
|
|
I've got some older C++ code frm VS6 to VS2008, specifically:
std::locale loc = std::_ADDFAC( std::locale::classic(), new enUSNumberFomatter );
VS is bitching about:
'std::locale::facet::operator new' : no overloaded function takes 3 arguments
'std::locale::locale' : none of the 7 overloads could convert all the argument types
I presume there's been some change? The _ADDFAC exists, but I'm not sure I'm using it the right way anymore. Google doesn't seem to be very helpful here.
//edit
Turns out this:
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
Causes a hassle. Commenting it out works.
|
|
|
|
|
Hi,
is it possible to define a second WNDCLASS and associate it
with a Cdialog were the resource template for DIALOGEX
contains the CLASS statement defining the class
I would like to have a custom cursor for my dialog
so.....
the WNDCLASS will LoadCursor my custom cursor
both AFXregisterClass fails and so does the CDiloag::Create
Create is understandable as the DIALOGEX resorce template
has a CLASS name that hasn't been registered
|
|
|
|
|
To set a custom cursor for a window, create a handler for the WM_SETCURSOR message and then call the SetCursor API within the message handler.
|
|
|
|
|
You seem to have the answer for all problems
thankx
|
|
|
|
|
At least for now.
|
|
|
|