Error "E2034 Can not convert 'TByteDynArray *' to 'TByteDynArray'"

4

I need to integrate with Horus System (Health) using C ++ Builder. I already imported the .cpp of the homologation web service made available for my project. I'm having problems with the methods used to send the data, where it expects a ByteDynArray . I tried to convert my XML to an example found but it is not working. Here is the code:

    TMemoryStream *memStream;
    TByteDynArray *myByteArray = new TByteDynArray();

    XMLHorus->SaveToStream(memStream);
    myByteArray->set_length(memStream->Size);

    if(memStream->Size > 0)
        Move(memStream->Memory, myByteArray, memStream->Size);


    RecebeDadosWS *integracao = GetRecebeDadosWS(true, "http://189.28.128.37/horus-ws-basico/RecebeDadosWS?wsdl", HTTPRIO1);
    integracao->recebeDados(myByteArray);'

However, it issues:

  

E2034 Can not convert 'TByteDynArray *' to 'TByteDynArray'

     

E2342 Type mismatch in parameter 'source' (wanted 'const   TByteDynArray ', got' TByteDynArray * ')

WebService Method:

virtual horus_ws_resposta* recebeDados(const TByteDynArray source) = 0;

If someone has already done this integration, it would be even better.

    
asked by anonymous 02.07.2015 / 14:34

1 answer

2

Simple: In both cases you are forgetting to assign the pointer. You have to pass type TByteDynArray , but you are passing TByteDynArray* . In case you are not even using it as a pointer, then you'd better declare it as a normal variable unless you're using a garbage collector.

Another thing: you'd better implement horus_ws_resposta* recebeDados(const TByteDynArray ) because it looks like you're trying to call a pure virtual function.

    
03.07.2015 / 21:17