Click here to Skip to main content
15,923,789 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhat do you put in stdafx.h ? Pin
Maximilien4-Oct-02 4:58
Maximilien4-Oct-02 4:58 
AnswerRe: What do you put in stdafx.h ? Pin
Tomasz Sowinski4-Oct-02 5:02
Tomasz Sowinski4-Oct-02 5:02 
AnswerRe: What do you put in stdafx.h ? Pin
Daniel Turini4-Oct-02 4:59
Daniel Turini4-Oct-02 4:59 
AnswerRe: What do you put in stdafx.h ? Pin
Michael P Butler4-Oct-02 5:03
Michael P Butler4-Oct-02 5:03 
Generalrecognize classes Pin
Zizilamoroso4-Oct-02 4:17
Zizilamoroso4-Oct-02 4:17 
GeneralRe: recognize classes Pin
Daniel Turini4-Oct-02 4:26
Daniel Turini4-Oct-02 4:26 
GeneralQuery Com Ports. Pin
Anthony98874-Oct-02 3:47
Anthony98874-Oct-02 3:47 
GeneralRe: Query Com Ports. Pin
Scott H. Settlemier4-Oct-02 4:20
Scott H. Settlemier4-Oct-02 4:20 
I don't think so. I usually check the registry like so:

set<CString> Ports;
HKEY hSerialComm=0;
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"HARDWARE\\DEVICEMAP\\SERIALCOMM",0,KEY_READ,&hSerialComm)==ERROR_SUCCESS||(hSerialComm=0);
DWORD nValues,nLongestName,nLargestValue;
if (hSerialComm && ::RegQueryInfoKey(hSerialComm,0,0,0,0,0,0,&nValues,&nLongestName,&nLargestValue,0,0)==ERROR_SUCCESS && nValues && nLongestName && nLargestValue)
{
   CString _Name,_Value;
   char* Name=_Name.GetBuffer(nLongestName+1);
   char* Value=_Value.GetBuffer(nLargestValue+1);
   DWORD NameLen,ValueLen,Type;
   for (int i=0;nValues;++i) // need to enumerate until ERROR_NO_MORE_ITEMS
   {
   	NameLen=nLongestName+1;
   	ValueLen=nLargestValue+1;
	LONG Result=::RegEnumValue(hSerialComm,i,Name,&NameLen,0,&Type,(BYTE*)Value,&ValueLen);
	if (Result==ERROR_NO_MORE_ITEMS)
		break;
	else if (Result!=ERROR_SUCCESS)
	{
		break;
	}
	else
	{ // successfully got a value
		--nValues;
		if (Ports.find(Value)==Ports.end())
			Ports.insert(Value);
	}
   }
   _Name.ReleaseBuffer(0);
   _Value.ReleaseBuffer(0);
}
if (hSerialComm)
   RegCloseKey(hSerialComm);


Additionally, I will simply just try to open the first few
ports by typical name. (e.g. COM1 ... COM8)
GeneralHWND list Pin
The_Server4-Oct-02 2:23
The_Server4-Oct-02 2:23 
GeneralRe: HWND list Pin
Tomasz Sowinski4-Oct-02 3:04
Tomasz Sowinski4-Oct-02 3:04 
GeneralRe: HWND list Pin
User 66584-Oct-02 3:11
User 66584-Oct-02 3:11 
GeneralRe: HWND list Pin
Tomasz Sowinski4-Oct-02 3:14
Tomasz Sowinski4-Oct-02 3:14 
GeneralRe: HWND list Pin
User 66584-Oct-02 3:19
User 66584-Oct-02 3:19 
GeneralRe: HWND list Pin
Andreas Saurwein4-Oct-02 5:38
Andreas Saurwein4-Oct-02 5:38 
GeneralRe: HWND list Pin
User 66584-Oct-02 10:06
User 66584-Oct-02 10:06 
GeneralRe: HWND list Pin
Daniel Ferguson4-Oct-02 6:22
Daniel Ferguson4-Oct-02 6:22 
GeneralThanks Pin
The_Server4-Oct-02 14:27
The_Server4-Oct-02 14:27 
GeneralVisual c++ and continue statement Pin
Sas284-Oct-02 1:14
Sas284-Oct-02 1:14 
GeneralRe: Visual c++ and continue statement Pin
Jon Hulatt4-Oct-02 1:14
Jon Hulatt4-Oct-02 1:14 
GeneralRe: Visual c++ and continue statement Pin
jmkhael4-Oct-02 2:57
jmkhael4-Oct-02 2:57 
GeneralRe: Visual c++ and continue statement Pin
Daniel Turini4-Oct-02 5:01
Daniel Turini4-Oct-02 5:01 
GeneralRe: Visual c++ and continue statement Pin
Joe Woodbury7-Oct-02 21:30
professionalJoe Woodbury7-Oct-02 21:30 
GeneralStill inheritance... Pin
Bertrand Boichon3-Oct-02 23:32
Bertrand Boichon3-Oct-02 23:32 
GeneralRe: Still inheritance... Pin
Tomasz Sowinski4-Oct-02 0:01
Tomasz Sowinski4-Oct-02 0:01 
GeneralRe: Still inheritance... Pin
Ranjan Banerji4-Oct-02 3:21
Ranjan Banerji4-Oct-02 3:21 

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.