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
K

khehwan

@khehwan
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • AfxMessageBox()
    K khehwan

    AfxMessageBox() will use 'm_pszAppName' as the title name. The best way is to use MessageBox(). If you want to use resource as input message, here's an example: int MyMessageBox(UINT nIDPrompt,LPCTSTR lpszTitle, UINT nType) { HMODULE hThisApp; DWORD dwLen,dwBufSize; int nResult; hThisApp=AfxGetInstanceHandle(); _TCHAR *lpszText=NULL; dwBufSize=0; do { delete [] lpszText; dwBufSize+=256; lpszText=new _TCHAR[dwBufSize]; dwLen=LoadString(hThisApp,nIDPrompt,lpszText,dwBufSize); } while((0!=dwLen)&&(dwLen+sizeof(_TCHAR)==dwBufSize)); nResult=MessageBox(GetActiveWindow(),lpszText,lpszTitle,nType|MB_TASKMODAL); delete [] lpszText; return nResult; } Best Regards, K Wan

    C / C++ / MFC question

  • Access Disk Sector for non-admin user
    K khehwan

    Thanks for pointed out my mistake and confusion. Basically, what does the service do in this problem? Can the service use 'CreateFile' to access the disk sector for non-admin user? Since the security context for file system root (eg: 'c:','d:') will be lost every time we restart the computer, how do we solve this problem? More hints and guides for me? Thanks!

    C / C++ / MFC question help

  • Access Disk Sector for non-admin user
    K khehwan

    Hi, Currently, I need to do read/write on disk sector under Win2000/XP. I found out that the statement below is only valid for administrator. hDisk=CreateFile("\\\\.\\C:", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL); ... For non-admin user, the above statement will always return hDisk=INVALID_HANDLE_VALUE. My question is how can we solve this problem? Can we assign access right or privilege in our program in order to access disk sector? or do we need to develop VXD to solve this problem? Hope that some of you can give me some hints. Thanks in advance! Best Regards, K Wan

    C / C++ / MFC question help
  • Login

  • Don't have an account? Register

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