恩,系列开的不错!很多的都欠缺这方面的!希望继续,共同进步!
re: 远程调试技术-使用vs2005 梦在天涯 2008-07-29 22:09
好东东!
re: Vista的新控件 梦在天涯 2008-07-23 22:02
支持C++了吗?那真是太好了啊!
VA装了以后2008老是crash啊,真是受不了啊
// convert_string_to_wchar.cpp
// compile with: /clr
#include < stdio.h >
#include < stdlib.h >
#include < vcclr.h >
using namespace System;
int main() {
String ^str = "Hello";
// Pin memory so GC can't move it while native function is called
pin_ptr<const wchar_t> wch = PtrToStringChars(str);
printf_s("%S\n", wch);
// Conversion to char* :
// Can just convert wchar_t* to char* using one of the
// conversion functions such as:
// WideCharToMultiByte()
// wcstombs_s()
// ... etc
size_t convertedChars = 0;
size_t sizeInBytes = ((str->Length + 1) * 2);
errno_t err = 0;
char *ch = (char *)malloc(sizeInBytes);
err = wcstombs_s(&convertedChars,
ch, sizeInBytes,
wch, sizeInBytes);
if (err != 0)
printf_s("wcstombs_s failed!\n");
printf_s("%s\n", ch);
}
// convert_system_string.cpp
// compile with: /clr
#include <string>
#include <iostream>
using namespace std;
using namespace System;
void MarshalString ( String ^ s, string& os ) {
using namespace Runtime::InteropServices;
const char* chars =
(const char*)(Marshal::StringToHGlobalAnsi(s)).ToPointer();
os = chars;
Marshal::FreeHGlobal(IntPtr((void*)chars));
}
void MarshalString ( String ^ s, wstring& os ) {
using namespace Runtime::InteropServices;
const wchar_t* chars =
(const wchar_t*)(Marshal::StringToHGlobalUni(s)).ToPointer();
os = chars;
Marshal::FreeHGlobal(IntPtr((void*)chars));
}
int main() {
string a = "test";
wstring b = L"test2";
String ^ c = gcnew String("abcd");
cout << a << endl;
MarshalString(c, a);
c = "efgh";
MarshalString(c, b);
cout << a << endl;
wcout << b << endl;
}
re: @转C++/CLI学习方法 梦在天涯 2008-07-13 17:19
CLIC++在实际的使用中并不多用,就我们的实际开发中唯一要使用这个的地方就是实现C++和C#语言的互调!
作为初学者,我觉的没有必要研究,精通一门语言就最重要的啊!
CLIC++其实就是C++加C#,实现了既可以调用底层系统API,也可以使用。net framework提供大量的库。但是以前的2门语言,现在一门要实现,那自然语法什么都有些复杂,也难免有点别扭,所以这也正是很多的C++和C#的开发者都不愿意去学习CLIC++。
以前没有CLIC++的时候,我们都是从C++转向C#,现在有了CLIC++以后,如果想要使用。net framework就可以从C++扩展到CLIC++,多了一个选择!
我的blog上也有一些相关的资料,如果有学习者,欢迎交流与我!~
re: MFC实训中的一些问题记录(1) 梦在天涯 2008-07-12 18:12
哈哈,中软怎么好好啊,没有看出来啊
re: 针对LFN的TCP窗口扩大因子 梦在天涯 2008-07-11 20:03
窗口的概念比较抽象哦!
re: 不用DIB将位图读入CBitmap 梦在天涯 2008-07-11 20:00
恩,需要了解bmp的存储结构啊!
re: 转@verify和assert的区别 梦在天涯 2008-07-11 19:58
但是实际的开发过程中,好像没有用过verify!
关于liunx kerne有什么好书,推荐一个,谢谢先啊!
能不能说下,书的全名,说是chinapub的连接!谢谢先!
看了你的第一张就知道是好书了,谢谢,以前没有看过啊,要是有的化,给大家个地址,大家保证更高兴啊!
可以去这里啊~~~
ftp://sourceforge.nchc.org.tw/
这个ftp超强啊,不会是sf上所有的源代码把!
en,现在这个世道真是的,很多的国外的blog不可以访问啊,很郁闷啊
,不过可以用代理啊,
用inlineproxy也可以!
但是要下载的话,不知道有没有其他的好方法啊!
re: 有关一个Redo和Undo的一个框架 梦在天涯 2008-07-10 23:02
好东东!超有用啊!
如果更模块化下会更好啊,以后让大家都可以用哦!
TlsObject<***> 这个东东哪里来的那,TLS倒是蛮好用的哦!
http://www.cppblog.com/mzty/archive/2007/08/01/28892.html
哦,近来我们CPP博客的技术含量都很高啊,像大家学习!
en ,很好啊,看了这个就知道脚本的运行原理了,java,.net也很类似哦!
写的非常的好,希望继续啊!
re: C++随笔分类列表(基础) 梦在天涯 2008-06-24 08:55
@cppexplore 你做的东东,你可以发到首页,他来的时候就看到了哦!
re: C++随笔分类列表(基础) 梦在天涯 2008-06-24 08:51
@yun
你可真的是遇到大好人了啊,一定要谢谢ss了啊!
其实要是让我做的画,我对这个方面的还不是很熟啊!
@ss thanks ss!
re: 职业之路 梦在天涯 2008-06-18 12:12
支持!
平时用C++ builder的吗,主要是做什么类型的项目的哦?
re: 判断拓扑结构的具体类型 梦在天涯 2008-06-17 16:03
我也是做AutoCAD的,对你的AnyCAD很感兴趣哦,哈哈,希望做个朋友,有更多的交流!
可以加我的msn: mzty999@hotmail.com
re: 技术人员,你的表达能力怎么样? 梦在天涯 2008-06-10 09:30
我也是经常都很紧张啊,所以以后要多学习啊
re: 关于系统设计 梦在天涯 2008-06-05 17:11
比喻的太好了啊!
VIM是装ub,linuix的哪个吗?
sybian是手机操作系统,那这里的debian又是啥东东那?
re: Google App Engine! 梦在天涯 2008-06-05 17:06
还是没有很好的概念对这个东东~
re: c++类库参考 梦在天涯 2008-06-05 17:03
上面说的是www.Cppreference.com
其实还有一个www.cplusplus.com 更好些!
re: 08年06月04日 梦在天涯 2008-06-05 17:01
o 知道有这个功能,原来是这么调啊!thanks
re: 在AI的最后一个早晨 梦在天涯 2008-05-30 13:11
祝新工作顺利!
更上一层!
re: 函数指针实例 梦在天涯 2008-05-23 14:14
another samples:
#include "stdafx.h"
class Object;
typedef int (Object::*MemFuncPtr)(int, int);
typedef int (*StaticMemFuncPtr)(int, int);
class Object
{
public:
// non-static member
int Add(int iFirst, int iSecond)
{
return iFirst + iSecond;
}
// static member
static int Sub(int iFirst, int iSecond)
{
return iFirst - iSecond;
}
//
typedef int (Object::*InClassMemFuncPtr)(int, int);
typedef int (*InClassStaticMemFuncPtr)(int, int);
};
int _tmain(int argc, _TCHAR* argv[])
{
// Test non-static Add
//
MemFuncPtr pfnMemFunc = &Object::Add;
// Need to bind the member function to a instance (need a this pointer)
Object test;
int res = (test.*pfnMemFunc)(1, 3);
// function call missing argument list; use '&Object::Add' to create a pointer to member
//MemFuncPtr pfnMemFunc1 = test.Add;
//res = (test.*pfnMemFunc1)(1, 3);
Object::InClassMemFuncPtr pfnMemFunc2 = &Object::Add;
res = (test.*pfnMemFunc2)(1, 3);
// Test Static Sub
//
// cannot convert from 'int (__cdecl *)(int,int)' to 'MemFuncPtr'
// Object::Sub Calling convention is __cdecl, but Object::*MemFuncPtr should be thisCall
// function signature include calling convention, parameter list and return value..
//pfnMemFunc = Object::Sub;
//res = (test.*pfnMemFunc)(1, 3);
StaticMemFuncPtr pfnStaticMemFunc = Object::Sub;
res = (*pfnStaticMemFunc)(1, 3);
StaticMemFuncPtr pfnStaticMemFunc1 = &Object::Sub;
res = (*pfnStaticMemFunc1)(1, 3);
Object::InClassStaticMemFuncPtr pfnStaticMemFunc2 = &Object::Sub;
res = (*pfnStaticMemFunc2)(1, 3);
// stl ? how to use this “function pointer”???
//std::mem_fun<int, Object>(&Object::Add);
//std::mem_fun<int, Object>(&Object::Sub);
return 0;
}
re: 函数指针实例 梦在天涯 2008-05-23 12:33
成员函数指针:
#include "stdafx.h"
class CMemFuncPtr;
typedef int (CMemFuncPtr::*MemFuncPtr)(int, int);
class CMemFuncPtr
{
public:
int Add(int iFirst, int iSecond)
{
return iFirst + iSecond;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
MemFuncPtr pfnMemFunc = &CMemFuncPtr::Add;
CMemFuncPtr test;
(test.*pfnMemFunc)(1, 3);
return 0;
}
re: 服务器迁移预告 梦在天涯 2008-05-19 09:46
恩,现在的速度超快 啊,感谢dudu!
re: 学生时代做的东西-留个纪念 梦在天涯 2008-05-14 12:51
高手中的高手哦!
re: C++拷贝构造函数的几个细节 梦在天涯 2008-05-12 09:00
@张某某
就想一般的函数重载一样啊,你没有重载那个版本的,你就不能用哦!
haha,这个targetver.h只有在08才有的把!
re: 试试看博客园的blog~ 梦在天涯 2008-04-29 17:59
haha ,csdn slow!
re: 谈谈C/C++和.NET以后的走向 梦在天涯 2008-04-28 09:16
非常同意,学习了C++,其他的easy!
re: 谈谈C/C++和.NET以后的走向 梦在天涯 2008-04-28 09:12
haha,现在的工作用C+++C#,觉得这连个可以了应该吃饭没有问题把!
re: 调试经验总结-VC下的错误对话框 梦在天涯 2008-04-25 11:38
chao hao !
高手一个啊!