Click here to Skip to main content
15,909,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to Add Crystal Report ActiveX Control 4.0 in VC++ ATL Based Program? Pin
savitri9-Apr-09 19:14
savitri9-Apr-09 19:14 
QuestionYahoo Messager system tray online/offline notification Pin
eight9-Apr-09 19:06
eight9-Apr-09 19:06 
AnswerRe: Yahoo Messager system tray online/offline notification Pin
Divyang Mithaiwala9-Apr-09 20:10
Divyang Mithaiwala9-Apr-09 20:10 
AnswerRe: Yahoo Messager system tray online/offline notification Pin
David Crow10-Apr-09 3:05
David Crow10-Apr-09 3:05 
Questionget all folder names ? Pin
sam_psycho9-Apr-09 19:02
sam_psycho9-Apr-09 19:02 
AnswerRe: get all folder names ? Pin
Jijo.Raj9-Apr-09 19:34
Jijo.Raj9-Apr-09 19:34 
AnswerRe: get all folder names ? Pin
Hamid_RT9-Apr-09 21:02
Hamid_RT9-Apr-09 21:02 
AnswerRe: get all folder names ? Pin
rwilmink19-Apr-09 21:14
rwilmink19-Apr-09 21:14 
QuestionSetup Creation with MYSQL database Pin
gopalrajatrt9-Apr-09 17:55
gopalrajatrt9-Apr-09 17:55 
QuestionCListCtrl BackColor [modified] Pin
12Code9-Apr-09 17:32
12Code9-Apr-09 17:32 
AnswerRe: CListCtrl BackColor Pin
Jijo.Raj9-Apr-09 18:59
Jijo.Raj9-Apr-09 18:59 
QuestionGetComputerName <-- Issue with string? Pin
rbwest869-Apr-09 16:53
rbwest869-Apr-09 16:53 
QuestionRe: GetComputerName <-- Issue with string? Pin
David Crow9-Apr-09 17:22
David Crow9-Apr-09 17:22 
AnswerRe: GetComputerName <-- Issue with string? Pin
rbwest869-Apr-09 17:49
rbwest869-Apr-09 17:49 
GeneralRe: GetComputerName <-- Issue with string? Pin
David Crow10-Apr-09 2:45
David Crow10-Apr-09 2:45 
AnswerRe: GetComputerName <-- Issue with string? Pin
Jijo.Raj9-Apr-09 19:10
Jijo.Raj9-Apr-09 19:10 
GeneralRe: GetComputerName <-- Issue with string? Pin
rbwest869-Apr-09 20:38
rbwest869-Apr-09 20:38 
GeneralRe: GetComputerName <-- Issue with string? Pin
Jijo.Raj9-Apr-09 23:28
Jijo.Raj9-Apr-09 23:28 
QuestionDealing with resource ID conflicts (MFC service Pack 2008) Pin
Maximilien9-Apr-09 10:22
Maximilien9-Apr-09 10:22 
QuestionSetupDiGetDeviceInterfaceDetail help Pin
suendisra9-Apr-09 5:54
suendisra9-Apr-09 5:54 
The code I'm writing is designed to read into a Smart Card Reader. However, I've having a most difficult time trying to just setup the connection and get the filename so I can use CreateFile.

I've looked at the MSDN Library and done countless searches on the topic and have seen various things. Some people allocate the SP_DEVICE_INTERFACE_DETAIL_DATA struct, and claim it works, and some don't and they also claim it works (Both of which do not work for me).

The current way my code is set up right now pulls the required size, but when it goes to fill in the struct, the program freezes. Quite frustrating, really.

So here's my question: What must I do to the struct prior to attempting to fill it in with SetupDiGetDeviceInterfaceDetail in order to pull up *->DevicePath ??

Here's the code:

....

//declarations
int n=0, result;
char af[80]="";
bool found=FALSE;
GUID SCRGuId;
DWORD requiredsize=0;
HDEVINFO hDevInfo=NULL;
SP_DEVICE_INTERFACE_DATA DeviceInfoData;
PSP_DEVICE_INTERFACE_DETAIL_DATA DevDetailInfoData;

....

do
{
if(SetupDiEnumDeviceInterfaces(hDevInfo, NULL, &SCRGuId, n, &DeviceInfoData))
{
found = TRUE; requiredsize = 0;
SetupDiGetDeviceInterfaceDetail(hDevInfo,&DeviceInfoData,NULL,0,&requiredsize,NULL);
sprintf(af, "reqsize: %d", requiredsize);
SendDlgItemMessage(hWnd, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM)(LPCSTR)af);

if(requiredsize != 0)
{
//this is the problem code...can anybody help me here?
DevDetailInfoData->cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
SetupDiGetDeviceInterfaceDetail(hDevInfo,&DeviceInfoData, DevDetailInfoData,requiredsize,0,NULL);

sprintf(af, "device path %s", DevDetailInfoData->;DevicePath);
SendDlgItemMessage(hWnd, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM)(LPCSTR)af);
}else{

....
AnswerRe: SetupDiGetDeviceInterfaceDetail help Pin
Jerry Evans9-Apr-09 6:32
Jerry Evans9-Apr-09 6:32 
GeneralRe: SetupDiGetDeviceInterfaceDetail help Pin
suendisra9-Apr-09 19:04
suendisra9-Apr-09 19:04 
Questioncmd.exe error Pin
Max++9-Apr-09 5:49
Max++9-Apr-09 5:49 
AnswerRe: cmd.exe error Pin
David Crow9-Apr-09 6:33
David Crow9-Apr-09 6:33 
QuestionBreakpoints not being hit Pin
Like2Byte9-Apr-09 4:44
Like2Byte9-Apr-09 4:44 

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.