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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. delphi convert

delphi convert

Scheduled Pinned Locked Moved C / C++ / MFC
helpdelphiquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mohsen nourian
    wrote on last edited by
    #1

    hi every body i have problem with this code : //////////////////////////////// ///code in delphi function doGetStat(aCallBackStatsParser:dfCallBackStatsParser; var strError:string):boolean; var startTime : DWORD; begin result := true; if SysHandle=0 then exit; startTime := GetTickCount; repeat if abs(GetTickCount - startTime) > 1000 then break; // Have driver fill Stats buffer with information if not DeviceIoControl(SysHandle, IOCTL_FILEMON_GETSTATS, nil, 0, @Stats, sizeof(Stats), StatsLen, nil) then begin strError := 'Couldn''t access device driver. errorCode =' +IntToStr(GetLastError); result := false; exit; end; if StatsLen=0 then break; if assigned(aCallBackStatsParser) then aCallBackStatsParser; until false; end; ////////////////////////////////////// // Code in VC BOOL CDriverApp::doGetStatvoid(*aCallBackStatsParser)(void) , CString *strError) { DWORD startTime ; result = TRUE; if (SysHandle==0 ) return FALSE ; startTime= GetTickCount() ; while(TRUE) { if( abs(GetTickCount() - startTime) > 1000 ) break ; // Have driver fill Stats buffer with information if (! DeviceIoControl(SysHandle, IOCTL_FILEMON_GETSTATS, NULL, 0, &Stats, sizeof(Stats), &StatsLen, NULL) ) { strError->Format("Couldnt access device driver.\n errorCode = %d" ,GetLastError()) ; result = FALSE ; return FALSE ; } if(GetLastError()== ERROR_INSUFFICIENT_BUFFER) strError->Format("small buffer") ; if ( StatsLen == 0 ) { return result ;} if (aCallBackStatsParser!= NULL) (*aCallBackStatsParser)() ; } return TRUE ; } /////////////////////////////////////////// it is working in delphi but not in VC why ??

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

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