윈도우 환경이라고 가정하고 답변 드립니다. 개념만 간단히 설명드릴께요..
1. 우선 DLL이나 lib 프로젝트를 만듭니다.
개인적으로는 DLL 프로젝트를 추천합니다
2. 이미 작성된 C++ 소스를 프로젝트에 모두 추가하세요.
그곳에 존재하는 어떤 클래스의 이름을 CppClass라고 가정합니다.
그 클래스에 다음과 같은 인터페이스가 있다고 가정합시다.
ex)
class CppClass
{
public:
void Initialize(); // 객체 초기화
void Finalize(); // 객체 정리
public:
bool Operation(int a); // 어떤 호출하고 싶은 멤버
};
3. 새로운 이름의 소스파일과 헤더파일을 만들어 추가합니다.
여기서는 A.h A.cpp라고 가정합니다.
4. A.cpp에 CppClass의 static 전역객체를 하나 만듭니다.
static CppClass s_myClass;
5. 이 객체에 초기화가 필요하다면 A.cpp에
이 객체를 초기화 시키는 C 함수를 하나 만들어 넣습니다.
ex)
void __cdecl Initialize()
{
s_myClass.Initialize();
}
void __cdecl Finalize()
{
s_myClass.Finalize();
}
6. 이 객체에 호출하고 싶은 함수를 랩핑하는 C함수를 하나 만들어 넣습니다.
int __cdecl WrapperFunc(int a)
{
bool bSuccess = s_myClass.Operation(a);
if(bSuccess)
return 1;
else
return 0;
}
7 A.h 파일에 위 세개의 인터페이스들의 프로토타입을 포함시킵니다.
void __cdecl Initialize();
void __cdecl Finalize();
int __cdecl WrapperFunc(int a);
8. 컴파일하고 링크해서 DLL이나 LIB 파일을 만들어냅니다.
----------------------------------
9. 이제 만들어진 DLL이나 LIB 파일을 사용하는 C 프로젝트를 만듭니다.
10, A.h를 인클루드하고 사용하고 원하는 인터페이스를 호출하면 됩니다.
ex)
Initialize();
WrapperFunc(10);
Finalize();
그럼...
2008년 1월 3일 목요일
2008년 1월 1일 화요일
Setting Up the Environment for Development on Mobile PCs and Tablet PCs
Working with Windows Vista
Obviously, the first thing to do is to install the version of Windows Vista CTP 1. After installing Windows Vista, you must also install the extra drivers for things like wireless, screen rotation, and other hardware-specific actions.
Using Base Mobile PC and Tablet PC features
Next, decide if you want to take advantage of the Windows Presentation Foundation (formerly code-named “Avalon”). If you do not want to take advantage of Windows Presentation Foundation but do want to use features like InkAnalysis, RealTimeStylus, or any of the other mobile PC features mentioned previously, then you need to take the following steps.
Install the MSXML 6.0 Parser
The install for the parser is located on the second PDC DVD – there will be an external link coming soon.
Install Visual Studio 2005 from http://msdn.microsoft.com/trial/
Install the Windows SDK for Microsoft Windows Vista Beta 1, which provides you with a COM version of the mobile PC features.
https://connect.microsoft.com/downloads/downloadDetails.aspx?siteid=4&downloadid;=95
Install the Mobile PC and Tablet PC Software Development Kit September Release, which provides access to the InkAnalysis and COM RealTimeStylus classes.
< http://www.microsoft.com/downloads/details.aspx?FamilyID=b46d4b83-a821-40bc-aa85-c9ee3d6e9699&DisplayLang=en >
If you do decide that you want to add the power of the Windows Presentation Foundation—which enables you to use the InkCanvas element—then you install:
The NET Framework 3.0 (formerly WinFX) Runtime Components Beta 1.
Install the MSXML 6.0 Parser
The install for the parser is located on the second PDC DVD – there will be an external link coming soon.
Visual Studio 2005 from http://msdn.microsoft.com/trial/.
The NET Framework 3.0 (formerly WinFX) SDK for the NET Framework 3.0 Runtime Components September 2005 CTP. This provides access to the InkCanvas object.
Visual Studio Extensions for NET Framework 3.0 (formerly WinFX) Beta1, which provides IntelliSense capabilities for the development with the markup language (code-named "XAML").
http://www.microsoft.com/downloads/details.aspx?FamilyId=45F9BE99-3264-4BF1-8879-78A7A95D9217&displaylang;=en
Mobile PC and Tablet PC Software Development Kit September Release, which provides access to the InkAnalysis and COM RealTimeStylus classes.
source : http://msdn2.microsoft.com/en-us/windowsvista/aa904965.aspx
Obviously, the first thing to do is to install the version of Windows Vista CTP 1. After installing Windows Vista, you must also install the extra drivers for things like wireless, screen rotation, and other hardware-specific actions.
Using Base Mobile PC and Tablet PC features
Next, decide if you want to take advantage of the Windows Presentation Foundation (formerly code-named “Avalon”). If you do not want to take advantage of Windows Presentation Foundation but do want to use features like InkAnalysis, RealTimeStylus, or any of the other mobile PC features mentioned previously, then you need to take the following steps.
Install the MSXML 6.0 Parser
The install for the parser is located on the second PDC DVD – there will be an external link coming soon.
Install Visual Studio 2005 from http://msdn.microsoft.com/trial/
Install the Windows SDK for Microsoft Windows Vista Beta 1, which provides you with a COM version of the mobile PC features.
https://connect.microsoft.com/downloads/downloadDetails.aspx?siteid=4&downloadid;=95
Install the Mobile PC and Tablet PC Software Development Kit September Release, which provides access to the InkAnalysis and COM RealTimeStylus classes.
< http://www.microsoft.com/downloads/details.aspx?FamilyID=b46d4b83-a821-40bc-aa85-c9ee3d6e9699&DisplayLang=en >
If you do decide that you want to add the power of the Windows Presentation Foundation—which enables you to use the InkCanvas element—then you install:
The NET Framework 3.0 (formerly WinFX) Runtime Components Beta 1.
Install the MSXML 6.0 Parser
The install for the parser is located on the second PDC DVD – there will be an external link coming soon.
Visual Studio 2005 from http://msdn.microsoft.com/trial/.
The NET Framework 3.0 (formerly WinFX) SDK for the NET Framework 3.0 Runtime Components September 2005 CTP. This provides access to the InkCanvas object.
Visual Studio Extensions for NET Framework 3.0 (formerly WinFX) Beta1, which provides IntelliSense capabilities for the development with the markup language (code-named "XAML").
http://www.microsoft.com/downloads/details.aspx?FamilyId=45F9BE99-3264-4BF1-8879-78A7A95D9217&displaylang;=en
Mobile PC and Tablet PC Software Development Kit September Release, which provides access to the InkAnalysis and COM RealTimeStylus classes.
source : http://msdn2.microsoft.com/en-us/windowsvista/aa904965.aspx
Reqs for Using VS2005 with .net 3.0 in vista
Visual Studio 2005 Extensions for Windows Workflow Foundation
http://www.microsoft.com/downloads/details.aspx?FamilyId=5D61409E-1FA3-48CF-8023-E8F38E709BA6
Visual Studio 2005 Extensions forWindows Communication Foundation, Windows Presentation Foundation
http://www.microsoft.com/downloads/details.aspx?FamilyId=F54F5537-CC86-4BF5-AE44-F5A1E805680D
http://www.microsoft.com/downloads/details.aspx?FamilyId=5D61409E-1FA3-48CF-8023-E8F38E709BA6
Visual Studio 2005 Extensions forWindows Communication Foundation, Windows Presentation Foundation
http://www.microsoft.com/downloads/details.aspx?FamilyId=F54F5537-CC86-4BF5-AE44-F5A1E805680D
피드 구독하기:
글 (Atom)