Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC program error Pin
bugDanny30-Sep-05 7:36
bugDanny30-Sep-05 7:36 
GeneralRe: MFC program error Pin
Jörgen Sigvardsson30-Sep-05 9:16
Jörgen Sigvardsson30-Sep-05 9:16 
GeneralRe: MFC program error Pin
bugDanny30-Sep-05 10:59
bugDanny30-Sep-05 10:59 
GeneralRe: MFC program error Pin
rncwnd30-Sep-05 11:11
rncwnd30-Sep-05 11:11 
GeneralRe: MFC program error Pin
Anonymous1-Oct-05 9:45
Anonymous1-Oct-05 9:45 
GeneralRe: MFC program error Pin
rncwnd2-Oct-05 3:18
rncwnd2-Oct-05 3:18 
AnswerRe: MFC program error Pin
Jose Lamas Rios30-Sep-05 17:58
Jose Lamas Rios30-Sep-05 17:58 
QuestionListView Pin
karmendra_js30-Sep-05 1:24
karmendra_js30-Sep-05 1:24 
AnswerRe: ListView Pin
mark novak30-Sep-05 2:37
mark novak30-Sep-05 2:37 
GeneralRe: ListView Pin
Bartosz Bien30-Sep-05 3:17
Bartosz Bien30-Sep-05 3:17 
Questionhow to make radio button function Pin
meiyueh30-Sep-05 1:17
meiyueh30-Sep-05 1:17 
AnswerRe: how to make radio button function Pin
mark novak30-Sep-05 2:19
mark novak30-Sep-05 2:19 
QuestionCode documentation of MFC Application Pin
karmendra_js30-Sep-05 1:12
karmendra_js30-Sep-05 1:12 
AnswerRe: Code documentation of MFC Application Pin
Bartosz Bien30-Sep-05 1:16
Bartosz Bien30-Sep-05 1:16 
GeneralRe: Code documentation of MFC Application Pin
Marc Soleda30-Sep-05 3:10
Marc Soleda30-Sep-05 3:10 
Generalonwner draw button Pin
FarPointer30-Sep-05 1:02
FarPointer30-Sep-05 1:02 
AnswerRe: onwner draw button Pin
Bartosz Bien30-Sep-05 1:12
Bartosz Bien30-Sep-05 1:12 
Questionadministrative privileges of SCSI Pass through Pin
Chandler2530-Sep-05 0:26
Chandler2530-Sep-05 0:26 
Hello,

I am developing an USB pen drive app,
the program works well with XP(or 2000) administrative privileges,
but it doesn't work without it,
because the way I get the drive handle is(suppose the usb pen drive is E:\):

HANDLE hDevHandle;
char szDrive[]= "\\\\.\\E:";

hDevHandle = CreateFile(szDrive,
GENERIC_WRITE | GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);

CreateFile fail without administrative privileges,
following is the description of limitation from MSDN:

You can use the CreateFile function to open a physical disk drive or a
volume. The function returns a handle that can be used with the
DeviceIoControl function. This enables you to access the disk's partition
table. It is potentially dangerous to do so, since an incorrect write to a
disk could make its contents inaccessible. The following requirements must be
met for such a call to succeed:
1.The caller must have administrative privileges.
2.The dwCreationDisposition parameter must have the OPEN_EXISTING flag.
3.When opening a volume or floppy disk, the dwShareMode parameter must
have the FILE_SHARE_WRITE flag.

item 1 cause the fail,
How could I get drive handle without administrative privileges?

Thanks,
Chandler
AnswerRe: administrative privileges of SCSI Pass through Pin
Chandler252-Oct-05 16:18
Chandler252-Oct-05 16:18 
Questionprinting from CScrollView Pin
vikas amin29-Sep-05 23:33
vikas amin29-Sep-05 23:33 
QuestionHow to add a bullet to the text ? Pin
Amarelia29-Sep-05 23:16
Amarelia29-Sep-05 23:16 
AnswerRe: How to add a bullet to the text ? Pin
mark novak30-Sep-05 2:32
mark novak30-Sep-05 2:32 
QuestionAny better solution to solve this? Pin
G Haranadh29-Sep-05 23:04
G Haranadh29-Sep-05 23:04 
AnswerRe: Any better solution to solve this? Pin
S. Senthil Kumar30-Sep-05 0:39
S. Senthil Kumar30-Sep-05 0:39 
QuestionHow to Disable/Hide Mouse Cursor ? Pin
Amarelia29-Sep-05 22:36
Amarelia29-Sep-05 22:36 

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.