Click here to Skip to main content
15,905,607 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help with threads Pin
FISH78610-Jul-09 0:34
FISH78610-Jul-09 0:34 
AnswerRe: Help with threads Pin
Rajesh R Subramanian9-Jul-09 22:52
professionalRajesh R Subramanian9-Jul-09 22:52 
GeneralRe: Help with threads Pin
Roger Stoltz10-Jul-09 1:03
Roger Stoltz10-Jul-09 1:03 
GeneralRe: Help with threads Pin
Rajesh R Subramanian10-Jul-09 1:08
professionalRajesh R Subramanian10-Jul-09 1:08 
Questionmfc tab problem Pin
DevelopmentNoob9-Jul-09 16:15
DevelopmentNoob9-Jul-09 16:15 
AnswerRe: mfc tab problem Pin
«_Superman_»9-Jul-09 19:47
professional«_Superman_»9-Jul-09 19:47 
GeneralRe: mfc tab problem Pin
DevelopmentNoob16-Jul-09 21:18
DevelopmentNoob16-Jul-09 21:18 
QuestionIs it safe to cast from LPBYTE to LPSTR to LPBYTE ? Pin
Mike the Red9-Jul-09 13:47
Mike the Red9-Jul-09 13:47 
I have a BYTE array that contains a mix of ANSI and binary data. I'm wanting to convert the LPBYTE to LPSTR so that I can use the CString functions to pull substrings of either ANSI or binary data out of the BYTE array. I know that explicit casts can be hazardous, so I tried this:
int _tmain(int argc, _TCHAR* argv[])
{	// (BYTE = unsigned char)
	unsigned char uc = 255; // 255 is max value for unsigned char, outside range for char

	cout << "unsigned char uc = " << (int) uc << "\n";
	char c = (char) uc;
	cout << "char c = (char) uc = " << (int) c << "\n";
	uc = (unsigned char) c;
	cout << "(unsigned char) c = " << (int) uc << "\n";
}<HR>
OUTPUT:
unsigned char uc = 255
char c = (char) uc = -1
(unsigned char) c = 255


I'm not 100% that this little test tells me it's safe to convert binary data in a BYTE array to a CHAR array and back...

Can you gurus help me out, again, please? Confused | :confused:
AnswerRe: Is it safe to cast from LPBYTE to LPSTR to LPBYTE ? Pin
Stuart Dootson9-Jul-09 14:19
professionalStuart Dootson9-Jul-09 14:19 
JokeThanks, Stuart! -nt- Pin
Mike the Red9-Jul-09 15:43
Mike the Red9-Jul-09 15:43 
QuestionFormat CEdit for Phone Number Pin
DanYELL9-Jul-09 12:04
DanYELL9-Jul-09 12:04 
AnswerRe: Format CEdit for Phone Number Pin
David Crow9-Jul-09 16:11
David Crow9-Jul-09 16:11 
GeneralRe: Format CEdit for Phone Number Pin
kilt9-Jul-09 23:25
kilt9-Jul-09 23:25 
GeneralRe: Format CEdit for Phone Number Pin
DanYELL10-Jul-09 1:46
DanYELL10-Jul-09 1:46 
QuestionRe: Format CEdit for Phone Number Pin
David Crow10-Jul-09 2:52
David Crow10-Jul-09 2:52 
AnswerRe: Format CEdit for Phone Number Pin
DanYELL10-Jul-09 3:28
DanYELL10-Jul-09 3:28 
GeneralRe: Format CEdit for Phone Number Pin
David Crow10-Jul-09 3:38
David Crow10-Jul-09 3:38 
QuestionLising Windows registred users Pin
RomTibi9-Jul-09 10:17
RomTibi9-Jul-09 10:17 
QuestionRe: Lising Windows registred users Pin
David Crow9-Jul-09 16:13
David Crow9-Jul-09 16:13 
AnswerRe: Lising Windows registred users Pin
RomTibi10-Jul-09 4:36
RomTibi10-Jul-09 4:36 
AnswerRe: Lising Windows registred users Pin
kilt9-Jul-09 23:24
kilt9-Jul-09 23:24 
GeneralRe: Lising Windows registred users Pin
RomTibi10-Jul-09 4:44
RomTibi10-Jul-09 4:44 
QuestionRe: Lising Windows registred users Pin
David Crow10-Jul-09 5:30
David Crow10-Jul-09 5:30 
AnswerRe: Lising Windows registred users Pin
RomTibi11-Jul-09 6:30
RomTibi11-Jul-09 6:30 
GeneralRe: Lising Windows registred users Pin
David Crow14-Sep-09 4:15
David Crow14-Sep-09 4:15 

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.