Click here to Skip to main content
15,885,278 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionActiveX without prompting? (or how to create an IE-plugin?) Pin
Don Rolando15-Aug-10 20:44
Don Rolando15-Aug-10 20:44 
AnswerRe: ActiveX without prompting? (or how to create an IE-plugin?) Pin
Cool_Dev28-Aug-10 3:00
Cool_Dev28-Aug-10 3:00 
QuestionC++ MFC - DatePickerControl - DTN_DATETIMECHANGE event getting triggered twice when clicked !!!! [modified] Pin
Kausik4u11-Aug-10 8:54
Kausik4u11-Aug-10 8:54 
AnswerRe: C++ MFC - DatePickerControl - DTN_DATETIMECHANGE event getting triggered twice when clicked !!!! Pin
Stuart Dootson12-Aug-10 4:17
professionalStuart Dootson12-Aug-10 4:17 
GeneralRe: C++ MFC - DatePickerControl - DTN_DATETIMECHANGE event getting triggered twice when clicked !!!! Pin
Kausik4u12-Aug-10 4:27
Kausik4u12-Aug-10 4:27 
QuestionTranlating old code to the STL style Pin
VeganFanatic8-Aug-10 4:47
VeganFanatic8-Aug-10 4:47 
AnswerRe: Tranlating old code to the STL style Pin
Stuart Dootson12-Aug-10 4:13
professionalStuart Dootson12-Aug-10 4:13 
GeneralRe: Tranlating old code to the STL style Pin
VeganFanatic12-Aug-10 8:33
VeganFanatic12-Aug-10 8:33 
After a few moments looking over the book I figured out that I need to watch the pointers close when using the STL method of iterators.

This is not well covered in any of the books I have. No big deal, that is what forums are for.

Here is what I ended up with that does work properly.

template <typename iterator> void bubble(iterator first, iterator last) { // O(n^2)
     iterator i, j;
     for (i = first; i != last; ++i)
         for (j = first; j < i; ++j)
             if (*i < *j)
                 std::iter_swap(i, j); // or std::swap(*i, *j);
}


Now I have this other sort that is annoying me.

template <class iterator> void gnome(iterator first, iterator last){ // O(n^2)
	iterator pos = first;
	iterator temp;
	while (pos <= last) {
		if ((pos == first) || (*pos >= *(pos-1)))
			++pos;
		else {
			//{int tmp = ar[i]; ar[i] = ar[i-1]; ar[--i] = tmp;}
			std::iter_swap(pos, pos-1);
			--pos;
		}
	}
}


This one does not work, not sure what the problem is.
http://www.contract-developer.tk

GeneralRe: Tranlating old code to the STL style Pin
Stuart Dootson12-Aug-10 8:51
professionalStuart Dootson12-Aug-10 8:51 
GeneralRe: Tranlating old code to the STL style Pin
VeganFanatic12-Aug-10 8:56
VeganFanatic12-Aug-10 8:56 
GeneralRe: Tranlating old code to the STL style Pin
Stuart Dootson12-Aug-10 9:16
professionalStuart Dootson12-Aug-10 9:16 
GeneralRe: Tranlating old code to the STL style Pin
VeganFanatic12-Aug-10 9:20
VeganFanatic12-Aug-10 9:20 
QuestionATL: WM_MOUSELEAVE Pin
Supriya Tonape6-Aug-10 4:30
Supriya Tonape6-Aug-10 4:30 
AnswerRe: ATL: WM_MOUSELEAVE Pin
Frank Seidler6-Aug-10 4:38
Frank Seidler6-Aug-10 4:38 
GeneralRe: ATL: WM_MOUSELEAVE Pin
Sauro Viti6-Aug-10 4:46
professionalSauro Viti6-Aug-10 4:46 
GeneralRe: ATL: WM_MOUSELEAVE Pin
Supriya Tonape9-Aug-10 2:25
Supriya Tonape9-Aug-10 2:25 
GeneralRe: ATL: WM_MOUSELEAVE Pin
Supriya Tonape9-Aug-10 2:28
Supriya Tonape9-Aug-10 2:28 
QuestionHow can my CDerivedEdit respond WM_SHOWWINDOW? (OnShowWindow) Pin
dancingfish5-Aug-10 21:41
dancingfish5-Aug-10 21:41 
QuestionAuthentication client-server using message queues in c language Pin
ralph 230-Jul-10 2:31
ralph 230-Jul-10 2:31 
AnswerRe: Authentication client-server using message queues in c language Pin
Richard MacCutchan30-Jul-10 3:17
mveRichard MacCutchan30-Jul-10 3:17 
GeneralRe: Authentication client-server using message queues in c language Pin
ralph 230-Jul-10 3:20
ralph 230-Jul-10 3:20 
QuestionProgressBar and Threading.. Pin
Anil Kumar.Arvapalli29-Jul-10 19:53
Anil Kumar.Arvapalli29-Jul-10 19:53 
AnswerRe: ProgressBar and Threading.. Pin
Richard MacCutchan29-Jul-10 22:24
mveRichard MacCutchan29-Jul-10 22:24 
QuestionAdd Publisher name to my application Pin
Cvaji29-Jul-10 2:20
Cvaji29-Jul-10 2:20 
GeneralRe: Add Publisher name to my application Pin
Sauro Viti29-Jul-10 9:15
professionalSauro Viti29-Jul-10 9:15 

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.