Click here to Skip to main content
15,886,110 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
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 
GeneralRe: Tranlating old code to the STL style Pin
Stuart Dootson12-Aug-10 8:51
professionalStuart Dootson12-Aug-10 8:51 
What iterators are you calling it with?

This sample program seems to sort the data OK…

#include <vector>
#include <iostream>
#include <iterator>

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;
    }
  }
}

int main(int, char**)
{
  std::vector<int> vec;
  
  vec.push_back(4);
  vec.push_back(3);
  vec.push_back(5);
  vec.push_back(-10);
  vec.push_back(13);
  vec.push_back(2);
  vec.push_back(1);
  
  gnome(vec.begin(), vec.end()-1);
  
  std::copy(vec.begin(), vec.end(), std::ostream_iterator<int>(std::cout, " "));
}

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

CodeProject MVP for 2010 - who'd'a thunk it!

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 
QuestionHow to play flash movies with transparent background color in a Window? Pin
itmagina28-Jul-10 14:51
itmagina28-Jul-10 14:51 

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.