Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

paul4

@paul4
About
Posts
4
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • MSI VB Custom Action
    P paul4

    I add an application to the …\Windows\CurrentVersion\Run\ folder in the registry during an install, and would like to start the application immediately. The first solution would be to start the application manually from within a Visual Basic Script Custom Action, and the second solution would be to force a system reboot. Either would be acceptable. But I can’t seem to figure out how to set the “REBOOT” property to “Force” or to run an application in my Visual Basic script. Any help would be good. Thank you in advance.

    Visual Basic windows-admin tools help tutorial

  • USB notification
    P paul4

    I am looking for a way to get Windows to notify my application when a new USB device is attached or detached from the system. The ideal solution would be a callback method of some kind, but a small low overhead polling loop could also work. Thank you.

    C / C++ / MFC

  • Memory leak detection... the best solution?
    P paul4

    Oh, and ck_memsize(PTR) should be replaced with _msize(PTR).

    C / C++ / MFC c++ performance question

  • Memory leak detection... the best solution?
    P paul4

    I use macros as a wrapper to the malloc, realloc and free functions. This way I can log all my memory allocations to a file, the following is a bit complicated, but works: #define realloc(PTR, SIZE) \ logReallocPtr(PTR, realloc(PTR, SIZE), ck_memsize(PTR), SIZE, __FILE__, #PTR, __LINE__, NULL) #define malloc(SIZE) \ logReallocPtr(NULL, malloc(SIZE), 0, SIZE, __FILE__, #SIZE, __LINE__, NULL) #define free(PTR) \ logReallocPtr(PTR, NULL, ck_memsize(PTR), 0, __FILE__, #PTR, __LINE__, free) // This function gets called for every malloc, realloc and free void *logReallocPtr(void *oldPtr, void *newPtr, size_t oldSize, size_t newSize, const char *file, const char *func, size_t line, void(*_free)(void*)){ char modFile[MAX_PATH]; int i=strlen(file)-1; FILE *out=NULL; if(!oldPtr && !newPtr) return NULL; while(out==NULL) out=fopen("\\debug_alloc.txt", "ab"); strcpy(modFile, file); while(i>=0){ if(modFile[i]==':') modFile[i] = '_'; i--; } if(out){ fprintf(out, "%d:%s:%s:%d:%d:%.8x:%.8x:%d:%d:\r\n", (int)time(NULL), modFile, func, line, getpid(), (size_t)oldPtr, (size_t)newPtr, oldSize, newSize); fclose(out); }else{ fprintf(stderr, "%d:%s:%s:%d:%d:%.8x:%.8x:%d:%d:\r\n", (int)time(NULL), modFile, func, line, getpid(), (size_t)oldPtr, (size_t)newPtr, oldSize, newSize); } if(_free && oldPtr) _free(oldPtr); return newPtr; }

    C / C++ / MFC c++ performance question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups