
安装好之后问题又来了,我的PS/2键盘右不能用了!上网查,最后把鼠标也换成PS/2口的,搞定!
看看hello world吧

现在这篇blog也是在Mac下面发表的,哈哈
世界尽在掌握
Article ID | : | 309801 |
Last Review | : | January 9, 2006 |
Revision | : | 3.0 |
typedef ATL::CStringT< wchar_t, StrTraitMFC< wchar_t > > CStringW;
typedef ATL::CStringT< char, StrTraitMFC< char > > CStringA;
typedef ATL::CStringT< TCHAR, StrTraitMFC< TCHAR > > CString;
template class __declspec(dllimport) CStringT<TCHAR, StrTraitMFC<TCHAR, ChTraitsCRT<TCHAR> > >;
template class __declspec(dllimport) CSimpleStringT<TCHAR>;
1. | In Visual C++ 2005 or in Visual C++ .NET, create a default MFC DLL project. | ||||||||
2. | On the Project menu, click Add New Item. | ||||||||
3. | Name the file MyString.h. Select the Header File template, and then click Open. Note In Visual Studio 2005, click Add instead of Open. | ||||||||
4. | Add the following code to MyString.h:
| ||||||||
5. | Add a new C++ source file to the project named MyString.cpp. | ||||||||
6. | Add the following code to MyString.cpp:
| ||||||||
7. | Save and build the DLL project. | ||||||||
8. | Create a new Win32 Project. In the wizard, change the setting under Application Settings to the Console Application type, and then click to select the MFC checkbox to add MFC support. | ||||||||
9. | In the new application's main source file, include MyString.h from the DLL project. Verify that the correct full path or relative path is being used. | ||||||||
10. | Before the main function, add a #pragma to link to the library for the DLL (again, be sure to use a correct full path or relative path), as follows:
| ||||||||
11. | Add the following code in the else block of the main function:
Note In Visual C++ 2005, you must add the common language runtime support compiler option (/clr:oldSyntax) to successfully compile the previous code sample. To add the common language runtime support compiler option, follow these steps:
For more information about common language runtime support compiler options, visit the following Microsoft Developer Network (MSDN) Web site: http://msdn2.microsoft.com/en-us/library/k8d11d4s.aspx (http://msdn2.microsoft.com/en-us/library/k8d11d4s.aspx) | ||||||||
12. | Build the project. The build fails with the "LNK2019" error. | ||||||||
13. | In the console application, add a new C++ source file named Simple.cpp. | ||||||||
14. | Add the following code to Simple.cpp:
| ||||||||
15. | Build the project again. You receive the "LNK2005" and "LNK1169" error messages. | ||||||||
16. | Apply the solution provided in the "Resolution" section of this article. The project should now build without errors. |
Forum Nokia 宣布将在2008年逐渐放弃CodeWarrior作为Symbian平台开发工具,最终转移到Carbide C++。到此,Nokia终于结束开发工具依赖第三方公司产品的局面(Carbide虽然是基于Eclips,但是这个是开源的)
摘抄自
http://www.newlc.com/inside-cbase-class-six-essential-questions
如果你可以回答下面的6个问题,那么你可以不用看这篇文章了
下面是这6个问题的答案:
CTest* CTest::NewLC()
{
CTest* self = new ( ELeave ) CTest;
CleanupStack::PushL( self );
self->ConstructL()
return self;
}
void CTest::ConstructL()
{
iPointer = CMustLeave::NewL(); // assume this leaves
}
CTest::~CTest()
{
if( iPointer )
{
delete iPointer;
iPointer = NULL;
}
}
如果iPointer没有初始化为NULL,则通过Cleanup Stack析构时可能导致程序崩溃。
CBase* pointer = new ( ELeave ) CBase;
CBase base = *pointer; // call copy constructor
编译器会报错
CBase* pointer = new ( ELeave ) CBase;
CBase base;
base = *pointer; // call operator =
这样防止的不被注意的浅拷贝问题,如果需要一个深拷贝函数,可以实现一个自己的public克隆函数例如CloneL()