1
0
-1

Hello When i try this code :

// C
EXPORT int test(unsigned char* fld)
{
    byte tmp[20];
    memset(tmp, 0, 20);
    tmp[0] = 'A';
    tmp[6] = 'A';

    unsigned char bn[80];
    ugetbind(fld, bn);
    ufput(bn, tmp, -20);
    ufputc(bn, tmp, 0);
    return 20;
}
// Uniface

trigger
public web
    activate "CONV".test("T_RAW.HTML.WHEXA")
    filedump/raw T_RAW.HTML.WHEXA, "test.dump"
    putmess T_RAW.HTML.WHEXA
    putmess $encode("HEX", T_RAW.HTML.WHEXA)
end

In trace I expect :

activate "CONV"."test"( "T_RAW.HTML.WHEXA" )

filedump/raw T_RAW.HTML, "test.dump"

putmess T_RAW.HTML

A{!{!{!{!{!A{!{!{!{!{!{!{!{!{!{!{!{!{!{!

putmess $encode("HEX",T_RAW.HTML)

4100000000004100000000000000000000000000


But I have :

activate "CONV"."test"( "T_RAW.HTML.WHEXA" )

filedump/raw T_RAW.HTML, "test.dump"

putmess T_RAW.HTML

A{!{!{!{!{!A

putmess $encode("HEX",T_RAW.HTML)

41000000000041


    CommentAdd your comment...

    4 answers

    1.  
      1
      0
      -1

      I have tried this in 10.3.02 (should be the same in 9.7.05) and it works fine - I get your expected results.

      A{!{!{!{!{!A{!{!{!{!{!{!{!{!{!{!{!{!{!
      4100000000004100000000000000000000000000

      Can you check the definition of the field has the DataType of R and interface of R*



        CommentAdd your comment...
      1.  
        1
        0
        -1

        I don't know about C and Base64 encoding. But if that's not a problem, I would go via Base64 to send it to your C-routine and back to Uniface.

        Regards RogerW.

        1. Nathan Nau

          That's what I'm going to do, but it's not great ...

        CommentAdd your comment...
      2.  
        1
        0
        -1

        I have to digitally sign a document.
        I retrieve the document in my database via uniface (in raw).
        I send it to my routine in C, which sends me the signed document (in raw)


          CommentAdd your comment...
        1.  
          1
          0
          -1

          Just curious - what exactly are you trying to do?

          Knut

            CommentAdd your comment...