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

<meta content="MSHTML 6.00.2900.3199" name="GENERATOR"> <style></style>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-<advise char> }<br>}</advise>

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

while(1)
{
if (AAA.G_connection )
{
strData.Format("%d", AAAA++);
AAA.G_connection-<advise char><p> Sleep(3000); <br> } <br><br> }<br> return 0;<br>}</p> <p>线程和时钟的代码完全一样,可是运行结果不一样,难到ddlml有特殊的限制?这是MSDN说明的理由:</p> <p class="MsoNormal" style="MARGIN: 6pt 0cm 12pt; LINE-HEIGHT: 18pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"><span lang="EN-US" style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">The application used a data handle initialized with a different item name handle than was required by the transaction. <p></p></span> </p> <p></p> <p></p> <p></p> <p class="MsoNormal" style="MARGIN: 6pt 0cm 12pt; LINE-HEIGHT: 18pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"><span lang="EN-US" style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">The application used a data handle that was initialized with a different clipboard data format than was required by the transaction. <p></p></span> </p> <p></p> <p></p> <p></p> <p class="MsoNormal" style="MARGIN: 6pt 0cm 12pt; LINE-HEIGHT: 18pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"><span lang="EN-US" style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">The application used a client-side conversation handle with a server-side function or vice versa. <p></p></span> </p> <p></p> <p></p> <p></p> <p class="MsoNormal" style="MARGIN: 6pt 0cm 12pt; LINE-HEIGHT: 18pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"><span lang="EN-US" style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">The application used a freed data handle or string handle. <p></p></span> </p> <p></p> <p></p> <p></p> <p><span lang="EN-US" style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: 宋体; mso-ansi-language: EN-US; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">More than one instance of the application used the same object.</span></p> <p><span lang="EN-US" style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: 宋体; mso-ansi-language: EN-US; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">我也没有弄明白什么意思。</span></p> <p><span lang="EN-US" style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: 宋体; mso-ansi-language: EN-US; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">对了,有谁知道侯捷老师的《<u><font color="#800080">Windows DDE 动态资料交换</font></u>》电子版图书在哪里下载?</span></p> <p></p> <br><br><p id="TBPingURL">Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=317981</p> <br></advise>

你可能感兴趣的:(.net,windows,Blog,mfc)