Converting CString to Hexadecimal and Vice Versa - MFC

Howdy?!

I don't have any history with MFC, much more with C++. And I need to make a class, which converts CString to Hexadecimal and vice-versa.

Any ideas on how to work this one out?

Thanks in advance.

Comments

  • Howdy~
    maybe you can try it ^.^
    //////////////////////////////////////////////
    CString a(“12 34”);
    BYTE x[2];

    x[0] = strtol(a.Left(2),NULL,16);
    x[1] = strtol(a.Right(2),NULL,16);
    /////////////////////////////////////////////

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion