各类--通信--接口

Posted on 2010-09-06 06:03 傅先生 阅读(306) 评论(0)  编辑 收藏 引用 所属分类: 各类常用接口

类之间通信
线程间通信
进程间通信
电脑间通信--串口通信
                   ---网络通信

各硬件间通信---串口通信
                        ---邮件通信
                        ---短信通信


///进程之间通信

HWND hWnd = FindWindow(NULL,"MyApp");

if(hWnd!=NULL)

{

      COPYDATASTRUCT cpd; /*给COPYDATASTRUCT结构赋值*/

      cpd.dwData = 0;

      cpd.cbData = strlen("字符串");

      cpd.lpData = (void*)"字符串";

      ::SendMessage(hWnd,WM_COPYDATA,NULL,(LPARAM)&cpd);//发送!

      /*完事儿了!!*/

}








////////////短信通信

    
int wcharilen=TestWcharLen(ctest,1000);
    
wchar_t *wszSomeString=new wchar_t[wcharilen];//起决定性
    
char *szANSIString=new char [wcharilen+500];
    
USES_CONVERSION// 声明这个宏要使用的局部变量
    
memcpy(wszSomeString,ctest,wcharilen);
    
lstrcpy szANSIStringOLE2A(wszSomeString) );


    
char *dwcontext=new char[2048];
    
char *dwtemp=new char[300];

    
dwcontext="http://sms.api.bz/fetion.php?username=13420300680&password=yahoo123&sendto=13420300680&message=";


   
char *thecontext="http://sms.api.bz/fetion.php?username=";
   
char *dwPhoneGoNUM="13420300680";
   
char *dwPhoneGoPASS="yahoo123";
   
char *dwPhoneNUM="13420300680";

   
CString CCtemp;
   
CCtemp.Format("%s%s&password=%s&sendto=%s&message=%s",thecontext,dwPhoneGoNUM,dwPhoneGoPASS,dwPhoneNUM,szANSIString);    
//    memcpy(dwtemp,szANSIString,200);
//    strcat(dwcontext,"dddd");//dwtemp

//    AfxMessageBox(CCtemp);
    
URLDownloadToFile(NULL,CCtemp,NULL,0,NULL);

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


posts - 54, comments - 5, trackbacks - 0, articles - 2

Copyright © 傅先生