|
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
|
|
|
|
|
May somebody tell me how to get the selected text in the editView?( not using GetSelectedText() )
3ks!
|
|
|
|
|
Use GetDlgItemText()
or
GetWindowText()
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
-- modified at 0:04 Friday 21st April, 2006
|
|
|
|
|
first get the edit ctrl in the CEditView using
CEditView:GetEditCtrl()
Now u will get a pointer of CEdit from which u can get the selected text
nave
|
|
|
|
|
GetWindowText() can do the trick for you.
Project4Hire.com - Find Freelance Progammers and Graphic Designers for all your project needs
|
|
|
|