|
Taruni wrote: This is Taruni.I am working with MessageBoxes.Is it possible to change the caption "Ok" and set the caption according to our wish on the "OK" and "Cancel" buttons in the MessageBoxes.
That very tricky task to do. IMHO, you can try this wrapper class instad of normal MessageBox
http://www.codeproject.com/dialog/CPPMessageBox.asp
"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
|
|
|
|
|
Hello everyone,
I have a tree view consisting of several nodes and when i right click on it a context menu is popped up ,where i enter the required details and preess ok.my code works fine until this.however i need to insert the details in the tree view. when i make a call to
m_PointsTree.GetSelectedItem my application is crashing.Please provide ur suggestion.
HEllo
|
|
|
|
|
Can you show some code segments?
- NS -
|
|
|
|
|
I have two modeless dialog, CDialog1, CDialog2, I use the two dialog in a formview. The formview have a member variable CDialog *m_pDlg;
I use them like this:
CMyForm::CMyForm() : m_pDlg(NULL)<br />
{<br />
}<br />
<br />
void CMyForm::OnDestroy()<br />
{<br />
DestroyDlg();<br />
}<br />
<br />
void CMyForm::DestroyDlg()<br />
{<br />
if (m_pDlg)<br />
{<br />
m_pDlg->DestroyWindow();<br />
delete m_pDlg;<br />
m_pDlg = NULL;<br />
}<br />
}<br />
<br />
short nDlgFlag = -1;<br />
<br />
void CMyForm::OnBtn1()<br />
{<br />
if (nDlgFlag == 0)<br />
return;<br />
<br />
nDlgFlag = 0;<br />
<br />
DestroyDlg();<br />
<br />
m_pDlg = new CDialog1;<br />
m_pDlg->Create(IDD_DIALOG1, this);<br />
m_pDlg->ShowWindow(SW_SHOW);<br />
}<br />
<br />
void CMyForm::OnBtn2()<br />
{<br />
if (nDlgFlag == 1)<br />
return;<br />
<br />
nDlgFlag = 1;<br />
<br />
DestroyDlg();<br />
<br />
m_pDlg = new CDialog2;<br />
m_pDlg->Create(IDD_DIALOG2, this);<br />
m_pDlg->ShowWindow(SW_SHOW);<br />
}
My question is when i click button1 and then button2 the taskmanager show that the appliction used memory increased, but when i minimize it the used memory decreased to lower, and show again the memory used lower than before minimized, I don't know why. Any one help me.
Is there any function can do this but needn't to mimimize it.
Thanks a lot.
Hongjun Ge
|
|
|
|
|
Understanding Windows' memory manager is a daunting task. You can't assume it will behave in a manner which you think is logical. Read here, especially the last section.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I am using visual c++ 6.0,
How can I get automatically the path of my SQL SERVER Database programmatically
I learn my self
|
|
|
|
|
You've not provided enough information to yield a useful answer. For starters, how are you communicating with this database?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
If list control is report style,we can use GetTopIndex() to get the topleft item index,but GetTopIndex() can not be used to list control of icon style.And i want to get the topleft item index, how to implement?
-- modified at 1:42 Friday 21st April, 2006
|
|
|
|
|
try the following. I don't know whether this will work or not. I haven't tried.
to get the index of top left item call HitTest with point as 0,0
int nItem = HitTest( CPoint(0,0));
if( -1 != nItem)
{
// u will get the item index here
}
nave
|
|
|
|
|
|
try this
CPoint pt;
GetItemPosition( 0, &pt );
int nItem = HitTest( pt);
if( -1 != nItem)
{
// u will get the item index here
}
nave
-- modified at 3:52 Friday 21st April, 2006
|
|
|
|
|
|
iterator find(const key_type& k);
const_iterator find(const key_type& k) const;
-- modified at 1:11 Friday 21st April, 2006
|
|
|
|
|
followait wrote: iterator find(const key_type& k);const_iterator find(const key_type& k) const;
There function Signature will be same at compile time!
"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
|
|
|
|
|
I have tried this in DLL:-
class AFX_EXT_CLASS me
{
public:
int find(const int & k);
const int find(const int & k) const;
};
and funtion signature comes out to be
:-
?find@me@@QBE?BHABH@Z(for non const function) and ?find@me@@QAEHABH@Z for const function
"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
|
|
|
|
|
Yes. The first one returns an iterator that you can use to manipulate the stored value, the second one does not. There is more to it than that, the second will also be called by other methods that are marked with const without the compiler getting upset.
Try something like this to see the diffence:
class MyClass
{
public:
int Func(int i) { return(i); }
int Test() const { return(Func(0)); }
};
The compiler should complain when you call Test().
class MyClass
{
public:
int Func(int i) { return(0); }
const int Func(int i) const { return(0); }
int Test() const { return(Func(i)); }
};
The comiler should no longer be complaining, because it can now call a version of Func() that promisses not to change any of the data.
I have not tested these particular examples, but they should work. Note that the return of const int is not needed here, it could be changed to int . The key is the const following the declataion, which is a promise that it will not change the state of the class.
I hope that helps and that you now understand that it does make sense.
INTP
Every thing is relative...
|
|
|
|
|
followait wrote: iterator find(const key_type& k);
const_iterator find(const key_type& k) const;
While return-types are insignificant for overloading, const ness makes a difference.
So these two functions are really two different functions with the same parameters.
The const flavour is called when you invoke find() on a const map -object and returns only const references.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Is there any API to check whether a folder with a given name is already there in the system?
|
|
|
|
|
Hi,
I can't remember that I've ever met similar function but you can use others to check existence - it depends on what do you want to get e.g.:
- if you only want to check existence:
if( GetFileAttributes( sFileName ) == -1 )
return FALSE;
- if your folder should always to be: CreateDirectory
etc.
-----------
Mila
|
|
|
|
|
But all these functions are checking the current directory only. I want to check the entire system.
|
|
|
|
|
hm I'm not sure that I understand ...
e.g. GetFileAttributes (GetFileAttributesEx) checks file/folder pointed at (first) parameter - it can be useful when you know what are you want to check.
If you want to move along your folders and theirs subfolders on your disk, better way is use FindFirstFile & FindNextFile functions.
-----------
Mila
|
|
|
|
|
Aryan S wrote: Is there any API to check whether a folder with a given name is already there in the system?
try api PathFileExists
"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
|
|
|
|
|
I have only the directory name. I dont have any path. Now I want to check whether the directory is present in my system or not (Like windows search option). Is it possible witj any API?
|
|
|
|
|
Use the FindFirstFile() /FindNextFile() pair.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
hi all,
i would like to write a small app that detects which .NET runtime (if any) are installed on the client. this way the can check for the runtime without actually having it.
if a minimum requirement is not met it forwards them to a site which has the requirement for download.
how do i actually get the .net runtime?
i can do it from c# but i dont want that.
1. should i enumerate registry (not really backward compatable) or
2. looks for fs directories (this may vary)
3. use windows API (this is where i need the help) or is there another way ?
kind regards,
g00fy
|
|
|
|