标题:看看我的程序哪里有错啊
取消只看楼主
rebluemoon
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-6-28
 问题点数:0 回复次数:0 
看看我的程序哪里有错啊

//receive.cpp
#include"string"
#include"iostream"
#include"windows.h"
#include"winbase.h"
using namespace std;
void main()
{
// LPMS
//char* ch[100];
//MSG* a;
// static UINT WM_MY_MESSAGE=RegisterWindowMessage("Message");
if(GetMessage(NULL,NULL,0,0))
{
string aa;
//aa=a->wParam;
//cout << aa <<endl;
cout << "连接上了"<<endl;

}
else
{
cout <<"发送方不存在!!!exit"<<endl;
}
system("pause");
}

//send.cpp
#include"iostream"
#include"windows.h"
#include"winbase.h"
#include"string"
using namespace std;
void main()
{
static UINT WM_MY_MESSAGE=RegisterWindowMessage("Message");
char *p="woaizhonghua";
label:
HWND hw=FindWindow("ConsoleWindowClass",NULL);
if(!hw)
{
cout <<"接受方不存在!!! "<<endl;
system("pause");
return ;
}
/*COPYDATASTRUCT cds;
cds.cbData=sizeof(p);
// cds.dwData=0;
cds.lpData=p;
//HANDLE recV;
// GetActiveWindow()->GetSafeHwnd();
SendMessage(GetActiveWindow()->GetSafeHwnd(),WM_COPYDATA,0,(LPARAM) &cds);*/
SendMessage(hw,WM_MY_MESSAGE,(int)p,0);
if(hw) goto label;
system("pause");

}
别笑啊,没学过vc,这两天在网上看着写的,真的很困难,哪位帮忙看看

搜索更多相关主题的帖子: windows include cout 
2007-06-28 11:48



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-150983-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.635130 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved