Click here to Skip to main content
15,911,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCan I add icons to the systray Pin
Leon Su12-Aug-00 15:50
sussLeon Su12-Aug-00 15:50 
Generaltoolbar within Splitter view Pin
Ivan Polak12-Aug-00 9:04
Ivan Polak12-Aug-00 9:04 
QuestionMultimedia real-time sound? Pin
mrcoder11-Aug-00 14:29
mrcoder11-Aug-00 14:29 
GeneralControl Panel..... Pin
Carlo Comino11-Aug-00 10:29
sussCarlo Comino11-Aug-00 10:29 
GeneralRe: Control Panel..... Pin
Mike Dunn11-Aug-00 18:59
Mike Dunn11-Aug-00 18:59 
GeneralOnAfterPrint for VC++ Pin
Derek Lakin11-Aug-00 5:39
Derek Lakin11-Aug-00 5:39 
GeneralString sorting Pin
Erik Hammar11-Aug-00 2:36
Erik Hammar11-Aug-00 2:36 
GeneralRe: String sorting Pin
Tim Deveaux12-Aug-00 5:25
Tim Deveaux12-Aug-00 5:25 
I can't think of a single call you can make, but there are lots of 'points of interest'.

First tip, don't sort an array of strings - sort a contiguous array of pointers to the strings. This means whatever shifting you do just involves moving bits of the array around, not reallocating strings.

With that in place, there are standard sorting routines you can use. The venerable qsort from the C library works great, though it requires you to set up a 'global' callback. Maybe this could be a static member in C++ if you want to mix.

Inside the comparison callback, its up to you to decide what the order will be - retuning essentially what a strcmp or stricmp returns.

It turns out that there is more than one implementation for the string comparison functions in VC - there is straight C code, and there is much faster 286 code in the Crt\Intel include dir. (I say '286 code' because I think some of this could be even faster with the string ops of a 386 + proc when dealing with big strings).

If you've got control over what proc you are targeting, even a basic framework like this can be way fast, depending of course on the size and similarity of the strings.

STL gurus will probably flame me for this, but it is durn quick! Smile | :)

Generalclosing dialog by pressing anywhere outside the dialog Pin
Mikko Mononen11-Aug-00 0:02
Mikko Mononen11-Aug-00 0:02 
GeneralRe: closing dialog by pressing anywhere outside the dialog Pin
warjo11-Aug-00 0:32
warjo11-Aug-00 0:32 
QuestionAdding toolbar buttons to MSOL and MSIE?? Pin
warjo10-Aug-00 21:56
warjo10-Aug-00 21:56 
Generalvisual studio Pin
koteswara10-Aug-00 20:42
koteswara10-Aug-00 20:42 
GeneralRe: visual studio Pin
Mike Melnikov11-Aug-00 6:53
Mike Melnikov11-Aug-00 6:53 
GeneralRe: visual studio Pin
David Wulff11-Aug-00 14:54
David Wulff11-Aug-00 14:54 
QuestionHow to get a CString to contain the contents of IHTMLDocument2::toString(...) Pin
David Wulff10-Aug-00 9:27
David Wulff10-Aug-00 9:27 
AnswerRe: How to get a CString to contain the contents of IHTMLDocument2::toString(...) Pin
Buck19-Aug-00 8:27
Buck19-Aug-00 8:27 
GeneralRe: How to get a CString to contain the contents of IHTMLDocument2::toString(...) Pin
David Wulff20-Aug-00 12:45
David Wulff20-Aug-00 12:45 
GeneralRe: How to get a CString to contain the contents of IHTMLDocument2::toString(...) Pin
Buck20-Aug-00 17:27
Buck20-Aug-00 17:27 
GeneralRTS Toggle under WIndows 2000 Pin
rocco10-Aug-00 9:03
rocco10-Aug-00 9:03 
GeneralANSI C++ filebuf class and problems with filebuf::fd filebuf::sync on buffered IO Pin
Karl Mutch10-Aug-00 6:38
Karl Mutch10-Aug-00 6:38 
GeneralSTL Tutorial Pin
Matthias Steinbart9-Aug-00 21:07
sussMatthias Steinbart9-Aug-00 21:07 
GeneralRe: STL Tutorial Pin
Andreas Mueller9-Aug-00 22:02
Andreas Mueller9-Aug-00 22:02 
GeneralRe: STL Tutorial - book Pin
warjo10-Aug-00 21:49
warjo10-Aug-00 21:49 
GeneralProblems in Accessing Tape Drive for Restoration. Pin
karthik9-Aug-00 20:41
karthik9-Aug-00 20:41 
QuestionHow to format source code in discussion board message Pin
HP9-Aug-00 20:24
HP9-Aug-00 20:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.