I got a structure and a function like the following:
struct MYOVERLAPPED : public OVERLAPPED
{
//...
};
void func1(std::unique_ptr<MYOVERLAPPED> pBuf)
{
//...
};
I am obtaining a pointer to MYOVERLAPPED which i want to pass to the func1-function. The problem i encounter is, that no matter what i try i get the following errors :
What i did try already are the following: Try1:
std::unique_ptr<OVERLAPPED> pOver(//....)
HandleAcceptIndication(std::move(pOver));
Error: Error 1 error C2440: 'initializing' : cannot convert from '_OVERLAPPED **' to 'MYOVERLAPPED *'
Try2:
HandleAcceptIndication(new ACCEPT_OVERLAPPED);
Error 1 error C2664: 'HandleAcceptIndication' : cannot convert parameter 1 from 'MYOVERLAPPED *' to 'std::unique_ptr<_Ty>'
Anyone knows how i can pass this casted pointer of OVERLAPPED to MYOVERLAPPED to the function and why Try2 does not work either since i casually use std::unique_ptr<MYOVERLAPPED> pO(new MYOVERLAPPED) which does work...?