|
Im happy to help on the condition that you attempt to use the English language correctly. Thankx is not a word, nor is it an abreviation of any word in the English language. In fact its not an abreviation at all.
Now the rant is over....
a few questions...
1) why do you need the mask in the structure? If you are adding text and an image everytime the mask will be constant.
2) why do you need to know if it has children? I think you need to know if it has a parent
3) why not use CString and not char strNodeText[20]? to be really picky why is it called strNodeText? text would be fine. The node part is implied by the fact its a member of a class or struct that represents a node. The data type is implied by the word text so str is not required (i really hate hungarian notation)
4) tTreeNodeEnum.... what is this? I suspect its not required.
Why dont you have something like this
UINT id;
UINT parentId;
UINT iconResourceID;
CString text;
UINT order;
where id is just a unique number that you assign. This allows you to represent your tree structure in your data.
You could store this data in an xml file and the parentId would not be required as the tree structure would be represented by the xml. Same with the registry
Hope this helps
|
|
|
|
|
mavrick23 wrote:
Is there some way to generalize this
XML works great as a data source for tree controls.
But, that's just my opinion... I could be wrong.
Hate is not a family value.
-pete
|
|
|
|
|
i have created a status bar in my dialog based application.
the code is below:-
#define IDC_STATUSBAR 32000 //resource id
CStatusBarCtrl m_StatBar;
BOOL m_bStatOK = m_bStatBar.Create(WS_CHILD | WS_BORDER | WS_VISIBLE, rect, this, IDC_STATUSBAR);
m_StatBar.SetText("Application Running",0,0);
The program is running fine. the text is shoen on the left hand side of the status bar. Now i want to display another text on the right hand side of the statusbar. how do i do? i tried by inserting the statement
m_StatBar.SetText("Time",255,0);
But it had no impact?
how do i proceed
|
|
|
|
|
You have to first define your panes.
You will need 3 panes, one for the text on the left, one for the text on the right and one to act as a seperator.
Call CStatusBar::SetIndicators() to define the number of panes and the id for each
Then call CStatusBar::SetPaneInfo() for the seperator and give it the SBPS_STRETCH style. This will cause the seperator to fill all the unused space between the panes
|
|
|
|
|
im using mySQL and i have a problem on how to call BLOB into visual C++/MFC..the syntax and any declaration needed..
|
|
|
|
|
Hi..Check out..codeproject site..
A aritcle is there for saving BLOB data..use that method..that is applicable to all database...
Bye..Have fun..
Never consider anything Impossible before trying to solve that..---Sumit Kapoor---
|
|
|
|
|
How do you display an open/save dialog in MFC and get the file path/s that was/were selected?
|
|
|
|
|
Have a look at CFileDialog
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Try using this code:
CFileDialog fileDlg(TRUE);
if(fileDlg.DoModal() == IDOK)
{
CString strFileName;
fileDlg.GetPathName();
MessageBox(fileDlg);
}else{
MessageBox("No file selected!");
}
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
Hai,
I'm doing a dialog application in win32. I have several static labels in my dialog. I'm doing a sequence of drawing and once I finish the sequence ,I Invalidate my whole dialog to erase all my drawings. When I do this my first label alone disappears and later in the application when I do again Invalidate Rect then it appears.What's the problem here? I'm not using that static label(which dissapears) anywhere in my program. It is just there as a label.What did I miss? Thanks a lot.
|
|
|
|
|
Hai,
I'm doing a dialog application in win32. I have several static labels in my dialog. I'm doing a sequence of drawing and once I finish the sequence I Invalidate my whole dialog to erase all mt drawings. When I do this my first label alone disappears and later in the application when I do again Invalidate Rect then it appears.What's the problem here? I'm using that static text anywhere in my program. It is just there as a label.
What did I miss? Thanks a lot.
|
|
|
|
|
I need to be able to detect CD Burning devices, but after searching for some time now I'm still not sure how to get the information I need.
I need to be able to detect that there is indeed a device that can burn to CD-R/CD-RW (be is a CD burner, or a DVD burner than supports burning CDs too). What I *really* need is the drive letter for that device.
I do not actually need to do any burning, I simply need to detect that one exists and report the drive's letter.
If you have any ideas that will save me from Google-Hell, please let me know!
Thanks!
: Dean
: Dean 'Karnatos' Michaud
|
|
|
|
|
Dean `Karnatos` Michaud wrote:
I need to be able to detect CD Burning devices...
Have you looked at the Win32_CDROMDrive and Win32_PhysicalMedia WMI classes?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hi
i'm trying to use this package for my program: http://www.codeproject.com/miscctrl/pgllib.asp
can any one give me an idea how should i do add it? i did download it in my c drive but don't know how to use it
sorry i'm new
really thank you
|
|
|
|
|
Oriocat wrote:
can any one give me an idea how should i do add it?
Did you not read the "Installation" and "Getting your project started" sections of that article?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I did i have GDI+ and don't know ehre to find Gdiplus.dll. also i can't recompile the source which i'm not sure why
really thank you
|
|
|
|
|
Oriocat wrote:
...don't know ehre to find Gdiplus.dll.
Have you looked for it? On my machine, it's in the c:\winnt\system32 folder.
Oriocat wrote:
i can't recompile the source...
Which tells us nothing. What compiler/linker errors are you getting? What do the lines in error look like?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Oriocat wrote:
also i can't recompile the source which i'm not sure why
I am almost certain you need a compiler for that.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
1. How can I drag my dialog when draging over a certain portion of the dialog??? When I'm using:
UINT CNBinderDlg::OnNcHitTest(CPoint point)
{
UINT ret = CDialog::OnNcHitTest(point);
if(ret == HTCLIENT)
{
return HTCAPTION;
}
return ret;
}
I can drag the window by draging anywhere in the window.
2. Is it posible to hide or lock a directory, not only in explorer(with ".{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}") but in other file managers like TotalCommander too??? Thanx!
|
|
|
|
|
1. Easily.
As you can see in the WM_NCHITTEST message handler, you receive a CPoint object that specifies the point, in screen coordinates, where the hit test was made. If you first use ScreenToClient function to convert the CPoint into client coordinates then you can compare the coordinates to a pre-made list of where the function should return HTCAPTION . Everywhere where HTCAPTION is returned, the dialog becomes draggable.
Thus, if, for example, the x-coordinate of the CPoint is smaller than a half of the dialog's width, then you return HTCLIENT . Otherwise you return HTCAPTION . As a result, when you click and hold on the right-most half of your dialog, it can be dragged.
2. Some advanced file managers by-pass the security settings placed in the registry. To go around this, you could try the _access and _waccess functions of the Run-Time C Library. Not sure if they work though...
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen wrote:
...you could try the _access and _waccess functions...
These are "get" functions not "set" functions, or did I miss your intent?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
you are right DavidCrow. _access and _waccess are get functions. I wan't set functions that hides (locks) folders no matter on what account you are, including administrator. Any ideas anybody?
|
|
|
|
|
I do not know how to do it programmatically.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have a ListCtrl that is being updated with new data, I was planning to use the doubleclick to stop the updating and allow the use to edit two fields in the list, one is decimal the other in Hex. This would be via a right mouse click.
My question is how do you edit these fields in this control. I have only ever used this control to display data (View = report style). So I would like to right-click and see the 2nd and 4th colums in an editable state.
I have set up a control variable for the control but dont know how to use it for editing data items.
Any samples or a few lines of code.
Many thanks,
Sweep
|
|
|
|
|
Pretty simple really you create an edit control dynamically and then size and position it in the area that the list control cell occupies. The user edits the edit control then presses enter which you capture as the [end edit] signal. Then you copy the edit control text into the list control and wherever else you need it and either destroy the edit control or hide it to reuse it later in another cell.
If my memory is correct there are more List Control topic articles on CodeProject than any other single topic. Take a look at them and see if they dont show you how to do that. If not post back here and I will take a shot at it. I have some code laying around somewhere where I did that and more in a list control.
Hate is not a family value.
-pete
|
|
|
|