Hi All,
I have a function that manipulates buffers:
void foo (TDes8 & a_buffer1, TDes8 & a_buffer2 )
How do I define the objects for that function???
Thanks,
Nahum
Hi All,
I have a function that manipulates buffers:
void foo (TDes8 & a_buffer1, TDes8 & a_buffer2 )
How do I define the objects for that function???
Thanks,
Nahum
Strange question ... but if I got it right here's a possible answer:
Code:TBuf8<30> oneBuffer; HBufC8* anotherBuffer = HBufC8::NewLC(30); ... TPtr8 ptr = anotherBuffer->Des(); foo(oneBuffer, ptr); ... CleanupStack::PopAndDestroy(anotherBuffer);
Thanks ltomuta,
You got it right but the code is not compiling:
void foo ( TDes8 & a_buffer ) {}
HBufC8 * buffer = HBufC8::NewL ( 16 ) ;
foo ( buffer->Des() ) is not compiling. The compiler output is:
function call '[TParser].foo(TPtr8)' does not match
'TParser::foo(TDes8 &)' (non-static)
Nahum
I think I've wrote
and notCode:foo(/*oneBuffer,*/ ptr);
It isn't exactly the same thing ... Then, are you sure that you need HBufC rather than TBuf ? If so RBuf may be a better option if your SDK supports it.Code:foo(anotherBuffer->Des());
Thanks,
I don't care if it is HBuf or TBuf. All I need is:
*** buffer;
foo( TDes8 & a_buffer)
and then to call:
foo ( buffer ).
What is *** ???
In C++ that can be anything derived from TDes8 so basically any modifiable (if needed) or unmodifiable (if method only reads data from it) 8 bit descriptor. It pretty much depends on what are you doing with the data stored inside.