Click here to Skip to main content
16,011,685 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: 2's compliment Pin
Michael Dunn3-Jan-01 15:25
sitebuilderMichael Dunn3-Jan-01 15:25 
GeneralRe: 2's compliment Pin
Tim Deveaux4-Jan-01 8:34
Tim Deveaux4-Jan-01 8:34 
QuestionGZIP file compression suggestions? Pin
Josh Knox3-Jan-01 9:30
Josh Knox3-Jan-01 9:30 
AnswerRe: GZIP file compression suggestions? Pin
Jonathan Gilligan3-Jan-01 12:25
Jonathan Gilligan3-Jan-01 12:25 
GeneralGetDeviceCaps, C1_TRANSPARENT, CAPS1 and NEWTRANSPARENT Pin
Marc Richarme3-Jan-01 8:31
Marc Richarme3-Jan-01 8:31 
GeneralRe: GetDeviceCaps, C1_TRANSPARENT, CAPS1 and NEWTRANSPARENT Pin
3-Jan-01 10:22
suss3-Jan-01 10:22 
GeneralGetting terminal output in HEX format Pin
3-Jan-01 7:20
suss3-Jan-01 7:20 
GeneralRe: Getting terminal output in HEX format Pin
Tim Deveaux3-Jan-01 10:04
Tim Deveaux3-Jan-01 10:04 
Here's some thoughts - you might be able to tinker with one of these. Basically, an intermediate step is involved to take the char and format it as hex.

// Formattest.cpp : Defines the entry point for the console application.
//
#include "windows.h"
#include <iostream.h>
#include <strstrea.h>
#include <stdio.h>
 
 
// method 3 (see main)
void OutHex(char c) {
    // set up a buffer
    char buf[8];
 
    // print the char as hex (uppercase) to a buffer...
    sprintf(buf,"%X ", c);
 
    // output the buffer...
    cout << buf;
}
 
 
int main(int argc, char* argv[])
{
 
    char test[] = "Here's some char data";
 
    HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
 
    strstream ss;
 
    DWORD dwBytesWritten;
 
    char *p;
 
    cout << "Method 1:" << endl;
 
    // method 1 - print using cout, with the hex manipulator...
    for ( p = test; *p;  ++p) {
        cout << hex << (int)*p << " ";
    }
 
    
    cout << endl << "Method 2:" << endl;
 
    // method 2 - first print to stream buf, then use WriteConsole...
    for ( p = test; *p;  ++p) {
        ss << hex << (int)*p << " ";
    }
 
    WriteConsole(hStdOut, ss.str(), ss.pcount(), &dwBytesWritten, NULL);
 
 
    cout << endl << "Method 3:" << endl;
 
    // method 3 - use OutHex function
    for ( p = test; *p;  ++p ) {
        OutHex(*p);
    }
 
    // pause...
    int x;
    cin >> x;
 
    return 0;
}

GeneralIf the contents of file modified outside the editor Pin
3-Jan-01 5:10
suss3-Jan-01 5:10 
GeneralWAVEFORMATEX Pin
Roger3-Jan-01 4:58
Roger3-Jan-01 4:58 
GeneralFormatMessage Pin
3-Jan-01 2:33
suss3-Jan-01 2:33 
GeneralRe: FormatMessage Pin
3-Jan-01 4:19
suss3-Jan-01 4:19 
GeneralRe: FormatMessage Pin
3-Jan-01 23:44
suss3-Jan-01 23:44 
QuestionIs this method to get defaullt domain name correct? Pin
3-Jan-01 2:30
suss3-Jan-01 2:30 
GeneralHOWTO : Insert Office Documents into a Dialog base apps Pin
jerry0davis3-Jan-01 1:28
jerry0davis3-Jan-01 1:28 
QuestionAnyone know where I can get a class that plays MP3 via DirectSound ? Pin
Christian Graus2-Jan-01 20:02
protectorChristian Graus2-Jan-01 20:02 
AnswerRe: Anyone know where I can get a class that plays MP3 via DirectSound ? Pin
Erik Funkenbusch3-Jan-01 6:51
Erik Funkenbusch3-Jan-01 6:51 
GeneralRe: Anyone know where I can get a class that plays MP3 via DirectSound ? Pin
Christian Graus3-Jan-01 9:38
protectorChristian Graus3-Jan-01 9:38 
GeneralRe: Anyone know where I can get a class that plays MP3 via DirectSound ? Pin
Erik Funkenbusch3-Jan-01 13:53
Erik Funkenbusch3-Jan-01 13:53 
GeneralHotkeys and threads Pin
Tanya2-Jan-01 18:45
Tanya2-Jan-01 18:45 
GeneralLow level database routines for win32 (not DB classes) Pin
2-Jan-01 7:49
suss2-Jan-01 7:49 
GeneralAnimateWindow() does not work Pin
2-Jan-01 7:04
suss2-Jan-01 7:04 
QuestionNetwork: Get MAC address for Network adapters ? Pin
2-Jan-01 6:16
suss2-Jan-01 6:16 
GeneralSendInput ESC Pin
2-Jan-01 5:22
suss2-Jan-01 5:22 
Generalmacro in word Pin
2-Jan-01 2:57
suss2-Jan-01 2:57 

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.