25#include <osl/thread.h>
36 return theDdeInstData;
42 return theDdeInstData;
47 delete theDdeInstData;
48 theDdeInstData =
nullptr;
59 HCONV hConv, HSZ, HSZ hText2,
60 HDDEDATA hData, ULONG_PTR nInfo1, ULONG_PTR )
62 HDDEDATA nRet = DDE_FNOTPROCESSED;
69 for (
size_t i = 0;
i < rAll.size(); ++
i)
73 if ( self->
pImp->hConv == hConv )
80 std::vector<DdeTransaction*>::iterator iter;
85 case XTYP_XACT_COMPLETE:
86 if(
static_cast<DWORD
>((*iter)->nId) == nInfo1 )
88 nCode = (*iter)->nType & (XCLASS_MASK | XTYP_MASK);
89 (*iter)->bBusy =
false;
90 (*iter)->Done(
nullptr != hData );
96 self->
pImp->hConv = DdeReconnect( hConv );
97 self->
pImp->nStatus = self->
pImp->hConv
106 bFound = *(*iter)->pName == hText2;
121 nRet =
reinterpret_cast<HDDEDATA
>(DDE_FACK);
128 d.xImp->hData = hData;
132 nRet =
reinterpret_cast<HDDEDATA
>(DDE_FACK);
143 pImp->nStatus = DMLERR_NO_ERROR;
144 pImp->hConv =
nullptr;
153 pImp->nStatus = DdeInitializeW( &pInst->
hDdeInstCli,
155 APPCLASS_STANDARD | APPCMD_CLIENTONLY |
156 CBF_FAIL_ALLSVRXACTIONS |
157 CBF_SKIP_REGISTRATIONS |
158 CBF_SKIP_UNREGISTRATIONS, 0L );
164 if ( pImp->nStatus == DMLERR_NO_ERROR )
166 pImp->hConv = DdeConnect( pInst->
hDdeInstCli,pService->getHSZ(),pTopic->getHSZ(),
nullptr);
168 pImp->nStatus = DdeGetLastError( pInst->
hDdeInstCli );
177 DdeDisconnect(
pImp->hConv );
185 std::vector<DdeConnection*>::iterator it(std::find(pInst->
aConnections.begin(),
208 if ( DdeQueryConvInfo(
pImp->hConv, QID_SYNC, &c ) )
213 pImp->hConv = DdeReconnect(
pImp->hConv );
215 return pImp->nStatus == DMLERR_NO_ERROR;
247 rDde.aTransactions.push_back(
this );
272 if (
nType == XTYP_EXECUTE )
274 if (
nType != XTYP_EXECUTE &&
nType != XTYP_POKE )
281 HDDEDATA hData = DdeClientTransaction(
static_cast<LPBYTE
>(
const_cast<void *
>(
pData)),
283 hItem, nExtFmt,
static_cast<UINT
>(
nType),
284 static_cast<DWORD
>(
nTime),
nullptr );
287 if( hData &&
nType == XTYP_REQUEST )
291 d.xImp->hData = hData;
292 d.xImp->nFmt = nIntFmt;
296 DdeFreeDataHandle( hData );
306 HDDEDATA hRet = DdeClientTransaction(
static_cast<LPBYTE
>(
const_cast<void *
>(
pData)), nData,
308 static_cast<UINT
>(
nType), TIMEOUT_ASYNC,
311 rDde.
pImp->nStatus = hRet ? DMLERR_NO_ERROR
346 nType = sal_uInt16(XTYP_ADVSTOP);
358 nType = XTYP_REQUEST;
364 nType = XTYP_ADVSTART;
379 nType = XTYP_EXECUTE;
384 return pImp->nStatus;
tools::Long GetError() const
OUString GetTopicName() const
std::vector< DdeTransaction * > aTransactions
DdeConnection(SAL_UNUSED_PARAMETER const OUString &, SAL_UNUSED_PARAMETER const OUString &)
std::unique_ptr< DdeImp > pImp
static const std::vector< DdeConnection * > & GetConnections()
OUString GetServiceName() const
tools::Long getSize() const
static SotClipboardFormatId GetInternalFormat(sal_uLong nFmt)
static sal_uInt32 GetExternalFormat(SotClipboardFormatId nFmt)
void const * getData() const
std::unique_ptr< DdeDataImp > xImp
DdeExecute(DdeConnection &, const OUString &, tools::Long=0)
DdeHotLink(DdeConnection &, const OUString &)
std::vector< DdeConnection * > aConnections
static HDDEDATA CALLBACK CliCallback(UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, ULONG_PTR, ULONG_PTR)
DdeLink(DdeConnection &, const OUString &, tools::Long=0)
virtual ~DdeLink() override
Link< void *, void > aNotify
DdePoke(DdeConnection &, const OUString &, SAL_UNUSED_PARAMETER const DdeData &, tools::Long=0)
DdeRequest(DdeConnection &, const OUString &, tools::Long=0)
const OUString & toOUString() const
DdeTransaction(DdeConnection &, SAL_UNUSED_PARAMETER const OUString &, SAL_UNUSED_PARAMETER tools::Long=0)
Link< const DdeData *, void > aData
virtual ~DdeTransaction()
void Done(bool bDataValid)
void Data(const DdeData *)
static SolarMutex * get()
sal_uInt32 release(bool bUnlockAll=false)
void acquire(sal_uInt32 nLockCount=1)
DdeInstData * ImpInitInstData()
DdeInstData * ImpGetInstData()
std::unique_ptr< sal_Int32[]> pData