Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Ewi

  1. Ewi

    Pointer cast problem: from DWORD * to BYTE *

    Oh yes, I put it down after I found the bug. If you you want to I will put it up again...
  2. Ewi

    sprintf question

    I hope the syntax is similiar to wsprintf. %[-][#][0][width][.precision]type your example touches: width: Copy the specified minimum number of characters to the output buffer. The width field is a nonnegative integer. The width specification never causes a value to be truncated; if the number...
  3. Ewi

    Pointer cast problem: from DWORD * to BYTE *

    I think I found the reason. Will report later, cause now I have to go. Thank you...
  4. Ewi

    Pointer cast problem: from DWORD * to BYTE *

    I put up the whole project (VS.NET 2003, code is completly in sha1.c, GUI is in resource.rc): http://www.stw-bonn.de/~z25525/public/sha1.zip It implements the SHA-1 algorithm. The corresponding lines are in function OutSHA1Value (line 104 and line 134). If I comment out line 104 (correspond...
  5. Ewi

    Pointer cast problem: from DWORD * to BYTE *

    Thank you, too. I never worked with unions before. As far as I know one uses unions if it is necessary that a variable can be of different types, i.e. that 'number' is an int or a float. IIRC such a union variable is than int OR float and one can't access an int as float (as long as you don't...
  6. Ewi

    Pointer cast problem: from DWORD * to BYTE *

    Thank you for your answer. IIRC I read about this alignment sometime. Perhaps I had luck and by coincidence the byte array is aligned to a suitable adress. But the order is right; the second works, the first does not...
  7. Ewi

    Pointer cast problem: from DWORD * to BYTE *

    Hi! I'm very frustrated. I have to access the same data as DWORD values and at the same time as BYTE values. I did this (simplified): 1: DWORD dwBuffer[16]; 2: PBYTE bBuffer = (BYTE *)dwBuffer; 3: dwBuffer[2]= dwFileSizeHi; 4: bBuffer[0] = (BYTE)0x80; This doesn't work. I get an access...

Part and Inventory Search

Back
Top