|
Hi,
I'm using VC++6.
I have a CTreeCtrl in my dialog.
How do i detect whether the selected item in the tree control is a root item or a child item?
I'm not associating any image to the items.
Thanks & Regards,
sanju.
|
|
|
|
|
First, get the selected item, then check if it has a parent. Not quite sure if this will return TVI_ROOT or NULL for a root item.
HTREEITEM CTreeCtrl::GetParentItem( HTREEITEM hItem );
I've deliberately glossed over the selected item bit, as you could have multiple items selected. You'll have to keep a close eye on the selections you make, search through the item states for TVIS_SELECTED, or monitor TVN_SELCHANGED (which would be my choice).
Iain.<div class="CPhogPost"></div>
<div class="ForumSig"></div>
|
|
|
|
|
When im working in workspace, I got one Pop-up as
"C:\Documents and .......\CSS\CS3Opr.CLW
THis file has been modified outside of source editor,Do u want to reloda it. YES or NO"
Like this i got the popup,when im pressing YES or NO,it does not get vanshed.Its continously asking me.Even i cannot close the pop up.And also the workspace and also VC++.
THen i have to close the vc++ through TaskManager only.
How can i avoid it.
What the mistake i made? now Im doing coding for bitmap button functions.
Anu
|
|
|
|
|
Anu_Bala wrote: Like this i got the popup,when im pressing YES or NO,it does not get vanshed.Its continously asking me.Even i cannot close the pop up.And also the workspace and also VC++.
THen i have to close the vc++ through TaskManager only.
How can i avoid it.
What the mistake i made? now Im doing coding for bitmap button functions.
which service pack of VS6 is installed on your computer!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Im having Vc++6.0 Enterprise edition
Anu
|
|
|
|
|
Anu_Bala wrote: Im having Vc++6.0 Enterprise edition
Sorry, for not able to put my question properly. actually i am looking the Visual Studio Service pack. open Visual Basic 6, you will get Service pack information there i.e. liek SP5,SP6
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Anu_Bala wrote: Im having Vc++6.0 Enterprise edition
Which does not indicate the service pack, if any.
"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
|
|
|
|
|
Hi to all,
I have an problem when I try to build my app:
<br />
error LNK2001: unresolved external symbol __imp__SHCreateStreamOnFileW@12
I included:
<br />
shlwapi.h
and linked it with 'ShLwApi.Lib'.
What seams to be the problem here?
THX
|
|
|
|
|
It seems that the compiler can not determine where the function is, like if the library was not properly included.
Include the library to the project (Project->Add to project...), include the header, delete/rename the debug/release folder and try to "rebuild all..."
What happens?
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
|
|
|
|
|
I tried something else, now when I compile and get errors saying numerous 'struct' type redefiniton like:
<br />
d:\vistasdk\include\propidl.h(147) : error C2011: 'tagCAUB' : 'struct' type redefinition<br />
d:\vistasdk\include\propidl.h(153) : error C2011: 'tagCAI' : 'struct' type redefinition<br />
d:\vistasdk\include\propidl.h(159) : error C2011: 'tagCAUI' : 'struct' type redefinition<br />
d:\vistasdk\include\propidl.h(165) : error C2011: 'tagCAL' : 'struct' type redefinition
and more!
???
Thanks for your replay!
|
|
|
|
|
I guess you are including a header twice in your app. Because of that you are having the definitions of typedef twice, and the second one gives an error.
Check out your includes, and take a look into #pragma once
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
|
|
|
|
|
Hi,
I have a mobile device, I want to run my program on it, my program is written on C++ language, but when one of mobile’s keys is hit, one tool bar comes on top of my program and it does not go until I close my program and then run it again.
How can I remove the tool bar in the middle of running program?
Please help me
Thanks a lot
|
|
|
|
|
Hi all,
I have the following std::string array. How can I get hold of the first elements data? I have tried the following without success:
std::string openDoorTags[50];
char copyToBuf[128]={0}
strcpy(copyToBuf, openDoorTags[0].c_str());
Can anyone please help?
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: I have tried the following without success:
And what is the problem ?
|
|
|
|
|
How do I get hold of the data in the first element of the string array and copy it into the char buffer ? When perform the code above nothing happens .... the buffer remains blank although the string array element has data in it ....
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: the buffer remains blank although the string array element has data in it ....
Uh, in your code above, all the strings in your array are empty, so it's normal that the buffer will be empty too.
What happens if you try something like this ?
std::string openDoorTags[50];<br />
openDoorTags[0] = "Test";<br />
char copyToBuf[128]={0};<br />
strcpy(copyToBuf, openDoorTags[0].c_str());
|
|
|
|
|
Cedric Moonen wrote: all the strings in your array are empty, so it's normal that the buffer will be empty too
Sorry ... I forgot to mention that the string buffer has data in it. But I will try the snippet that you supplied.
Thanks Cédric
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: I have the following std::string array. How can I get hold of the first elements data? I have tried the following without success:
the code seems fine to me, but only thing seems problamatic to me, is if your first element contain the data more than 128 character. there could be overflow in strcpy call!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
What does the following produce:
cout << openDoorTags[0].c_str();
"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
|
|
|
|
|
hello all,
i have a problem with creating a dialog inside a dialog and removing it . i mean by creating dialog is embedding the dialog with the help of a picture frame and i did that by doing this piece of code
m_GAUserEnteredOption.Create(this, IDC_S_VIEW_USERENTEREDOPTION,
IDR_F6CP_MAINFRAME,
RUNTIME_CLASS(CGADocument),
RUNTIME_CLASS(CGAMainFrame),
RUNTIME_CLASS(CDigitalUserOption),
WS_CHILD | WS_VISIBLE, 0L);
and i did this because on the original dialog i couldnt place anymore controls since it was overflowing (crossed 255) , but once i embedd this dialog i cant remove it. i tried using destroywindow() or closewindow() its not working . and i cant get to the original controls which are on this place before . how to remove this frame and dialog through code . if anybody knows it plz help me
"Men never do evil so completely and cheerfully as when they do it from religious conviction"
-Pascal
|
|
|
|
|
If you know that you will need it by all means, why dont you design it in your resource editor, stablish a class to it and use DoModal? It will be easier.
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
|
|
|
|
|
hi ,
its not supposed to be a child window but in the same dialog i need it . it doesnt have any ok or cancel button ,its just a formview class dialog attached to another dialog . like a patch of new set of controls it will attach to original dialog and it has another class also for that. but i cant remove through code once it is attached .
"Men never do evil so completely and cheerfully as when they do it from religious conviction"
-Pascal
|
|
|
|
|
And why dont u use a simple dialog and resize it to have more working surface?
I have more than one VariabledSize Dialog in one project, and more than one view (up to 28 CFormViews in 4 types with different sizes according to the type they belong).
But I didn't mix things, CFormViews are in independant frames, and Dialogs are "unique".
To make the Dialog with variable size, I designed it in my resource editor with ALL the controls I needed and set them to not visible, then according to the parameters that determined how many of the should be visible... I used the SetWindowPos / MoveWindow to change the size and made visible just the controls that must be shown.
does the idea help you?
If not... I ask you for a better explanation, im not english speaker and I have not understood what you need
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
|
|
|
|
|
Hi,
I am using a CListCtrl with check boxes for the row (using LVS_EX_CHECKBOXES). Now, my requirement is to use check box in column header of the CListCtrl so that I can "Select All" or "Deselect All" items in list on a single click.
Any help would be appreciated.
Regards,
Paresh.
|
|
|
|