Click here to Skip to main content
15,885,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Global key press Pin
Valentinor11-Jul-18 5:09
Valentinor11-Jul-18 5:09 
GeneralRe: Global key press Pin
Jochen Arndt11-Jul-18 6:40
professionalJochen Arndt11-Jul-18 6:40 
GeneralRe: Global key press Pin
Valentinor13-Jul-18 20:45
Valentinor13-Jul-18 20:45 
GeneralRe: Global key press Pin
Jochen Arndt13-Jul-18 21:00
professionalJochen Arndt13-Jul-18 21:00 
GeneralRe: Global key press Pin
Valentinor14-Jul-18 10:58
Valentinor14-Jul-18 10:58 
QuestionOnDeviceChange dbcc_name length Pin
Member 138991789-Jul-18 4:34
Member 138991789-Jul-18 4:34 
GeneralRe: OnDeviceChange dbcc_name length Pin
Richard MacCutchan9-Jul-18 5:26
mveRichard MacCutchan9-Jul-18 5:26 
GeneralRe: OnDeviceChange dbcc_name length Pin
Member 138991789-Jul-18 20:37
Member 138991789-Jul-18 20:37 
I am using MFC & C++. This code is missing the WideCharToMultibyte conversion which didn't help one bit. I am using this document as refrence: http://www.ftdichip.com/Support/Documents/AppNotes/AN_152_Detecting_USB_%20Device_Insertion_and_Removal.pdf

BOOL CTesterDlg::OnDeviceChange(UINT nEventType, DWORD_PTR dwPtrData)
{
	BOOL bReturn = CWnd::OnDeviceChange(nEventType, dwPtrData);

	PDEV_BROADCAST_DEVICEINTERFACE b = (PDEV_BROADCAST_DEVICEINTERFACE)dwPtrData;

	if(b != NULL)
	{
		CString Msg;
		Msg.Format(L"%s",b->dbcc_name);
		MessageBox(Msg);
	}

	switch (nEventType)
	{
		case DBT_DEVICEARRIVAL:
			if(hComm==INVALID_HANDLE_VALUE) DeviceInit();
			break;
		case DBT_DEVICEREMOVECOMPLETE:
			ClosePort();
			break;
	}

	return bReturn;
}

GeneralRe: OnDeviceChange dbcc_name length Pin
Richard MacCutchan9-Jul-18 21:04
mveRichard MacCutchan9-Jul-18 21:04 
GeneralRe: OnDeviceChange dbcc_name length Pin
Member 138991789-Jul-18 21:06
Member 138991789-Jul-18 21:06 
SuggestionRe: OnDeviceChange dbcc_name length Pin
David Crow9-Jul-18 16:24
David Crow9-Jul-18 16:24 
AnswerRe: OnDeviceChange dbcc_name length Pin
Jochen Arndt9-Jul-18 22:57
professionalJochen Arndt9-Jul-18 22:57 
GeneralRe: OnDeviceChange dbcc_name length Pin
Member 138991789-Jul-18 23:26
Member 138991789-Jul-18 23:26 
GeneralRe: OnDeviceChange dbcc_name length Pin
Jochen Arndt9-Jul-18 23:42
professionalJochen Arndt9-Jul-18 23:42 
GeneralRe: OnDeviceChange dbcc_name length Pin
Member 138991789-Jul-18 23:44
Member 138991789-Jul-18 23:44 
QuestionChanging Display gamma [SOLVED] Pin
Valentinor9-Jul-18 0:48
Valentinor9-Jul-18 0:48 
AnswerRe: Changing Display gamma Pin
Jochen Arndt9-Jul-18 1:05
professionalJochen Arndt9-Jul-18 1:05 
GeneralRe: Changing Display gamma Pin
Valentinor9-Jul-18 2:42
Valentinor9-Jul-18 2:42 
GeneralRe: Changing Display gamma Pin
Jochen Arndt9-Jul-18 2:59
professionalJochen Arndt9-Jul-18 2:59 
GeneralRe: Changing Display gamma Pin
Valentinor9-Jul-18 10:51
Valentinor9-Jul-18 10:51 
GeneralRe: Changing Display gamma Pin
Jochen Arndt9-Jul-18 21:00
professionalJochen Arndt9-Jul-18 21:00 
GeneralRe: Changing Display gamma Pin
Valentinor9-Jul-18 22:36
Valentinor9-Jul-18 22:36 
GeneralRe: Changing Display gamma Pin
Valentinor9-Jul-18 23:33
Valentinor9-Jul-18 23:33 
GeneralRe: Changing Display gamma Pin
Jochen Arndt9-Jul-18 23:50
professionalJochen Arndt9-Jul-18 23:50 
GeneralRe: Changing Display gamma Pin
Valentinor10-Jul-18 1:10
Valentinor10-Jul-18 1:10 

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.