home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Houseplan Collection
/
HRCD2005.ISO
/
data1.cab
/
Zusatz
/
3DS
/
DATA2.Z
/
ObjectListDlg.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1998-10-02
|
2KB
|
87 lines
// ObjectListDlg.cpp : implementation file
//
#include "stdafx.h"
#include "oem.h"
#include "ObjectListDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CObjectListDlg dialog
CObjectListDlg::CObjectListDlg(CWnd* pParent, IArCon *pArCon)
: CDialog(CObjectListDlg::IDD, pParent)
{
m_pArCon = pArCon;
//{{AFX_DATA_INIT(CObjectListDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CObjectListDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CObjectListDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CObjectListDlg, CDialog)
//{{AFX_MSG_MAP(CObjectListDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CObjectListDlg message handlers
// Demo: alle Stings in der Schnittstelle sind OLE-Strings (deklariert als BSTR),
// also UNICODE-Strings. Die einfachste Variante der Umwandlung von und in ASCII
// Strings bieten die ATL-Textkonvertierungsmakros. Dazu ist in StdAfx.h ein
// entsprechendes include einzufⁿgen und in StdAfx.cpp ein include der Implementierung.
BOOL CObjectListDlg::OnInitDialog()
{
CDialog::OnInitDialog();
USES_CONVERSION;
CListBox * list = (CListBox *)GetDlgItem(IDC_NAME_LIST);
int tab = 50;
list->SetTabStops(1, &tab);
list->ResetContent();
IObject3DCollection * dieInstanzen;
IObject3D * derWuerfel;
long i, num;
m_pArCon->get_DesignObjects(&dieInstanzen);
dieInstanzen->get_Count(&num);
for (i = 1; i <= num; i++) {
dieInstanzen->Item(i, &derWuerfel);
BSTR name;
derWuerfel->get_Name(&name);
LPCTSTR tName = OLE2T(name);
SysFreeString(name);
CString line;
line.Format("%d\t%s", i, tName);
list->AddString(line);
derWuerfel->Release();
}
dieInstanzen->Release();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}