MFC DDE开发中令人迷惑的问题?

2005年03月12日 14:15:00

在用MFC(ddeml)开发DDE中,遇到一个令人迷惑的问题, ddeml提供的一些命令,在时钟函数里或按钮事件里运行正常,可是在线程里运行就出现如下错误:

"A parameter failed to be validated by the DDEML."

下面是两段代码:

//时钟
void YD::TimerProc(long hwnd,long nIDEvent,long uElapse,long lpTimerFunc)
{
CString strData;
static AAAA=0;
if (AAA.G_connection )
{
strData.Format("T%d", AAAA++);
AAA.G_connection- }
}

//线程
UINT YD::YFDDE(LPVOID pParam)
{
CString strData;
static AAAA=0;

while(1)
{
if (AAA.G_connection )
{
strData.Format("%d", AAAA++);
AAA.G_connection-

Sleep(3000);
}

}
return 0;
}

线程和时钟的代码完全一样,可是运行结果不一样,难到ddlml有特殊的限制?这是MSDN说明的理由:

The application used a data handle initialized with a different item name handle than was required by the transaction.

The application used a data handle that was initialized with a different clipboard data format than was required by the transaction.

The application used a client-side conversation handle with a server-side function or vice versa.

The application used a freed data handle or string handle.

More than one instance of the application used the same object.

我也没有弄明白什么意思。

对了,有谁知道侯捷老师的《Windows DDE 动态资料交换》电子版图书在哪里下载?



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=317981


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值