|
Hello,
I would like to sort a vector(vlines), this is a vector with struct's(line).
I want to sort the vector on name and on length.
struct line{<br />
CString name;<br />
double length;<br />
};<br />
<br />
vector<line> vlines;
I know there is a function sort and that it uses a predikaat function.
<br />
std::sort(vlines.begin(), vlines.end(), length<line>());<br />
std::sort(vlines.begin(), vlines.end(), name<line>());<br />
But how can i code the predikaat function's? or template's??
I hope someone can help me?
Thanks
|
|
|
|
|
Those predicates are anything (functions, objects) that can be called with the same syntax as a function. So, even a function can do; for instance:
inline bool compare_line_by_length(const line&x,const line& y)
{
return x.name<y.name;
} can be fed to std::sort like this:
std::sort(vlines.begin(), vlines.end(), compare_line_by_length);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
How can I remove OK and Cancel buttons from my PropertySheet to add only Close button???can u plz respond immediately??
thanks in advance
ThomasKennedyBose
|
|
|
|
|
|
Hi.....Its Great.....thanks a lot...thanks for your immediate response
ThomasKennedyBose
|
|
|
|
|
could anyone give me help on sending data to a fly pen plotter, how to use hpgl for the same ..any help article link would also do..
|
|
|
|
|
Most of the plotters I have ever worked with took a serial character stream of commands, in whatever goofy syntax was unique to each one. The trick was always to get the command strings formatted properly before sending them to the plotter.
That was many years ago, so the memory is a little fuzzy. Didn't a Google search help any?
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Hi,
I wanna get the number of records of a table from an Access database by CDatabase & CRecordset classes.
What is the appropriate function?
Thank you in advance.
|
|
|
|
|
A typical SQL query to do this is
<br />
SELECT COUNT(*) AS Total FROM Table WHERE condition<br />
You access the return value as you would a value from a conventional query
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hi!
I'm looking for a source documentation tool that uses a Doxygen like documenting syntax (/** or /// or /!* etc) but produces XML-files that are compatible to the default C#-xml-documentation. I'd like to use the output in NDoc to create the final chm-files. Does anybody know about such a tool?
- Andre
|
|
|
|
|
I seem to remember reading somewhere in the documentation that Doxygen could do this already. It might be worth doing a bit more digging.
Having said that I've only looked at it briefly!
Anna
www.annasplace.me.uk
"Be yourself - not what others think you should be" - Marcia Graesch
Trouble with resource IDs? Try the Resource ID Organiser Add-In for Visual C++
|
|
|
|
|
doxygen can output xml, but of course it has a different structure than the xml output by c# compiler.
e.g.:
C# compiler:
[code]
<?xml version="1.0"?>
<doc>
<assembly>
<name>CSDocTest</name>
</assembly>
<members>
<member name="T:CSDocTest.Foo">
<summary>
Brief description for Foo
</summary>
</member>
<member name="M:CSDocTest.Foo.Main(System.String[])">
<summary>
Main entry point.
</summary>
<param name="args">Commandline-parameters</param>
This is a test
<remarks>This function is not tested yet</remarks>
</member>
</members>
</doc>
[/code]
Class doc by doxygen:[code]
<?xml version='1.0' encoding='iso-8859-1' standalone='yes'?>
<doxygen version="1.3-rc3">
<compounddef id="classCSDocTest_1_1Foo" kind="class">
<compoundname>CSDocTest::Foo</compoundname>
<listofallmembers>
<member refid="classCSDocTest_1_1Foo_1f0" prot="private"
virt="non-virtual"><scope>CSDocTest::Foo</scope><name>Main</name></member>
</listofallmembers>
<sectiondef kind="private-static-func">
<memberdef kind="function" id="classCSDocTest_1_1Foo_1f0"
virt="normal" prot="private" static="yes" const="no" volatile="no">
<type>void</type>
<definition>void CSDocTest::Foo::Main</definition>
<argsstring>(string[] args)</argsstring>
<name>Main</name>
<param>
<type>string</type>
<declname>args</declname>
<array>[]</array>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
<para>Main entry point. <parameterlist
kind="param"><parametername>args</parametername>
<parameterdescription>
<para>Commandline-parameters</para></parameterdescription></parameterlist>
This is a test! <simplesect kind="note"><para>This function is not tested yet</para></simplesect>
</para> </detaileddescription>
<location file="F:/Gentlestorm/CSDocTest/Class1.cs" line="20"
bodystart="19" bodyend="24"/>
</memberdef>
</sectiondef>
<briefdescription>
<para>Brief description for Foo<ref refid="classCSDocTest_1_1Foo"
kindref="compound">Foo</ref>. </para> </briefdescription>
<detaileddescription>
</detaileddescription>
<location file="F:/Gentlestorm/CSDocTest/Class1.cs" line="12"
bodystart="11" bodyend="25"/>
</compounddef>
</doxygen>[/code]
You see, not very similar
- Andre
|
|
|
|
|
I see what you mean.
Having said that, it may well be feasible to use XSLT to transform the Doxygen style XML to a more useful format.
It might be worth reading up on XSLT transformations. There's a bunch of articles on MSDN - just do a search.
Good luck.
Anna
www.annasplace.me.uk
"Be yourself - not what others think you should be" - Marcia Graesch
Trouble with resource IDs? Try the Resource ID Organiser Add-In for Visual C++
|
|
|
|
|
Hi,
I want to create an export option for a webmail to export mails in a format that Outlook can import. Outlook can import mails from Eudora Pro, Microsoft Exchange, Microsoft Internet Mail, Outlook, Netscape Communicator.
Does anybody now if one of this programs have some documentation for the way they store the emails?
Thanks.
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
1stly, sorry if this is the wrong place to ask but...
I've the bluetooth sample compiled (Oct 2002 Platform SDK) and on creating a socket of the bluetooth family type, the call to socket(...) fails returning 10047 ("Address family not supported by protocol family"). I have the windows XP bluetooth patch and am using a CSR based USB radio device. Anyone have any insghts?
Dizz
|
|
|
|
|
Hi
bluetooth sample???? From where do you have a bluetooth sample???? That would interest me a lot, cause i need something like that for my c++ project! Could you send me that sample, please???!
Greetings, Frank
_____ easySMS for pocket PC _____
www.Siedler-Net.de/WinCE/easySMS/
|
|
|
|
|
Hi,
I want to produce an executable from within my application. based on the text written in an editor. I dont want to produce an intermediate C++ code and compile it since the target machine might not have a C compiler is this possible by simple means or am i asking too much. any help where to get some material for writing such type of applications would be highly appreciated. thanks in advance.
Vijaya Rama Raju
|
|
|
|
|
.Net would do something like that
|
|
|
|
|
Hello *.*!
Some time ago I wrote a class with some member functions. After changing an existing function's parameter list, the VS6 doesn't seem to manage it anymore. The compiler recognizes this change and then it compiled everything ok, but the development environment shows some strange characters in the parameter list. This only appear when typing the dot after the classname, a little yellow fly-out window appears with the wrong parameter list. (such as ..., const int CString, ...) I never wrote this in my function definition!
After discovering this I deleted the /debug and the /release directory, all .ncb, .opt and all other files except the .cpp, .dsw, .h, .dsp. But this does'nt help!
Could anyone solve this miracle?
Bye4now, Jan
|
|
|
|
|
You probably have more than one function with that name. Select the function name in text editor and press F12, it will show you list of functions matching that name (in VC6 you have to build with browse info for this to fork).
|
|
|
|
|
Hi,
in my project I try to expand the treeview in 'Resource View' and I get the message 'This file is already open in an editor'. However, I've just rebooted my PC, so how can it be open?
I'm using VS 6.0
Thanks a lot.
N
|
|
|
|
|
Delete the .ncb file in your project directory, and retry.
|
|
|
|
|
Just did.
No change.
Still the same error.
Thanks.
N
|
|
|
|
|
You must have the .rc file open in the text editor. Close all the files you have open in MSDEV and try again.
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|