Title, Topic

Programmieren: PL, SQL und MFC (Page 5).doc

®
Page 5 of 5
[1] [2] [3] [4] [5]
Faculty
Information Science
Discipline
Information Technology / Computer Science
Document category
Notes
University, School
HTL Villach
Additional information
1997
Responsible User
This text has been add by user odom273 on 2008-10-03. Disclaimer
Popularity
1.153  visits
Document length
~3.883  Words
~26.137  Chars
Rating
Networking




















More documents
Information Technology / Computer Science

System und Einsatzplanung, Windows im Netz
Windows im Netz Wiederholung Intel Prozessoren 8086/88 80286 80386/SX 386/486 Pentium Pentium 2 Datenformat 16 16 32 32 64 64 Datenbusbreite 16/8 16 16

Dialog-Ressource View – Object Zuordnung mit classWizzard


Name Cstring m_strName;

Hello World

Edit Steuerelement über Memberfunktionen

IDC-Name GetDocument()->GetName

Doc Object GetDocument()->SetName

Cstring m_strName_aus_Tab

UpdateData()

ODBC oder Serialize

OnUpdate( )

{

m_strName=GetDocument()àGetName();

UpdateData(FALSE); à neuer Name erscheint im Edit Feld;

}

in .h

//{{AFX_DATA(CxxView)

enum{IDD=IDDxxFORM};

Cstring m_srtName;

//}}AFX_DATA

virtual void DoDataExchange(CDataExchange *pDx);

in .cpp

Constructor:

CxxView::CxxView():CformView(CxxView::IDD)

//{{AFX_DATA_INIT(CxxView)

m_strName = _T(„“);

//}}AFX_DATA_INIT

void CxxView::DoDataExchange(.. *)

{

CformView::DoDataExchange(pDx);

//{{ AFX_DATA_MAP (CxxView)

DDX_Text(pDX,IDC_NAME,m_strName)

//}} AFX_DATA_MAP

}

OnDblclkBehandlungen( )

{

ClistBox *plB=....

pLBà GetTExt(pLBà GetCurSel( ), m_pSelectData);

Cod01Dlg myDlg(this);

if (myDlg.DoModal()==IDOK)

{ //Daten des Dialoges in Doc übertragen

und ODBC Funktion aufrufen

GetDocument()à StoreData();

}

ODBC und MFC Klassen

Cdatabase

Crecordset

Doc


Cdatabase m_db

Recordset

m_pSet Data

Patienten

Behandlung

Verordnet

Leistung

RFX – Mechanismus

 

Void DoFieldExchange( CFieldExchange * pFX)

Void SetFieldType( UINT nFieldType)

 

 

This paragraph has been concealed!
Download the complete document for free!
Programmieren: PL, SQL und MFC.doc
• Click on download to get complete and readable text
• This is a free of charge document sharing network
• First upload your own document, and you get a word document per email
• No registration necessary, gratis
Swap homeworks and notes at no charge!
Gratis scripts for students and pupils!

Objekte à Container à Serialize

Collection-Klasse COb List

Collection, Container, Zusammenfassung von Objekten

à Arrays, Listen, Bäume, Menge..

CobList unterstützt sortierte Listen die Zeiger auf Objekte enthalten die von Cobjekt abgeleitet sind.

Cstudent *pStudent;

CobList myList;

PStudent = new Cstudent(10,“Maier“);

myList.AddTail(pStudent); // am Ende angehängt

Ausgabe der Liste und Liste leeren;

While(!myList.IsEmpty())

{ pStudent=(cStudent*)myList.RemoveHead();

pStudent();

delete pStudent; //liefert Pointer aufs Objekt und gibt Knoten frei

} // Student Objekt muß explizit freigegeben werden

POSITION - Parameter

Aktuelle Position in der Liste

Void* GetNext(POSITION pos)

Liefert einen Pointer auf das Objekt das durch den Position Parameter identifiziert wird und positioniert weiter.

POSITION pos;

pos = myList.GetHeadPosition( )

while( pos )

{ pStudent = (Cstudent*)GetNext(pos);
pStudent->print();

}

void *GetAt(Position pos);

//liefert Pointer aufs Position Objekt

class CStudent:public CObject {

char *Name

int Nr
public:
CStudent(int n, char *p){..}

~CStudent();

print();

};

ListBoxen:

View::FillListe()

{

CPatientSet set(..)

Set.Open();

While(!set.IsEOF())

{

int item = m_PatientnListe.AddString(set.m_Name);

m_PatientenListe.setItemData(item,set.m_ID);

This paragraph has been concealed!
Download the complete document for free!
Programmieren: PL, SQL und MFC.doc
• Click on download to get complete and readable text
• This is a free of charge document sharing network
• First upload your own document, and you get a word document per email
• No registration necessary, gratis
Swap homeworks and notes at no charge!
Gratis scripts for students and pupils!

DBLClick:

{

int item=m_PatientenListe.GetCurSel();

int id=m_PatientenListe.GetItemData(item);

}

Template-bassierte Collection- Klasse

CtypedPtrList

CobList // Collection für gemischte Zeiger

CtypedPtrList // typsicherer Collection

z.B. Collection für Cstudent – zeiger

CtypedPtrList <CObList,CStudent*> m_StudentList;

1 Par: Basisklasse der Collection: CObList

CPtrList( à void*)

2 Parameter: Typ der Parameter und Rückgabewerte der Memberfunktion. (für Objekte die von Cobject abgel. Sind)

typdef CtypePtrList<CobList,Cstudent*>CstudentList;

CstudentList myStudentList;

Template <class Base_Class, class Type>

CtypedPtrList:Base_Class

Serialisierung

Speichern u. Laden von Objekten


Persistentes Objekt

Doc-Objekt


Serialize () Carchive-Objekt Cfile-Objekt


Wird vom Anwendungsrahmen

Bei Datei/öffnen – speichern aufgerufen

Es ist möglich eine direkte File E/A über Cfile durchzuführen:

CreateFile à FileHandle

ReadFile

WriteFile

Gepufferte File E/A über CArchive

Serialisierbare Klassen

Müssen von Cobject abgeleitet sein

Void Cstudent::Serialize(Carchive &ar)

{ if(ar.IsStoring())

ar<<m_strName<<m_nNumber;

else

ar >> m_strName >> m_nNumber;

 

 

 

This paragraph has been concealed!
Download the complete document for free!
Programmieren: PL, SQL und MFC.doc
• Click on download to get complete and readable text
• This is a free of charge document sharing network
• First upload your own document, and you get a word document per email
• No registration necessary, gratis
Swap homeworks and notes at no charge!
Gratis scripts for students and pupils!

Termin für nächsten Tag Objekt x à CTypedPtrList

Vormittag: Elektro

Nachmittag:

Menüpunkt Init à Neu ; Laden, Speichern

Übernehmen à Wünsche in DB speichern TAB:xxx, Wunsch des Vortages
Übernehmen wenn kein Wunsch angegeben

ExecuteSQL(„begin proc() and..

Laufzeitklasseninformation

Runtime Class

RTTI

Makros:

DECLARE_DYNAMIC

IMPLEMENT_DYNAMIC notwendig wenn Laufzeittypinformation benötigt wird.

DECLARE_DYNCREATE

IMPLEMENT_DYNCREATE notwendig wenn neue Objekte angelegt werden

Class person:public Cobject

{ DECLARE_DYNCREATE(person)

}

IMPLEMENT_DYNCREATE (person, CObject)

If (pPerson -> IsKindOf(RUNTIME_CLASS(Person))

..

CruntimeClass *pRTC = RUNTIME_CLASS(person);

CObject* xyz = pRTC->CreateObject();


Page 5 of 5
[1] [2] [3] [4] [5]


swopdoc.com ist not responsible for the content of this text provided by third parties

Legal info - Copyright - Terms - Partner - Statistik - Contact
antiblock.org adblockdetector.com

Swap your documents