|
|
|
@ -96,15 +96,13 @@ func (c *DdeServer) RunServer() bool {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
c.close = false
|
|
|
|
|
fmt.Printf("服务端开启")
|
|
|
|
|
fmt.Println("服务端开启")
|
|
|
|
|
for {
|
|
|
|
|
//do something
|
|
|
|
|
var msg TagMSG
|
|
|
|
|
if int(ddeml.GetMessage(&msg, 0, 0, 0)) <= 0 {
|
|
|
|
|
if c.close {
|
|
|
|
|
if int(ddeml.GetMessage(&msg, 0, 0, 0)) <= 0 || c.close {
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ddeml.TranslateMessage(&msg)
|
|
|
|
|
ddeml.DispatchMessage(&msg)
|
|
|
|
|
}
|
|
|
|
@ -118,7 +116,7 @@ func (c *DdeServer) DestoryServer() {
|
|
|
|
|
for i := 0; i < len(c.Items); i++ {
|
|
|
|
|
ddeml.DdeFreeStringHandle(c.IdInst, c.HszItem[i])
|
|
|
|
|
}
|
|
|
|
|
fmt.Printf("服务端关闭")
|
|
|
|
|
fmt.Println("服务端关闭")
|
|
|
|
|
ddeml.DdeNameService(c.IdInst, c.HszApp, 0, UINT(DNS_UNREGISTER))
|
|
|
|
|
ddeml.DdeUninitialize(c.IdInst)
|
|
|
|
|
}
|
|
|
|
|