|
|
Hello,
Can anybody help me to create a list control with a tree view support?
Thank you!
|
|
|
|
|
|
I need to create a text link to a site in a dialog box. I have seen in many windows aplications it is a blue text and on mouse press an iexplorer window opens with the link in the address bar.
I know how to open an explorer window but I don't know how to create the text and the event listener that will underline the text and will listen to mouse clicks.
Any help will be apreciated.
I have a dialog based application in visual studio 6.
Thanks,
dragulceo.
|
|
|
|
|
|
Thank you very much ... that's what i'm looking for!
|
|
|
|
|
|
i want to make a game that can be run on two or more computers where the users can play each other (like an instant messaging game). how can i do this??
any code websites or information that can show me how to do this would be greatly appreciated.
thank you in advance for your help.
- Kyle
|
|
|
|
|
I have a problem whith change type
code like this:
for(int j=0;j<=str.list.GetCount();j++)
{
this->lst.AddTail(str.list.GetAt(j));
}
: error C2664: 'class CString &__thiscall CStringList::GetAt(struct __POSITION *)' : cannot convert parameter 1 from 'int' to 'struct __POSITION *'Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
can anyone help ~
thanks in andvance~~
nothing
|
|
|
|
|
|
Lists don't have indexed access using int, as arrays do. Instead you can iterate and access elements through POSITIONs. Internally, a POSITION is just a pointer to one of the list nodes, which in turn points to the actual data, but it's better if you avoid considering the internal details and just use it as an abstract POSITION, regardless of implementation details.
Iterating lists, as in the code you showed, can be written like this:
POSITION pos = str.list.GetHeadPosition();
while (pos)
{
lst.AddTail(str.list.GetNext(pos));
}
However, if both are CStringLists, you can add one to the other like this:
lst.AddTail(str.list);
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thanks that did it.
Robins E
ebinaini@163.com
nothing
|
|
|
|
|
In addition, MFC containers are total crap. Try moving to the STL.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
...MFC containers are total crap.
How so?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
well, you realise they were written for use before the STL came online ?
Three things spring to mind:
1. They don't use common iterators, so it's not easy to move stuff from one to another, or work with two different types of container together
2. They don't support function objects
3. They don't have a library of prebuilt algorithms defining the majority of operations you're likely to want to do on items in a container.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
But the lack of those things does not explain why MFC is considered crap. If a person never has a need for common iterators, function objects, or prebuilt algorithms, are they therefore still considered crap?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Well, here are some points
1. If a person finds themselves suddenly in a non MFC app, they will be lost, because they've relied on MFC for things that it's not really good at, instead of using C++ itself
2. I can't see too many people NEVER needing the better support that the std library, which works everywhere, offers. So why learn a lesser library, that only works in MFC apps ?
Beyond that, I'm sure they do what they're supposed to, I just don't see the point in learning something that is limited in two ways, in how they can be used, and where you can use them.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
All valid points, but they still fail to explain why "MFC is crap." I've been using them since 1992 and they have served me quite well. The only classes that I still have no need for are ones beginning COlexxx. I recently found an error in CString::Delete() that has existed for several versions but is now fixed with VS 2005. That would hardly be fair of me to label the entire library as crap, however. Back in the mid 90s, I found a bug in one of the common controls (SysListView32). After proving that it could be reproduced in VB, C, and MFC, I was finally able to talk with level 2 support in the common controls group at Microsoft. I certainly did not consider any of the common controls, especially that one, to be crap. It was a very isolated problem.
Christian Graus wrote:
1. If a person finds themselves suddenly in a non MFC app, they will be lost, because they've relied on MFC for things that it's not really good at, instead of using C++ itself
Are you assuming that the non-MFC application is still GUI? If so, I'm not sure how the STL would be of any help to someone wanting to create a GUI application. If not, then the STL would certainly be of value.
Christian Graus wrote:
2. I can't see too many people NEVER needing the better support that the std library...
How is it better supported? Are you talking about support from Microsoft?
Christian Graus wrote:
I just don't see the point in learning something that is limited in two ways, in how they can be used, and where you can use them.
All tools have limitations. Those limitations, however, are not always relevant to the solution.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
All valid points, but they still fail to explain why "MFC is crap."
The MFC *containers* are crap. For the reasons I have stated.
DavidCrow wrote:
Are you assuming that the non-MFC application is still GUI? If
No, why would I ?
DavidCrow wrote:
If so, I'm not sure how the STL would be of any help to someone wanting to create a GUI application. If not, then the STL would certainly be of value.
You seem to have missed my point. If I am working on a nonMFC app, and I need containers, if I have learned the MFC ones instead of STL ( as many do ), I will be initially lost.
DavidCrow wrote:
How is it better supported? Are you talking about support from Microsoft?
No, I'm talking about compilers that support the STL, compared to compilers that support MFC.
DavidCrow wrote:
All tools have limitations. Those limitations, however, are not always relevant to the solution.
Yes, I agree. MFC in general has limitations, but I still regard it as a good library, certainly a good alternative to Win32. However, like I said, it does include stuff that IMO does not add to the library, and encourages bad programming practice. The MFC containers were written prior to the C++ standard, and exist for legacy support. I'm aware of shops that don't let programmers use STL because 'Microsoft has containers and we're a Microsoft shop'. That sort of idiocy, combined with general ignorance ( that is, people using MFC find the containers, and have no idea there is a standard alternative ), is the reason I remain a pariah, a lone preacher in the wilderness, defending the use of the standard library for containers.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
The MFC *containers* are crap.
My bad. I overlooked the 'containers' part.
Christian Graus wrote:
If I am working on a nonMFC app, and I need containers, if I have learned the MFC ones instead of STL ( as many do ), I will be initially lost.
Why? That implies that those who do not know/use STL are lost. Can such a generalization be made?
Christian Graus wrote:
No, I'm talking about compilers that support the STL, compared to compilers that support MFC.
Ok, but what if support for more than one compiler is not one of the requirements? Is that still a reason to use one over the other?
Christian Graus wrote:
However, like I said, it...encourages bad programming practice.
For example.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
Why? That implies that those who do not know/use STL are lost. Can such a generalization be made?
Because I'm sure a LOT of people who use the MFC containers don't even know they are part of MFC. If I am used to using a language, and suddenly the part I try to use goes AWOL, I will be confused, and I'll need to find/learn an alternative. That's all I meant by 'lost'.
DavidCrow wrote:
Ok, but what if support for more than one compiler is not one of the requirements? Is that still a reason to use one over the other?
Yes, for the reasons I stated. Apart from the STL containers being *better*, they are also cross platform, you lose NOTHING by learning how to use them, and if you find yourself on a project that is on another platform, you'll already know how to use the containers there.
DavidCrow wrote:
For example.
It is bad practice IMO to tie yourself to a specific platform, which is not even universal in the Windows world, let alone the programming world at large, when the standard alternative is actually better. Microsoft did not intend for people to do this, either. Just like it's bad practice to pass char * around instead of using a string class, or FILE handles instead of a stream class, but people do it, because it's what they are used to, and they never stop to think of alternatives.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Do not use indexers to locate item in the list..
You can use Position..
Use the following code
POSITION Pos = str.list.GetHeadPosition();
while (Pos != NULL)
{
this->lst.AddTail(str.list.GetNext(pos));
}
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Hello,
I am trying to build a small directshow application as follows:
video-capture-source --> MPEG2 demultiplexer --> MainConcept MPEG Decoder --> video renderer.
This I have done successfully. However, now I just want to tap the output of the MPEG decoder (frame by frame without saving into hard disk) and do some post processing on these frames. Can anyone suggest me how to do this. mind you, that i dont want to save it on a hard disk using file writer, i just want to capture the output frame by frame -process each frame and provide a score or something like that as output.
Thanks,
Sashi.
|
|
|
|
|
I am now trying to compile a DICOM toolkit ( public domain ) that comes with a VS2003 project, but does not compile. The errors are all in linking, stuff like
Error 1 fatal error LNK1117: syntax error in option '' dcmmkdir
Now: if I go to the project settings, the command line generated is this :
/Od /I "../../config\include" /I "../../dcmjpeg\include" /I "../../ofstd\include" /I "../../dcmdata\include" /I "../../dcmimgle\include" /I "../../dcmimage\include" /I "../../dcmjpeg\libijg8" /I "../../dcmjpeg\libijg12" /I "../../dcmjpeg\libijg16" /I "../../../zlib-1.2.1\include" /I "../../../tiff-3.6.1\include" /I "../../../libpng-1.2.5\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_REENTRANT" /D "WITH_LIBPNG" /D "WITH_LIBTIFF" /D "WITH_ZLIB" /D "dcmmkdir_EXPORTS" /D "CMAKE_INTDIR=\"Debug\"" /D "_VC80_UPGRADE=0x0600" /D "_MBCS" /FD /EHsc /RTC1 /MTd /Fp".\Debug/dcmmkdir.pch" /Fo".\Debug\\" /Fd".\Debug\\" /W3 /nologo /c /Z7 /TP /errorReport:prompt
I think this bit: /D "CMAKE_INTDIR=\"Debug\"" is the problem, but I can't see where it's set, there are places that set the directory to build to be debug, but none have the trailing quote. Can anyone suggest how I fix this ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
Error 1 fatal error LNK1117: syntax error in option '' dcmmkdir
Now: if I go to the project settings, the command line generated is this :
/Od /I "../../config\include" /I "../../dcmjpeg\include"
That's the command line for the compiler, not the linker
Christian Graus wrote:
I think this bit: /D "CMAKE_INTDIR=\"Debug\"" is the problem, but I can't see where it's set
It should be under C/C++ / Preprocessor / Preprocessor Definitions.
Christian Graus wrote:
there are places that set the directory to build to be debug, but none have the trailing quote
If you look at the Preprocessor Definitions you should find one saying
CMAKE_INTDIR=\"Debug\"
That is, with escaped quotes. When the definition is passed to the command line, it's in turn surrounded by quotes and appended after a /D option. So, the quotes (both escaped and normal) are properly balanced. I don't think that would be a problem.
I'd look at the linker command line
Christian Graus wrote:
Error 1 fatal error LNK1117: syntax error in option '' dcmmkdir
That's what you see in the "Error List" or "Task List" tab, right? If I interpret it right, dcmmkdir is just the name of the project in which the error occurred and not part of the error message itself, which is in another column. If I got it right, then, the actual error is saying there is a syntax error in option '' (note it's not a quote, but actually an empty option surrounded by single quotes)... That's odd...
Look at the wording in the Output window, which will show the exact output from the linker. Maybe that would shed some light and point you in the right direction.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|