Click here to Skip to main content
15,793,735 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Convert BYTE* array (unmanaged) to SAFEARRAY Pin
Randor 26-Oct-09 10:59
professional Randor 26-Oct-09 10:59 
QuestionHow to read the characters in the EditTable of SysListView32 style control ? Pin
wangningyu22-Oct-09 6:41
wangningyu22-Oct-09 6:41 
QuestionRe: How to read the characters in the EditTable of SysListView32 style control ? Pin
David Crow22-Oct-09 7:23
David Crow22-Oct-09 7:23 
AnswerRe: if the edit listcontrol in other programs, how can I read the list ?[modified] Pin
wangningyu22-Oct-09 7:35
wangningyu22-Oct-09 7:35 
GeneralRe: if the edit listcontrol in other programs, how can I read the list Pin
David Crow22-Oct-09 8:08
David Crow22-Oct-09 8:08 
AnswerRe: How to read the characters in the EditTable of SysListView32 style control ? Pin
rand094122-Oct-09 16:01
rand094122-Oct-09 16:01 
AnswerRe: How to read the characters in the EditTable of SysListView32 style control ? Pin
nenfa19-Jan-10 1:21
nenfa19-Jan-10 1:21 
QuestionDeviceIoControl to lock drive is not working Pin
Patcher3222-Oct-09 6:09
Patcher3222-Oct-09 6:09 
Okay I am trying to lock CD drive (F: here) with the code shown. But DeviceIoControl is returning "error 87: Parameter not correct". Please someone help me. I cannot find out which parameter is incorrcet.

#include <windows.h>
#include <winioctl.h>
#include <stdio.h>

void ShowError(void); //function to display message from GetLastError()

int main(){
	char szVolume[] = "\\\\.\\F:";
	HANDLE hVolume;
	DWORD dwBytes = 0;
	PREVENT_MEDIA_REMOVAL pmr;

	pmr.PreventMediaRemoval = TRUE;

	hVolume = CreateFile(szVolume,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);
	if(hVolume==INVALID_HANDLE_VALUE){
		ShowError();
		exit(1);
	}
	if(DeviceIoControl(hVolume,IOCTL_STORAGE_EJECTION_CONTROL,(LPVOID)&pmr,(DWORD)sizeof(pmr),NULL,0,&dwBytes,NULL)==FALSE){
		ShowError();
	}
	CloseHandle(hVolume);
	return 0;
}

AnswerRe: DeviceIoControl to lock drive is not working Pin
Covean22-Oct-09 6:34
Covean22-Oct-09 6:34 
GeneralRe: DeviceIoControl to lock drive is not working Pin
Patcher3222-Oct-09 14:12
Patcher3222-Oct-09 14:12 
AnswerRe: DeviceIoControl to lock drive is not working Pin
Code-o-mat22-Oct-09 6:52
Code-o-mat22-Oct-09 6:52 
GeneralRe: DeviceIoControl to lock drive is not working Pin
Patcher3222-Oct-09 14:13
Patcher3222-Oct-09 14:13 
GeneralRe: DeviceIoControl to lock drive is not working Pin
David Crow22-Oct-09 7:20
David Crow22-Oct-09 7:20 
GeneralRe: DeviceIoControl to lock drive is not working Pin
Code-o-mat22-Oct-09 7:34
Code-o-mat22-Oct-09 7:34 
GeneralRe: DeviceIoControl to lock drive is not working Pin
David Crow22-Oct-09 7:56
David Crow22-Oct-09 7:56 
AnswerRe: DeviceIoControl to lock drive is not working Pin
Patcher3222-Oct-09 14:44
Patcher3222-Oct-09 14:44 
GeneralRe: DeviceIoControl to lock drive is not working Pin
Covean22-Oct-09 21:59
Covean22-Oct-09 21:59 
GeneralRe: DeviceIoControl to lock drive is not working Pin
Patcher3223-Oct-09 20:22
Patcher3223-Oct-09 20:22 
QuestionRenaming file in C++ failing Pin
StrayGrey22-Oct-09 4:58
StrayGrey22-Oct-09 4:58 
QuestionRe: Renaming file in C++ failing Pin
David Crow22-Oct-09 5:06
David Crow22-Oct-09 5:06 
AnswerRe: Renaming file in C++ failing Pin
StrayGrey22-Oct-09 5:20
StrayGrey22-Oct-09 5:20 
AnswerRe: Renaming file in C++ failing Pin
Michael Schubert22-Oct-09 5:12
Michael Schubert22-Oct-09 5:12 
GeneralRe: Renaming file in C++ failing Pin
StrayGrey22-Oct-09 5:17
StrayGrey22-Oct-09 5:17 
GeneralRe: Renaming file in C++ failing Pin
Michael Schubert22-Oct-09 5:22
Michael Schubert22-Oct-09 5:22 
GeneralRe: Renaming file in C++ failing Pin
StrayGrey22-Oct-09 6:08
StrayGrey22-Oct-09 6:08 

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.