Click here to Skip to main content
14,271,712 members

ATL / WTL / STL

 
AnswerRe: Trigger dialog method from non-windows app Pin
Richard Andrew x647-Sep-14 7:25
professionalRichard Andrew x647-Sep-14 7:25 
GeneralRe: Trigger dialog method from non-windows app Pin
bkelly137-Sep-14 15:39
memberbkelly137-Sep-14 15:39 
GeneralRe: Trigger dialog method from non-windows app Pin
Richard Andrew x647-Sep-14 15:54
professionalRichard Andrew x647-Sep-14 15:54 
QuestionProgram for implementing Quine McCluskey's method for 8,9 or 10 variables Pin
Member 1103323724-Aug-14 16:55
memberMember 1103323724-Aug-14 16:55 
AnswerRe: Program for implementing Quine McCluskey's method for 8,9 or 10 variables Pin
Richard MacCutchan24-Aug-14 21:52
protectorRichard MacCutchan24-Aug-14 21:52 
QuestionProgram for implementing Quine McCluskey's method for 8,9 or 10 variables Pin
Member 1103323724-Aug-14 16:38
memberMember 1103323724-Aug-14 16:38 
AnswerRe: Program for implementing Quine McCluskey's method for 8,9 or 10 variables Pin
Richard MacCutchan24-Aug-14 21:52
protectorRichard MacCutchan24-Aug-14 21:52 
Questionunexpected address value in WSABUF ( RESOLVED ) Pin
bkelly1311-Aug-14 13:34
memberbkelly1311-Aug-14 13:34 
Windows 7, Visual Studio 2010, C++
structure m_common_data contains:
struct st_common_data
{...
    LPWSABUF  p_lpwsabuf_array[ TCP_SERVER_PACKET_BUFFER_SIZE ];

where the constant has the value 16.
The main app dot H contains:
char m_send_buf_array[ TCP_SERVER_PACKET_BUFFER_SIZE ][TEST_BUFFER_SIZE];

where TEST_BUFFER_SIZE is an arbitrary 1024 for initial testing.
the main app dot CPP initializes all with this, and after some debugging variables were installed looks like this:

void CTest_ServerDlg::Initialize_Send_Buffers()
{
    unsigned int db1, db2a, db2b, db2c, db2d, db3, db4, db5, db6, db7;
    for( int i = 0; i < TCP_SERVER_PACKET_BUFFER_SIZE; i ++ )
    {
        for( int j = 0; j < TEST_BUFFER_SIZE; j ++ )
        {
            m_send_buf_array[ i ][ j ] =  ( ( i * 5 ) + j ) % 255;
        }

        db1 = (unsigned int) &m_send_buf_array[ i ][0];
        db2a = m_send_buf_array[ i ][0];
        db2b = m_send_buf_array[ i ][1];
        db2c = m_send_buf_array[ i ][2];
        db2d = m_send_buf_array[ i ][3];
        db3 = sizeof( m_send_buf_array[ i ] );
        db4 = (unsigned int) &m_common_data;
        db5 = (unsigned int) &( m_common_data.p_lpwsabuf_array[ i ] );
        db6 = (unsigned int) &( m_common_data.p_lpwsabuf_array[ i ]->buf );

        m_common_data.p_lpwsabuf_array[ i ]->buf = &m_send_buf_array[ i ][0];  // error
        m_common_data.p_lpwsabuf_array[ i ]->len = sizeof( m_send_buf_array[ i ] );
    }


When stopped on the first time through the i loop, i = 0.
The debugger shows
db1 = a valid looking address
dba,b,c, and d contain: 0, 1, 2, 3, as expected
db3 = 0X400, expected
db4 looks like a valid address
db5 = db4 + 0xF0 again expected because of items not shown.
db6 shows the value 4.

db6 is the value I do not comprehend. I expected a valid address here, specifically I expected the value to be 4 larger than db5 because the ->buf item of structure WSABUF is the second item in the structure.
Please explain why db6 has the value 4 rather than the address of item ->buf.
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com



modified 14-Aug-14 11:56am.

QuestionRe: unexpected address value in WSABUF Pin
Richard MacCutchan11-Aug-14 21:25
protectorRichard MacCutchan11-Aug-14 21:25 
AnswerRe: unexpected address value in WSABUF Pin
bkelly1312-Aug-14 1:51
memberbkelly1312-Aug-14 1:51 
GeneralRe: unexpected address value in WSABUF Pin
Richard MacCutchan12-Aug-14 3:36
protectorRichard MacCutchan12-Aug-14 3:36 
GeneralRe: unexpected address value in WSABUF Pin
bkelly1312-Aug-14 5:42
memberbkelly1312-Aug-14 5:42 
GeneralRe: unexpected address value in WSABUF Pin
Richard MacCutchan12-Aug-14 20:48
protectorRichard MacCutchan12-Aug-14 20:48 
GeneralRe: unexpected address value in WSABUF Pin
bkelly1313-Aug-14 1:53
memberbkelly1313-Aug-14 1:53 
GeneralRe: unexpected address value in WSABUF Pin
Richard MacCutchan12-Aug-14 4:54
protectorRichard MacCutchan12-Aug-14 4:54 
AnswerMoving on to WSASend Pin
bkelly1313-Aug-14 10:33
memberbkelly1313-Aug-14 10:33 
GeneralRe: Moving on to WSASend Pin
Richard MacCutchan13-Aug-14 22:08
protectorRichard MacCutchan13-Aug-14 22:08 
GeneralRe: Moving on to WSASend Pin
bkelly1314-Aug-14 3:19
memberbkelly1314-Aug-14 3:19 
GeneralRe: Moving on to WSASend Pin
Richard MacCutchan14-Aug-14 3:30
protectorRichard MacCutchan14-Aug-14 3:30 
GeneralRe: Moving on to WSASend Pin
bkelly1314-Aug-14 3:52
memberbkelly1314-Aug-14 3:52 
QuestionCreating Classes in VS 2013 Pin
Bram van Kampen9-Aug-14 15:22
memberBram van Kampen9-Aug-14 15:22 
AnswerRe: Creating Classes in VS 2013 Pin
Richard Andrew x649-Aug-14 17:50
professionalRichard Andrew x649-Aug-14 17:50 
Questionerror - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' Pin
Swap95-Aug-14 21:40
memberSwap95-Aug-14 21:40 
AnswerRe: error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' Pin
Richard MacCutchan5-Aug-14 22:34
protectorRichard MacCutchan5-Aug-14 22:34 
AnswerRe: error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' Pin
Subrat 470826612-Sep-14 15:15
memberSubrat 470826612-Sep-14 15: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.