This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern void MyOpen(LPCSTR name); | |
void MyFunc(CStringW name){ | |
MyOpen(CW2A(name)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include "CGetLastError.h" | |
void main() | |
{ | |
// snip | |
SetLastError(111); // create a error 111 (ERROR_BUFFER_OVERFLOW) for demo | |
// Message Box with a text associated to 111(ERROR_BUFFER_OVERFLOW) appears. | |
// In English: "The file name is too long." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LRESULT CKCSSDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) | |
{ | |
if (message == WM_SETCURSOR) { | |
if (HIWORD(lParam) == WM_RBUTTONUP) { | |
CPoint p; | |
GetCursorPos(&p); | |
ScreenToClient(&p); | |
ShowPopupMenu(p); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Updates progress bar | |
void CKCSSDlg::UpdateInfo() | |
{ | |
double mem = m_MemUse; | |
mem = mem / m_MemMax; | |
if (mem > 0.8){ | |
m_CtrlProgressMemory.SetState(PBST_PAUSED); | |
} | |
else if (mem > 0.95) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Updates progress bar and text | |
void CKCSSDlg::UpdateInfo() | |
{ | |
double mem = m_MemUse; | |
mem = mem / m_MemMax; | |
if (mem > 0.9){ | |
m_CtrlProgressMemory.SetState(PBST_ERROR); | |
} | |
else if (mem >= 0.8) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CSettingSave::OnCancel() | |
{ | |
// Empty function to avoid closure by ESC key | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************************************** | |
Name: InfoProgresssCtrl.h | |
Desc: CProgressCtrlに文字情報表示機能を追加. | |
Author: donadona | |
reidphoaさんのInfoProgressBar.hより改変 | |
*********************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// InfoProgressCtrl.cpp : インプリメンテーション ファイル | |
// | |
/* | |
03/08/03 CRgn を用いてクリッピングするようにした | |
3D表示に対応した | |
18/08/29 クラス名をCInfoProgressBarからCInfoProgressCtrlに変更。 | |
CProgressCtrlのバー表示機能を残したまま、上にテキストを表示するよう変更。 | |
独自のバー表示機能は削除。SetColorをSetTxtColorに変更。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Serializable] | |
public class Wheel | |
{ | |
public List<Rigidbody> wheels; | |
public float wheelMass = 600; // mass of each wheel pair without flange mass; i.e. twice the mass of 1 wheel without flange mass | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public float targetVelocity; // target speed of rotation | |
public float torque; // a torque to be applied to each wheel | |
public Wheel wheel; // a group of setting related to wheels | |
// Start is called before the first frame update | |
void Start() | |
{ | |
foreach(Rigidbody rb in wheel.wheels) | |
{ | |
rb.mass = wheel.wheelMass; |