CString转System::String ^应用实例
来源:互联网 发布:定时提醒软件 绿色 编辑:程序博客网 时间:2024/05/29 19:13
需要使用using namespace System;
void CTrafficDetectDlg::OnNetStart()
{NetPushGeoDaemon ^netPushGeoDaemon=gcnew NetPushGeoDaemon();
CString cstr = "";
// TODO: Add your command handler code here
dscServer.DoModal();//DSC服务界面
if(dscServer.isLogin)//打开DSC服务
{
cstr = dscServer.csDSCip;//DSC服务界IP Control传回IP地址
System::String ^ip = gcnew String(cstr.GetBuffer());//CString转System::String ^
cstr.ReleaseBuffer();//释放资源
//ip = gcnew String(dscServer.csDSCip);
if(netPushGeoDaemon->BuildNetConnection(ip,dscServer.iDSCport))//连接服务器
{
AfxMessageBox("打开DSC服务成功!");
}
else
{
AfxMessageBox("打开DSC服务失败!");
}
}
else//关闭DSC服务
{
if(netPushGeoDaemon->StopNetPushDaemon())//关闭服务器
{
AfxMessageBox("关闭DSC服务!");
}
else
{
AfxMessageBox("关闭DSC服务失败!");
}
}
//int N = 24;
//cli::array<System::Byte>^ senddata = gcnew cli::array<System::Byte>(N);
//char senddata1[24] ={ 0xFE, 0xEF, 0x03, 0x02, 0x01, 0x04, 0x05, 0x06, 0x07, 0x08, 0x0E, 0x04, 0x0B, 0x0E, 0x0D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xAA };
//for(int i=0;i<N;i++)
//{
// senddata[i]=senddata1[i];
//}
//netPushGeoDaemon->NetPushDataRecordThread(senddata);//发送数据
}
0 0
- CString转System::String ^应用实例
- CString转化为System::String^的做法
- string转CString CString转string
- string 转 CString,CString 转 string
- CString 转 String和String转CString
- CString转string、string转CString
- CString成员函数应用实例
- CString转char * ,string
- CString转char * ,string
- string转CString
- CString转char * ,string .
- MFC CString转string
- CString转char * ,string
- CString 转 std::string
- CString转char * ,string
- CString转char * ,string
- cstring 转 string
- CString转char * ,string
- DataTable表的批量插入及自定义导出的使用
- C++基础---函数的返回类型
- STM32F4——NVIC中断优先级及外部中断
- HDU 5354 Bipartite Graph[cdq+并查集]
- POJ 2406 Power Strings(KMP 找最短循环节)
- CString转System::String ^应用实例
- poj 2752Seek the Name, Seek the Fame 【kmp】
- hibernate一对一,一对多,多对一,多对多关系映射与级联
- 我的金工实习心得(一):预热
- 线程sleep和yield的区别
- C++ 中的封装、继承
- 今天的考试
- 【动态树问题】LCT学习笔记
- UIFont管理文字形态