|
hi,
How to select a item in a tree control if i know path of that particular item.
|
|
|
|
|
yuvachandra wrote: i know path of that particular item
Whats does this mean ? Is it text displayed ?
You need to traverse tree control items inorder to go to particlular node and select it.
|
|
|
|
|
i have a path D:\New\NewFolder.Now i have to select the item which contains the text NewFolder.How can i do it.
|
|
|
|
|
yuvachandra wrote: i have a path D:\New\NewFolder.Now i have to select the item which contains the text NewFolder.How can i do it.
I am assuming D: is root Node and you first have to find New Under it using GetChildItem and GetNextItem and comparing the text with New, after you find Text New, GetChildItem and GetNextItem to Find NewFolder, using TreeHandle you got from search use SelectItem select that item
"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
Support CRY- Child Relief and You
|
|
|
|
|
Hello all,
As per my previous post i m trying to pass two parameters to my thread one is CString n one is integer.
For that i have made a structure
which constitute of two variable CString and int resp..
in a function i m making structure object like this
test *obj;
obj = new test;
n giving its variable values like this
obj->item = 10;
obj->str = "nItem";
n after that starting thread like this
Ping = AfxBeginThread(PingThread,obj);
my thread LPVOID paramter recieves its value
inside my thread i m able to retrieve only first value either its a CString or an integer
cstrHost = *(static_cast<cstring*>(pParam));
int_val = *(static_cast<int*>(pParam));
trying to retrieve 2nd int value is giving a garbage value
can anybody guide me in this....
|
|
|
|
|
you will recive whole struct as parameter
void MyThred(LPVOID lpStruct)
{
MyStruct *pStruct = static_cast<MyStruct*>(lpStruct);
}
|
|
|
|
|
thanku prasad
my problem got solved....
|
|
|
|
|
Ok, so there is this word that I am trying to remember. Problem is, that I can't remember what it was :P and it's not a real word - it is just made-up.
The thing is though, that it follows all the rules of the english language, so I attempted to make a program that would print every single possible combination of letters to console (up to 10 characters per word) that makes up a legal word in the english language. I have actually done rather well so far, however now I've gotten to the tough part. I need to start calculating each letter in the word.
I know that the word starts with the letter G, so the next obvious step is to figure out if it is possible to put an A next to that G to give me 'GA' then this word (which is completely legal in the english language) is printed to the console so that the user can see it. Then the loop starts again, but this time it tries to combine the letters G and B to give me 'GB'. This isn't possible in the english language so it simply skips ahead to the next letter until it has reached the end of the alphabet and has attempted to combine G and Z. Then the loop will try to append the letters A through Z to all of the currently possible words (GA, GE, GI, GO, GU).
So I now know what I have to do, but I have no idea how to turn it into functioning code.
I was wondering if anybody would like to have a go at making this program for me, or would like to offer some insight as to how I would go about doing it. If you guys would like, I can post my code here for you to work off of.
|
|
|
|
|
What are the rules?
Steve
|
|
|
|
|
well, its the English language, so there is alot of them, but I will make a start. I only have 10 minutes so I can't give you many until later on.
1) The letter Q must always be followed by the letter U. eg "QUeen".
2) There can be no more than two of a single letter next to each other. eg "eFFort", "ardvAArk".
3) There can only be one of the same letter at the beginning of a word - you cannot put two of the same letter at the beginning. eg "Grace", "Barrage".
4) ...more to come.
|
|
|
|
|
These rules are really the hard part or the program, the rest is brute force. I'll wait until you post more rules before I make any suggestions.
Steve
|
|
|
|
|
Sauce! wrote: 1) The letter Q must always be followed by the letter U. eg "QUeen".
So much for burqa, qwerty, tranq, suq, sheqel, et al.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
lol, I'm sure that I can discount those words for now, seeings as the word DEFINITELY didn't have a Q in it. :P
|
|
|
|
|
hi,
I have to read a file content and i have to copy that content to buffer(char *buffer),this buffer is one of the parameter of a function(that is i have to pass the content as a parameter to a function).And iam confused how to start it???
Help me with your suggestions
Thanks in advance.
Siddharth
|
|
|
|
|
CStdioFile::ReadString
"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
Support CRY- Child Relief and You
|
|
|
|
|
siddharthsan wrote: I have to read a file content and i have to copy that content to buffer(char *buffer)...
So what's troubling you? Are you using C, C++, VC++, or MFC? There are many solutions but you've not even provided a starting point for us to work with.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
how to write into a file to a particular loaction in vc++
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
See Seek/SeekToBegin/SeekToEnd of CFile
|
|
|
|
|
CFile::Seek()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
deeps_cute wrote: how to write into a file to a particular loaction in vc++
what type of file... BInary or Text
"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
Support CRY- Child Relief and You
|
|
|
|
|
When a file is opened, the file pointer is positioned at offset 0, the beginning of the file.
You can reposition this file pointer in a previously opened file. The Seek function permits random access to a file’s contents by moving the pointer a specified amount, absolutely or relatively.
|
|
|
|
|
Paresh Chitte wrote: When a file is opened, the file pointer is positioned at offset 0, the beginning of the file.
Every Question have Reason hidden behind it! seeking and positioning in Text file is mush easier the doing that in binary file. when data stored in file is of different length. my concern is only that!
"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
Support CRY- Child Relief and You
|
|
|
|
|
How to select an item from ListControl on mouse moving over it?
|
|
|
|
|
|
Use Following code,
void CMyListCtrl::OnMouseMove(UINT uFlags, CPoint point)
{
int nItem = HitTest(point, &uFlags);
if (uFlags & LVHT_ONITEM)
{
SetItem(nItem, 0, LVIF_STATE, NULL, 0, LVIS_SELECTED,
LVIS_SELECTED, 0);
}
CListCtrl::OnMouseMove(uFlags, point);
}
|
|
|
|