Error "E2034 Cannot Convert 'Tbytedynarray *' to 'Tbytedynarray'"

Asked

Viewed 150 times

4

I need to perform an integration with Horus System (Health), using C++ Builder. I already imported the .cpp of the Approval web service made available for my project. I have problems in the methods used to send the data, where it expects a ByteDynArray. I tried to convert my XML as an example found, but it’s not working. Follow 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 emits :

E2034 Cannot 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.

  • What to tag rstudio is asking in this question?

  • Edited title: The problem is not with the webservice is the conversion of variables.

1 answer

2

Simple: in both cases you are forgetting to dereference the pointer. You have to pass the type TByteDynArray, but it is passing TByteDynArray*. In case you are not even using it as a pointer, then it would be better if you declared it as a normal variable unless you are using a Garbage-Collector.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.