|
Andy H wrote: I have tried #define new new(__FILE__,__LINE__) etc... but this is not compatible with existing code.
Just for my own edification, why not?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Andy H wrote: I am writing code to track down memory leaks in our program.
Is there some reason you don't use a tool that finds memory leaks?
|
|
|
|
|
I don't get, how do you want to get file and line with stack trace, but you can obtain your return address with
<br />
void *lpReturnAddress;<br />
__asm<br />
{<br />
mov lpReturnAddress, DWORD PTR[esp]<br />
}
|
|
|
|
|
Thanks, I hadn't thought of assembler code. The following did the trick:
unsigned* my_ebp;<br />
__asm<br />
{<br />
mov eax, ebp<br />
mov dword ptr [my_ebp], eax<br />
}
|
|
|
|
|
Hi,
I am using CResizableFormView for my Form and it has been derived from CFormView. The mouse wheel scroll seems to have got de-activated. In another application that uses just CFormView, the mouse wheel movement is automatically transfered to the scroll function.
How do I implement this in CResizableFormView?
There is also something else that I would like to do :
When the button 'Results' is clicked, the Form should automatically scroll to that part where the results are visible. Just like in web-pages. Please can you give me an idea how this may do done?
Thanks.
Fortitudine Vincimus!
|
|
|
|
|
You can use the OnMouseWheel and call OnVScroll, or SetScrollPosition
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Thanks.
Please can you tell me how to get hold of the windows scroll bars. I guess I must use
CScrollBar * bar = new CScrollBar;
bar->SetScrollPos(100,TRUE);
But before calling SetScrollPos, I must get 'bar' to point to the CFormView's vertical scroll bars. What is the correct way to do this?
Thanks.
Fortitudine Vincimus!
|
|
|
|
|
Hi All,
My quest is simple, Im using MFC under VS 6.0
I wanna create some Golbale Variables . So how could i create a Golbale Variable under MFC? and in which Class. My Prog is named AutoParall so i have Classes like CAutoParallApp and so on.
thank you .
|
|
|
|
|
you have already an example of it:
The Application Wizard defines the global variable theApp inside the application source file (i.e. AutoParallApp.cpp AutoParall.cpp in your case).
You can use theApp on any other source file (for instance in the MainFrm.cpp ) provided you declare it as extern (i.e. extern CAutoParallApp theApp; ) in the corrensponding header file (MainFrm.h in the previous example).
You can also make it visible to all sources, declaring it extern inside the StdAfx.h header (included by all sources of you project).
I hope that you can find out your way now.
-- modified at 11:35 Wednesday 28th November, 2007
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.
|
|
|
|
|
Ok thx 4 the reply but in my case i have more than 45 Golbals Variables that i use in my Prog so how could i declare all the Vars, besides theApp Var.
|
|
|
|
|
Blood_HaZaRd wrote: i have more than 45 Golbals Variables
Too many!!!!!!!!!!!!!
Anyway:
I suggest you to define the variables inside the application source AutoParall.cpp , for instance:
int iMyGlobalVar1 = 0;
DWORD dwMyGlobalVar2 = 0;
...
and to declare the variables themselves in the StdAfx.h file, for instance:
extern int iMyGlobalVar1;
extern DWORD dwMyGlobalVar2;
...
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.
|
|
|
|
|
thank you, i ll try to follow yrs instructions.
|
|
|
|
|
Ok It works now, thank you again for your kindness.
|
|
|
|
|
Blood_HaZaRd wrote: So how could i create a Golbale Variable under MFC?
In exactly the same way you would outside of MFC.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This is a great example of what I struggle with in the forums. To some the purpose is to answer the question asked. I sometimes see a different problem. Like in this case I see a larger problem in that the OP "wants" to create some global variables. Since I mostly seem to be alone in this regard I guess that indicates that my perspective is wrong eh?
|
|
|
|
|
led mike wrote: Like in this case I see a larger problem in that the OP "wants" to create some global variables.
That is an equally valid observation. I tend to error on the side of newbies wanting to port old C code to C++ whilst bringing along the baggage, too. To some, they simply do not know how to ask the right question.
I suppose you could also liken it to the old adage, "If the only tool you have is a hammer, everything resembles a nail."
led mike wrote: Since I mostly seem to be alone in this regard...
Which means you are simply looking at the request from a different vantage point. Nothing wrong with that.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm mixing GDI and GDI+ together a bit and attempting to create a region in GDI+, then use the handle to that region to invert the colors using ::InvertRgn in GDI using the same HDC used to create the graphics object but someone helped me discover that the region is in device units when used in GDI and world coordinates in GDI+.
I'm struggling with the fact that I'm using the GDI mapping modes for my scaling so when I use the handle from the GDI+ region in a GDI function, the scaling gets mucked up without manually reproducing the scaling effect.
My question is "Does anyone know how the same effect (InvertRgn) can be achieved in GDI+ using the graphics object that is backed by a memory DC"?
|
|
|
|
|
Hi all
i have an Embedded Visual C++ aplication, in this aplication
exist a class where have declare the const CLSID_SQLSERVERCE_2_0
for create instance OLE DB for SQL CE 2.0
CLSID_SQLSERVERCE_2_0 = {0x76A85B2E,0x9DE0,0x4ded,{0x8E,0x69,0x4D,0xEF,0xDB,0x9C,0x09,0x17}};
i found CLSID for SQL CE 3.0
CLSID_SQLSERVERCE_3_0 = {0x32ce2952, 0x2585, 0x49a6, {0xae, 0xff, 0x17, 0x32, 0x7, 0x6c, 0x29, 0x45}};
But i need CLSID for SQL CE 3.5
CLSID_SQLSERVERCE_3_5 = ??????
sorry my bad english
thanks
|
|
|
|
|
Hi,
When i include AfxMessageBox i get exit icon on the top right side of the
message box, Is there any way to remove that.
Thanks in advance
|
|
|
|
|
shir_k wrote: Is there any way to remove that.
My guess is, not without also removing the caption.
You could always roll your own message box.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for the reply.
1)How to remove the caption?
2)Own message box means i have to create new dialog box in resource view and display the message or is there any other method.
|
|
|
|
|
Yes, there is probably a way to remove it (I think you have to look at how to remove the system menu or something like that).
But the question I'm asking is why do you want to remove it ? it's part of the normal Windows UI guidelines.
|
|
|
|
|
I just want to pop up a message to the user indicating "data is going to load please wait for sometime", It is just a information and data will be loaded even if user press "OK" or cancel button so i wanted to remove it.
|
|
|
|
|
It sounds like you want a modeless diaog instead so that the main thread is not blocked.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
So, there are no specific requirements to remove the "X" in the caption, so just leave it like that and concentrate on the the real features and/or other technical challenges that you might have.
|
|
|
|