Click here to Skip to main content
15,884,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: OS Specific Crash - Application crashes in Vista OS , Windows 2008 32/64 bit. Application doesn't crash in Win2003 Pin
V K 210-Nov-09 1:23
V K 210-Nov-09 1:23 
QuestionRe: OS Specific Crash - Application crashes in Vista OS , Windows 2008 32/64 bit. Application doesn't crash in Win2003 Pin
Randor 10-Nov-09 6:08
professional Randor 10-Nov-09 6:08 
AnswerRe: OS Specific Crash - Application crashes in Vista OS , Windows 2008 32/64 bit. Application doesn't crash in Win2003 Pin
V K 210-Nov-09 22:39
V K 210-Nov-09 22:39 
GeneralRe: OS Specific Crash - Application crashes in Vista OS , Windows 2008 32/64 bit. Application doesn't crash in Win2003 Pin
Randor 11-Nov-09 9:06
professional Randor 11-Nov-09 9:06 
Questionhow to convert any format to pdf using C(or)C++ Pin
soo preety10-Nov-09 0:55
soo preety10-Nov-09 0:55 
AnswerRe: how to convert any format to pdf using C(or)C++ Pin
Richard MacCutchan10-Nov-09 5:21
mveRichard MacCutchan10-Nov-09 5:21 
AnswerRe: how to convert any format to pdf using C(or)C++ Pin
Richard MacCutchan10-Nov-09 5:28
mveRichard MacCutchan10-Nov-09 5:28 
QuestionDeviceIOControl () fails with error 87 Pin
vasu_sri10-Nov-09 0:47
vasu_sri10-Nov-09 0:47 
hi everybody,

iam using <b>DeviceIoControl()</b> to get the physical drive number. but
the problem is that the DeviceIoControl is giving error 87.means that parameter is incoorect.

please help me anybody knows this solution.


int GetDriveNumber(CString strDrive)
{
	TCHAR lpWindowsDir[_MAX_PATH+1];
	VOLUME_DISK_EXTENTS pdg;	
	CString strDevice;
	HANDLE hDevice =NULL;
	DWORD dw;
	DWORD dwBytesReturned;
	GetWindowsDirectory(lpWindowsDir,_MAX_PATH+1);

	strDevice.Format(_T("\\\\.\\%s:"),strDrive);
	hDevice = CreateFile(strDevice,					// the device
		GENERIC_READ,								// open for reading
		FILE_SHARE_READ|FILE_SHARE_WRITE,			// share mode
		NULL,										// default security
		OPEN_EXISTING,								// open existing
		FILE_ATTRIBUTE_NORMAL,						// normal file
		NULL);		
	if(hDevice != INVALID_HANDLE_VALUE)
	{
		BOOL bIsSucces = DeviceIoControl(hDevice,IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,NULL,0,
			&amp;pdg,sizeof(pdg),&amp;dwBytesReturned,NULL);
		dw= GetLastError();

		CloseHandle(hDevice);
		return pdg.Extents-&gt;DiskNumber;
	}
	return FALSE;
}


Regards,
Srinivas

QuestionRe: DeviceIOControl () fails with error 87 Pin
David Crow10-Nov-09 3:17
David Crow10-Nov-09 3:17 
QuestionRe: DeviceIOControl () fails with error 87 Pin
Randor 10-Nov-09 5:45
professional Randor 10-Nov-09 5:45 
AnswerRe: DeviceIOControl () fails with error 87 Pin
vasu_sri10-Nov-09 21:45
vasu_sri10-Nov-09 21:45 
GeneralRe: DeviceIOControl () fails with error 87 Pin
Randor 11-Nov-09 8:55
professional Randor 11-Nov-09 8:55 
Questionconnecting to mysql through c++ using console application Pin
kir_MFC10-Nov-09 0:11
kir_MFC10-Nov-09 0:11 
AnswerRe: connecting to mysql through c++ using console application PinPopular
LunaticFringe10-Nov-09 1:02
LunaticFringe10-Nov-09 1:02 
GeneralRe: connecting to mysql through c++ using console application Pin
Michael Schubert10-Nov-09 2:17
Michael Schubert10-Nov-09 2:17 
AnswerRe: connecting to mysql through c++ using console application Pin
CPallini10-Nov-09 2:26
mveCPallini10-Nov-09 2:26 
GeneralRe: connecting to mysql through c++ using console application Pin
niraj_180917-Nov-09 23:57
niraj_180917-Nov-09 23:57 
QuestionRuuning MFC Exe in other computers Pin
hellogany9-Nov-09 23:52
hellogany9-Nov-09 23:52 
AnswerRe: Ruuning MFC Exe in other computers Pin
Game-point10-Nov-09 0:16
Game-point10-Nov-09 0:16 
AnswerRe: Ruuning MFC Exe in other computers Pin
LunaticFringe10-Nov-09 1:14
LunaticFringe10-Nov-09 1:14 
GeneralRe: Ruuning MFC Exe in other computers Pin
hellogany10-Nov-09 17:47
hellogany10-Nov-09 17:47 
GeneralRe: Ruuning MFC Exe in other computers Pin
hellogany10-Nov-09 18:00
hellogany10-Nov-09 18:00 
Questionhow to convert any format to pdf using C(or)C++ [modified] Pin
eswar pothula9-Nov-09 23:22
eswar pothula9-Nov-09 23:22 
AnswerRe: how to convert any format to pdf using C(or)C++ Pin
Franck Paquier10-Nov-09 4:50
Franck Paquier10-Nov-09 4:50 
QuestionMFC-How to fill a polygon with bitmap Pin
chadic9-Nov-09 22:53
chadic9-Nov-09 22:53 

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.