All pastes #48617 Raw Edit

Mine

public c v1 · immutable
#48617 ·published 2006-04-08 11:45 UTC
rendered paste body
/*** hIcon = some icon....** hIcon = ohyeah(hIcon);    ** hIcon = ohyeah(hIcon);** hIcon = ohyeah(hIcon);** ...*/HICON ohyeah(HICON hIcon, int value){  static HICON dupicon;  static BOOL firstrun = 1;  //dupicon = DuplicateIcon(NULL, hIcon);  dupicon = CopyIcon(hIcon);  //showerror(GetLastError(),0,0);  if(!firstrun)  {    DestroyIcon(hIcon);    printf("DestroyIcon\n");  }  hIcon = dupicon;  printf("dupicon = %p\n",dupicon);  firstrun = 0;  return dupicon;}/* If I comment out DestroyIcon() I get a new address every time** with the DestroyIcon() I get 0 as a result the second time it's called*/