StereoPlus.cpp
资源名称:estereo2.zip [点击查看]
上传用户:fengshi120
上传日期:2014-07-17
资源大小:6155k
文件大小:3k
源码类别:
3D图形编程
开发平台:
C/C++
- // StereoPlus.cpp : Defines the class behaviors for the application.
- //
- #include "stdafx.h"
- #include "StereoPlus.h"
- #include <GdiPlus.h>
- #include "3DWindow.h"
- #include "StereoPlusDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- using namespace Gdiplus;
- // CStereoPlusApp
- BEGIN_MESSAGE_MAP(CStereoPlusApp, CWinApp)
- ON_COMMAND(ID_HELP, CWinApp::OnHelp)
- END_MESSAGE_MAP()
- ULONG_PTR gdiplusToken;
- GdiplusStartupInput gdiplusStartupInput;
- // CStereoPlusApp construction
- CStereoPlusApp::CStereoPlusApp()
- {
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
- }
- // The one and only CStereoPlusApp object
- CStereoPlusApp theApp;
- // CStereoPlusApp initialization
- BOOL CStereoPlusApp::InitInstance()
- {
- // InitCommonControls() is required on Windows XP if an application
- // manifest specifies use of ComCtl32.dll version 6 or later to enable
- // visual styles. Otherwise, any window creation will fail.
- InitCommonControls();
- CWinApp::InitInstance();
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need
- // Change the registry key under which our settings are stored
- // TODO: You should modify this string to be something appropriate
- // such as the name of your company or organization
- SetRegistryKey(_T("Gary Gray & David Demirdjian Software"));
- GdiplusStartup(&gdiplusToken,&gdiplusStartupInput,NULL);
- C3DWindow::Register();
- CStereoPlusDlg dlg;
- m_pMainWnd = &dlg;
- INT_PTR nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with OK
- }
- else if (nResponse == IDCANCEL)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with Cancel
- }
- // Since the dialog has been closed, return FALSE so that we exit the
- // application, rather than start the application's message pump.
- return FALSE;
- }
- double CStereoPlusApp::GetProfileDouble(LPCTSTR lpszSection, LPCTSTR lpszEntry, double x)
- {
- CString Result;
- char buf[64];
- sprintf(buf, "%lg", x);
- Result = theApp.GetProfileString(lpszSection, lpszEntry, buf);
- sscanf(Result, "%lf", &x);
- return x;
- }
- BOOL CStereoPlusApp::WriteProfileDouble(LPCTSTR lpszSection, LPCTSTR lpszEntry, double x)
- {
- CString temp;
- temp.Format("%lg", x);
- return theApp.WriteProfileString(lpszSection, lpszEntry, temp);
- }