Click here to Skip to main content
15,894,540 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CInternetSession OpenURL Pin
Jochen Arndt15-May-18 0:01
professionalJochen Arndt15-May-18 0:01 
GeneralRe: CInternetSession OpenURL Pin
_Flaviu15-May-18 0:21
_Flaviu15-May-18 0:21 
GeneralRe: CInternetSession OpenURL Pin
Jochen Arndt15-May-18 0:31
professionalJochen Arndt15-May-18 0:31 
GeneralRe: CInternetSession OpenURL Pin
_Flaviu15-May-18 0:44
_Flaviu15-May-18 0:44 
GeneralRe: CInternetSession OpenURL Pin
Jochen Arndt15-May-18 1:21
professionalJochen Arndt15-May-18 1:21 
AnswerRe: CInternetSession OpenURL Pin
Randor 15-May-18 9:46
professional Randor 15-May-18 9:46 
QuestionWhy can't variables be declared in a switch statement Pin
tracyhe12313-May-18 20:34
tracyhe12313-May-18 20:34 
AnswerRe: Why can't variables be declared in a switch statement Pin
Richard MacCutchan13-May-18 20:58
mveRichard MacCutchan13-May-18 20:58 
Questionwhy passing argument by reference(&ref) in a template function shows error ? but works fine if arguments passed by pointer(*ptr) ? Pin
Tarun Jha13-May-18 1:46
Tarun Jha13-May-18 1:46 
AnswerRe: why passing argument by reference(&ref) in a template function shows error ? but works fine if arguments passed by pointer(*ptr) ? Pin
CPallini13-May-18 2:56
mveCPallini13-May-18 2:56 
GeneralRe: why passing argument by reference(&ref) in a template function shows error ? but works fine if arguments passed by pointer(*ptr) ? Pin
Tarun Jha26-May-18 9:50
Tarun Jha26-May-18 9:50 
GeneralRe: why passing argument by reference(&ref) in a template function shows error ? but works fine if arguments passed by pointer(*ptr) ? Pin
CPallini26-May-18 10:53
mveCPallini26-May-18 10:53 
Questionproblem encountered by calling constructors explicitly. Pin
Tarun Jha11-May-18 10:20
Tarun Jha11-May-18 10:20 
AnswerRe: problem encountered by calling constructors explicitly. Pin
Joe Woodbury11-May-18 11:39
professionalJoe Woodbury11-May-18 11:39 
GeneralRe: problem encountered by calling constructors explicitly. Pin
Tarun Jha11-May-18 11:57
Tarun Jha11-May-18 11:57 
AnswerRe: problem encountered by calling constructors explicitly. Pin
CPallini12-May-18 4:13
mveCPallini12-May-18 4:13 
Questionvs2005 Form window Error C2039 Pin
jimNLX11-May-18 6:31
jimNLX11-May-18 6:31 
AnswerRe: vs2005 Form window Error C2039 Pin
Victor Nijegorodov11-May-18 7:23
Victor Nijegorodov11-May-18 7:23 
GeneralRe: vs2005 Form window Error C2039 Pin
jimNLX11-May-18 7:28
jimNLX11-May-18 7:28 
GeneralRe: vs2005 Form window Error C2039 Pin
Victor Nijegorodov11-May-18 8:07
Victor Nijegorodov11-May-18 8:07 
QuestionWhy do I need typecast hex? Pin
Vaclav_11-May-18 5:18
Vaclav_11-May-18 5:18 
AnswerRe: Why do I need typecast hex? Pin
Richard MacCutchan11-May-18 6:25
mveRichard MacCutchan11-May-18 6:25 
Vaclav_ wrote:
char *TXBuffer = (char*) 0x04;
No you don't need to do that, and you shouldn't because it is wrong. You are trying to pass the value 0x04 as the buffer address, which will cause an access violation.

If you need a buffer containing the hex value, and you want to send that buffer's address to a function then you need to do one or other of the following:
C++
unsigned char TXBuffer = 0x04; // a single character
function(&TXBuffer); // use the addressOf operator to pass the address of the character to the function 

// or

unsigned char TXBuffer[] = { 0x04, 0 }; // multiple characters
function(TXBuffer); // TXBuffer is an array, so its name will be translated to its address by the compiler.


// the receiving function should be coded as
xxx function(unsigned char* buffer)
{
    // xxx is the return type
    // the function must know how many characters will be sent in the buffer
    // either a number that is always the same, or the length passed as a second parameter.
    // to access items from the buffer you use:
    unsigned char value = *buffer; // get the first value
    buffer++;                      // increment the pointer to the next element (if more than 1)
    value = *buffer;               // get the next value 
}

GeneralRe: Why do I need typecast hex? Pin
Vaclav_11-May-18 6:34
Vaclav_11-May-18 6:34 
Questionconst char [] and char[] difference question Pin
focusdoit10-May-18 14:26
focusdoit10-May-18 14:26 
QuestionRe: const char [] and char[] difference question Pin
David Crow10-May-18 17:22
David Crow10-May-18 17:22 

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.