|
LighthouseJ wrote: I want to replace that with a tree control and I don't know how to do that
I forget the name of it, but the class you derive your view from should be something like CFormView, and then you get a dialog template you can put controls on for the view.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
As far as your first question goes. The View that you are having is a normal view where u draw. If you want to put a Tree Control in there, you have couple of ways to achieve that.
1. You can try using CFormView and in the dialog box u can have tree ctrl view.
2. If you want a drawing view also with this view, you can put a frame in it and make it the parent of another view.
You can do lot of different stuff just by using child parent relationship and types of views. You would be surprised to see what all. Just try a little innovation and creativity and you have it.
Second question I am not sure exactly what you are trying to achieve. In any case you can create your own activeX control which contains both list ctrl and combo box etc. You can combine both of them with no big difficulty. If you are specific I would be able to help you.
|
|
|
|
|
To clarify the second question...
The standard list box is just filled with a line of text. I'm looking to build a list box like the one used in the list of wireless networks box in Windows. In there, each item has a couple text items and pictures. Another example would be the Add/Remove Programs dialog, where it has the program icon, the title of the software package, more text elements and a button or two. I want to make each item taller, fill it with multiple text items and possibly a picture. I'm thinking I could just derive a class from the regular tree view, and proceed but I don't know what to do.
ps. I'm investigating CFormView now, thanks to Christian Gaus and yourself.
|
|
|
|
|
LighthouseJ wrote: CFormView
Yay - I got it right !!!
LighthouseJ wrote: I want to make each item taller, fill it with multiple text items and possibly a picture.
You can derive a class from the tree view, and make it owner drawn. That means you write the code to show the text and image, at whatever height you like ( well, you can change the height of a menu item, I assume you can do it for a tree item also ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I think the CFormView will be fine, I've just broken the first chip off the CTreeCtrl block.
As far as the owner drawn thing, I want to do that to a list box, not the tree view from the previous problem, but I have no doubt the list view can be owner drawn. That's for another day.
|
|
|
|
|
I'm using Visual Studio .NET 2003 in C++. I'm trying to build a re-distributable application that is a Debug build (for a multitude of reasons) but one that is not using MSVCP71D.DLL and MSVCR71D.DLL. I want to use the release versions of these libraries (MSVCP71.DLL and MSVCR71.DLL). I didn't really thing it was a big deal.
In the projects property pages, I changed the C/C++->Code Generation: Runtime Library to be "Multi-threaded DLL (/MD)" from "Multi-threaded Debug DLL (/MDd)". I rebuilt the application. I used the Dependency Walker to check and it was linked to both versions of these libraries still!
This application statically links with a bunch of our static libraries. So I modified all of those libraries option for the Debug configuration to also be set to the /MD option. Rebuilt *everything*, rebuilt the application...no change!?
Is there something I am missing?...some property page setting I'm overlooking? Is there a tool to help me figure out why its linking against MSVCP71D.DLL? The Dependency Walker (the one packaged with MSVC++ 6) is nice, but it is showing this file to be a the top level of the tree; no help.
I'd appreciate any comments.
PS>I had a similiar issue with building this project which statically links an Intel Fortran library which was using debug DLL's (non-redistributable). Changing the Fortran libraries property to "Multhread DLL" solved the problem...
|
|
|
|
|
Gunn317 wrote: I'm trying to build a re-distributable application that is a Debug build (for a multitude of reasons) but one that is not using MSVCP71D.DLL and MSVCR71D.DLL
not a good idea. the debug versions of things like malloc and new (for example) are different enough from the release version that mixing them can be fatal. (ex. alloc with debug's malloc and de-alloc with release's free = boom)
Cleek | Image Toolkits | Thumbnail maker
-- modified at 10:24 Friday 28th October, 2005
|
|
|
|
|
Thanks for the reply. I don't want to mix them; I want to use the release version of all of the DLL's so I can distribute my app. But the app itself (our source code) needs to be built in debug mode so users can step through it. This is an example application that gets distributed/installed with our app.
I still haven't gotten it to work yet; msvcp71d.dll continues to be linked in, and I have no idea how!?
|
|
|
|
|
|
Thanks for the reply. We don't use MFC; that option is set to "Use Standard Windows Libraries". Anyway...I fixed my problem!
I used the linker option /VERBOSE to see information on libraries being searched and processed. What I got was a bunch of information, beginning with:
<codelinking...
starting pass="" 1
processed="" defaultlib:msvcprtd
processed="" defaultlib:uuid.lib
...
processed="" defaultlib:msvcprt
<="" code="">
I looked in the help and found that msvcp71d.dll is included from msvcprtd. I have no idea why this is being included as a DEFAULTLIB! And you can also see that the release version is also included at the very end of this list.
This also explains why my 'Ignore specific library' of msvcp71d.dll didn't do a thing. That is because that option will only ignore a library if it is found in this list. So, I added 'msvprtd' to the 'Ignore Specific Library' field. When I relinked, that first line was gone, and using the Dependency Walker, my app was now linking with the release libraries.
Thanks for the help,
|
|
|
|
|
I need to add nodes to a list regardless of its structure...I don't know how to do that since when the pointer is declared, it points to a certain data type, which needs to be generic...
Moreover I need a way to sort that given list on many criteria, where maximum n is the number of fields in the structure, and those may be numeric or alphanumeric.
(what I did before was if (crit1a = crit1b)&&(crit2a>crit2b) {switch...}, a more elaborate version of that, but my problem is mainly the generic issue)
............I'm so helpless..... Thx in advance!!!
|
|
|
|
|
Mariano Lopez-Gappa wrote: since when the pointer is declared, it points to a certain data type, which needs to be generic...
Just make it a void pointer. When it comes time to dereference those items in the list, however, you'll need to know what type each points to. Consider:
void main( void )
{
int Int = 5;
double Double = 12.34;
void *pVoid;
pVoid = ∬
printf("%d\n", *((int *) pVoid));
pVoid = &Double;
printf("%f\n", *((double *) pVoid));
}
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
thx for the help. it's been really useful. i'm a step closer to the solution but theres still an issue:
the actual matter about the generic list is that, in this program, the user gets to decide what "fields" of a database get on the list. so for each user, or even for the same user changing the configuration, I get a different kind of list.
so I gotta work on some kind of generic way to use those list, otherwise the number of field combinations are virtually infinite!
another thing...I haven't been able to figure out a way to apply the n-criteria sorting, the numeric-alphanumeric thing is easy, but first of all I don't know WHICH or HOW MANY fields I have, and also it gets confusing how to apply the sorting in a generic way...
this problem looks pretty complex...hope someone gets it right! thx in advance!!
|
|
|
|
|
Mariano Lopez-Gappa wrote: the user gets to decide what "fields" of a database get on the list.
This is probably a silly question but why not use the database to do the sorting for you? I do this all the time. I create a query based on what fields the user wants. Too slow or possibly you are making your own database??
John
|
|
|
|
|
I'm not going to use MFC, nor any database as I need my program to work on a 486 dx2. Also the purpose of the list is to display multisorted information on a grid.
Thx anyway! keep talking ppl plz!
|
|
|
|
|
Hi,
I think that each "certain data type" must have a common base class,
which could be as simple as
class CBase {
... Constructor/Destructor...
UINT m_type;
// The class type.
UINT GetType () { return m_type; };
};
Suppose you had various other classes CA, CB, CC, CD derived from CBase
Then the comparison routine for the sort could switch in the following way
int Compare( const void *e1, const void *e2 )
{
// handle element e1
switch ( ((CBase *)e1)->GetType() ) {
case TYPEA:
CA *A = (CA *)e1;
--- set some criteria based on CA info ---
break;
case ...
etc.
// handle element e2
switch ( ((CBase *)e2)->GetType() ) {
case TYPEA:
CA *A = (CA *)e1;
--- set some criteria based on CA info ---
break;
case ...
etc.
// Now make the comparison based on information generated in the
// last 2 steps.
--- comparison code ---
}
Id be interested to hear if anybody can think of a more general/elegant way to do it!
Cheers,
Dave
|
|
|
|
|
Hi
Bare with me for this question for its not VC++...but since my app is in win32 I am posting this question here.
I have a circle , say center cx,cy and radius R. At any point the user clicks either inside or outside the cirle ( but not too much far away from the circle). Say that point is ux,uy.
Now I have find the point on circle(say x,y)relative to ux,uy. ie,
I can imagine a line L starting from center to ux,uy, and the point where line L and circle meets is x,y. I ux,uy is inside the circle I have to extend the line L to meet the circle. How do I find x,y at any time.
I could'nt include the diagram here. so I am trying to clear as much as I can.
Thanks in advance.
|
|
|
|
|
you have to make a system with 2 equations.
one with the circle equation :
E1: ax²+by²=r²
where r is the radius (not sure about the word in english - it is diameter/2)
another with the line equation
E2: ax + by + c = 0
then solve the problem. you will have 2 solutions (as the line always goes through the center of the circle). to choose which is the right one, you'll have to compare the coordinates of the center, with the coordinates of the mouse click.
if ux > cx then
Solution is then one with x > cx
else if ux < cx then
Solution is the one with x < cx
else
if yx < cy then
Solution is the one with y < cy
else if yx > cy then
Solution is the one with y > cy
else
No Solution
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
My trig is rusty, but I think this will get you there.
Given the origin of your circle is at (Ox,Oy) and your mouse click is at (Mx, My) then your x,y pair for your circle is
X=Mx - Ox
Y=My - Oy
The angle between the line create by that point and the X axis would be
A = atan2(Y,X).
Now you want the point on your circle (Cx, Cy)
Cy = r * sin(A) + Oy
Cx = r * cos(A) + Ox
|
|
|
|
|
That worked...coooolll.
BIG THANKS...
|
|
|
|
|
I have this datagrid with I am binding with data set ... I am not using all the columns from table I am bounding with 5 columns only ... How do i increase the length of coulmns in datagrid ... so it looks good on page .. currrunly i have 5 columns in data grid .. all on left side ... data does wrap ..
Thanks
|
|
|
|
|
|
DataGrid1.DataSource = tempDs.Tables["Personnel"].DefaultView ;
I am setting columns in Property builder which doesn't have property to set width ... How do I do it?
Thanks
|
|
|
|
|
DataGrid1.Columns[0].ItemStyle.Width = 100;
DataGrid1.Columns[1].ItemStyle.Width = 300;
doesn't work
Thanks
|
|
|
|
|
Hello,
I have an MFC application with various standard MFC controls that display Japanese characters correctly. This application is also hosting an ActiveX control that dynamically creates and owns its own MFC controls. For some reason some of the MFC controls in the ActiveX control don't display the multibyte charachters correctly. These controls appear to be treating the multibyte strings as single byte strings.
Any thoughts on what might be causing this and how I can fix it? It appears that it's the dynamically created controls only that are having this problem.
Thanks!
-Ian
|
|
|
|