 |
VC读取XML简单例子
|
|
| |
| <?xml version="1.0"?>
<BitComet Author="RnySmile" Version="0.1">
<Settings>
<LastSaveLocation>E:\电子书</LastSaveLocation>
<ListenPort>8497</ListenPort>
<GlobalMaxUploadRate>3072</GlobalMaxUploadRate>
<LastAdCacheClearDate>13104</LastAdCacheClearDate>
<LastTrackerKey>16547</LastTrackerKey>
<TotalUpload>303008</TotalUpload>
<TotalDownload>1180107</TotalDownload>
<LastExitTime>1132203124</LastExitTime>
</Settings>
</BitComet>
代码如下:
#include "stdaf ...
|
|
| 作者:折翼天使 changhai203张贴于2009-07-03 14:46:52.0,共阅读1168次,回复2次 |
|
|
 |
简单的UDP例子
|
|
| |
| 服务器端: 新建一个对话框程序UDPSrv, 上面放置一个list box用来记录客户端发给它的消息 头文件: #include "Winsock2.h" #pragma comment(lib,"Ws2_32.lib") 在class CUDPSrvDlg : public CDialog 中加入: { CListBox m_list; //与列表框控件相关联,用来显示客户端发给它的消息 SOCKET sockSrv; ….. } 在BOOL CUDPSrvDlg::OnInitDialog()中加入 { …………… //要在线程中接收消息,不然程序会没响应 AfxBeginThread(ListenThread,this); } 其中UINT ListenThread(LPVOID pParam) { //加载库 WORD wVersionRequested; WSADATA wsaData; wVersionRequested = MAKEWORD(2,2); if(0 == WSAStartup(wVersionRequested,&wsaData)) { if(LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) { AfxMessageBox("加载库失败"); WSACleanup(); ret ...
|
|
| 作者:彭斯 pengsiqi1985张贴于2010-01-15 10:39:25.0,共阅读113次,回复0次 |
|
|
 |
我写的俄罗斯方块,只能显示,但不能向下移动,那位高人看看,帮帮忙!!!
|
|
| |
| ...程序的思路很简单,建立一个游戏框网格,ROWS * COLS 再建立一个方块网格4*4 然后扫描, 但不知道怎么弄的,可以画出方块,但方块不能向下移, 很郁闷啊, /////////////////////////////////////////////////////////////////////////////////// 主程序:boll.cpp /////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include<windows.h> #include<string.h> #include<stdlib.h> #include<stdio.h> #include<math.h> #include "CPiece.h" LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPSTR lpszCmdLine,int nCmdShow) { HWND hwnd; MSG Msg; WNDCLASS wndclass ...
|
|
| 作者:wj woods张贴于2010-01-07 20:01:08.0,共阅读113次,回复0次 |
|
|
 |
获取本地IP地址
|
|
| |
| CString CUtil::GetLocalIp()
{
struct hostent * phost;
char ip[20];
char hostname[50];
gethostname(hostname, 50);
phost = gethostbyname(hostname);
char * * names;
names = phost->h_aliases;
char * * iplist;
iplist = phost->h_addr_list;
while (* iplist)
{
strcpy(ip, inet_ntoa(* (struct in_addr *) * iplist));
iplist++;
}
CString LocalIp = ip;
return LocalIp;
}
|
|
| 作者:不祥 bluejoe张贴于2004-03-02 16:40:13.0,共阅读9150次,回复5次 |
|
|
 |
自定义窗口框架对象MyFrame
|
|
| |
| 编译无错误,而连接时出现了一个情况,源码如下:
#include<afxwin.h>
#include"resource.h"
class MyFrame:public CFrameWnd
{
private:
CMenu *FMenu;
public:
MyFrame()
{
Create(NULL,L"Hello MFC");
FMenu=new CMenu;
FMenu->LoadMenu(IDR_MENU1);
SetMenu(FMenu);
}
~MyFrame(){delete FMenu;}
};
class MyApp:public CWinApp
{
public:
BOOL InitInstance()
{
CFrameWnd *Frame=new CFrameWnd;
m_pMainWnd=Frame;
Frame->ShowWindow(SW_SHOW);
return true;
}
};
MyApp a_pp;
错误为:
RegSvr32 ...
|
|
| 作者:yifang yifang张贴于2009-11-02 22:21:14.0,共阅读236次,回复0次 |
|
|
 |
ADO连接SQL
|
|
| |
| ...// SQL.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "SQL.h"
#include "SQLDlg.h"
#include "LoadDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSQLApp
BEGIN_MESSAGE_MAP(CSQLApp, CWinApp)
//{{AFX_MSG_MAP(CSQLApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
...
|
|
| 作者:Daveyong Daveyong张贴于2009-08-27 20:02:24.0,共阅读456次,回复0次 |
|
|
 |
在线编辑器
|
|
| |
| 能不能提供在线编辑器的源码。
|
|
| 作者:alex alexzhang张贴于2009-08-26 02:16:31.0,共阅读370次,回复0次 |
|
|
 |
网站宣传推广员,每天轻松赚90元(适合在家在校兼职)地区不限
|
|
| |
| 职位名称:网站宣传推广员。
职位要求:会论坛的常见操作,发帖,注册等,要求会使用Word,会发送电子邮件,上网比较熟练。地区、年龄不限。
职位性质:对公司的网站进行推广,员工完成后将推广地址发至公司 邮箱即可,适合在校学生。 工作地点:家里、网吧均可工作。(能上网即可)
职位待遇:3-4元每帖,工资每日结算。
职位介绍:主要工作是宣传,发布信息等,工作简单,但要求细心,有责任心,为人诚实。
申请加入请登录:http://www.1917game.cn 邮箱:xkzp@qq.com
|
|
| 作者:daichg daichg张贴于2009-08-02 19:31:38.0,共阅读401次,回复1次 |
|
|
 |
C++简单实现委托
|
|
| |
| #include <iostream>
using namespace std;
// 委托类定义
// ClassType 要代理的类类型、ReturnType 委托函数返回类型
// Parameter1Type 委托函数第一个参数类型、Parameter2Type 委托函数第二个参数类型
template<typename ClassType, typename ReturnType, typename Parameter1Type, typename Parameter2Type>
class CDelegate
{
// 定义委托方法
typedef ReturnType (ClassType::*CallBack)(Parameter1Type p1, Parameter2Type p2);
public:
CDelegate(ClassType *pObj)
{
pDelegateObj = pObj;
callBack = NULL;
}
// 绑定委托函数
void operator = (CallBack callBack)
{
this->callBack = callBack;
}
// 执行委托函数
ReturnType operator () (Paramete ...
|
|
| 作者:弹指怡笑 huymou张贴于2009-07-30 14:37:14.0,共阅读424次,回复0次 |
|
|
 |
求VC强行删除和强行复制代码
|
|
| |
| ...求VC强行删除和强行复制代码,就是说比如一个程序正在运行(EXE格式),我想把它强行删除,并且强行复制替换这个文件,有这种代码么,我准备编写一个强行删除和强行复制的代码啊.
|
|
| 作者:asklf312 zxc37247151张贴于2009-02-04 03:40:50.0,共阅读951次,回复4次 |
|
|
 |
VC 删除Tree所选结点下所有子结点
|
|
| |
| HTREEITEM hSel=m_wndTree.GetSelectedItem();//取得选项句柄;
if(hSel==NULL) return;//无任何选项则返回
HTREEITEM hNext;
HTREEITEM hChild=m_wndTree.GetChildItem(hSel);//获取所选节点子节点的句柄,
while(hChild!=NULL)
{
hNext =m_wndTree.GetNextItem(hChild,TVGN_NEXT);
m_wndTree.DeleteItem(hChild);
hChild=hNext;
}
|
|
| 作者:折翼天使 changhai203张贴于2009-07-03 10:17:23.0,共阅读453次,回复0次 |
|
|
 |
中国邮递员问题的C++实现源代码
|
|
| |
| //PKU 2337
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;
const int MAX = 1100;
char str[MAX][25];
int n, in[MAX], out[MAX];
vector<string> words[30];
int vis[30];
int f[30], ss, is, os, ps;
int seq[MAX], step;
void find_euler(int pos)
{
int i,j;
while(out[pos])
{
for(; vis[pos] < words[pos].size() ;)
{
string snext = words[pos][ vis[pos] ];
j = snext[snext.length() -1] -’a’;
out[pos] --;
vis[pos] ++;
...
|
|
| 作者:yong yong张贴于2008-09-17 21:15:27.0,共阅读1633次,回复1次 |
|
|
 |
最大公约数的求法
|
|
| |
| int mcd(int a, int b)
{
if( a <= 0 || b <= 0 )
return -1;
int max,min;
max = a > b ? a : b;
min = a + b - max;
int temp;
//辗转相除
while( min )
{
temp = min;
min = max % min;
max = temp;
}
return max;
}
|
|
| 作者:不祥 bluejoe张贴于2004-02-20 23:47:58.0,共阅读5007次,回复7次 |
|
|
 |
获取系统可用串口列表
|
|
| |
| int CUtil::GetSystemPorts(CString *pNameList, CString *pPortList)
{
CRegKey RegKey;
int nCount = 0;
if(RegKey.Open(HKEY_LOCAL_MACHINE, "Hardware\\DeviceMap\\SerialComm") == ERROR_SUCCESS)
{
while(true)
{
char ValueName[_MAX_PATH];
unsigned char ValueData[_MAX_PATH];
DWORD nValueSize = _MAX_PATH;
DWORD nDataSize = _MAX_PATH;
DWORD nType;
if(::RegEnumValue(HKEY(RegKey), nCount, ValueName, &nValueSize, NULL, &nType, ValueData, &nDataSize) == ERROR_NO_MORE_ITEMS)
{
break;
}
if(pNameList)
pNameList[nCount] = ValueName;
...
|
|
| 作者:不祥 bluejoe张贴于2004-03-10 14:59:41.0,共阅读4320次,回复1次 |
|
|
 |
RGN区域放大
|
|
| |
| ...RGN区域放大
有一个RGN区域。是描点描出来的。
我想让这个区域以中心的位置放大。
不知道如何放大这个RGN区域。是按照这个区域的中心位置把四边的点向外拉伸。
还是如何做。。。。
大家出点主意
|
|
| 作者:波波 mengxianbo92张贴于2009-06-01 10:29:04.0,共阅读486次,回复0次 |
|
|
 |
大家帮忙....有没有VC数据库编程的书关于SQL的?
|
|
| |
| ...
O(∩_∩)O~新手上路...
希望大家多多帮助下.....
|
|
| 作者::-O新手 qinguifeng张贴于2009-03-26 02:38:49.0,共阅读764次,回复1次 |
|
|
 |
发贴就能挣钱的贴吧 招聘兼职管理员和吧主,月薪600
|
|
| |
| 发贴就能挣钱的贴吧 招聘兼职管理员和吧主,月薪600
详情请参阅:http://tieba.cangzhuo.com/tieba-FAQ.html
报名地址:http://tieba.cangzhuo.com/tieba-%25B0%25C9%25D6%25F7.html
有任何疑问请联系:QQ群16592133、72133568
有意请尽速报名!名额限:200人!
|
|
| 作者:藏拙网络 czw0001张贴于2009-03-12 05:22:04.0,共阅读667次,回复0次 |
|
|
 |
C#怎样调用XML的函数或变量,高手请进,急急,
|
|
| |
| 我只要把变量或函数(变量t或函数aadd())调出来就行,用VC#,用VC也行,谢谢大家了,
<Ui>
<Script file="a.lua"/>
<Scripts>
<book id="bk101">
float s=aadd();
<author tt="$#t" xx="4444">t</author>
<title>XML Developer’s Guide</title>
</book>
</Scripts>
</Ui>
VC#中,
XmlDocument xmldoc=new XmlDocument();
XmlNode node;
xmldoc.Load("d:\\he.xml");
下边我就不行,哪位高手能说一下么,谢谢了,急用
|
|
| 作者:silly chuguide张贴于2009-02-25 22:13:27.0,共阅读635次,回复0次 |
|
|
 |
手机短信PDU编码与解码
|
|
| |
| //将短信转化为待发送编码
//AT+CMGS=021
//0011000D91683176116125F0000801064F60597DFF01
//021 TPDU长度
//PDU:SMSC地址+TPDU
//00 服务中心号码(SMSC地址)
//11
//00 TP-MR(TP-Message-Reference)
//0D91683176116125F0 TP-DA 收信人手机号码
//00 TP-PID(TP-Protocol-Identifier)
//08 TP-DCS(TP-Data-Coding-Scheme)
//01 TP-VP(TP-Validy-Period)
//06 TP-UDL 短信长度
//4F60597DFF01 TP-UD 你好!
//服务中心号码、收信人手机号码格式
//0D Address-Length 地址长度
//91 Type-of-Address 地址类型
// Bits 7
// 1
// Bits 6 5 4
// 0 0 0 Unknown1
// 0 0 1 International number2
// 0 1 0 National number3
// 1 1 1 Reserved for extension
// Bits 3 2 ...
|
|
| 作者:不祥 bluejoe张贴于2004-04-25 11:15:41.0,共阅读10719次,回复6次 |
|
|
 |
简单的错误
|
|
| |
| #include "sting.h"
#include "stdafx.h"
#include <stdio.h>
void main( void )
{
char string[80];
strcpy( string, "Hello world from " );
strcat( string, "strcpy " );
strcat( string, "and " );
strcat( string, "strcat!" );
printf( "String = %s\n", string );
}
编译后出现:
E:\vcprogram\test1\test1.cpp(11) : error C2065: ’strcpy’ : undeclared identifier E:\vcprogram\test1\test1.cpp(12) : error C2065: ’strcat’ : undeclared identifier
|
|
| 作者:vcstudy study张贴于2007-07-27 15:42:04.0,共阅读1724次,回复3次 |
|
|