?
Hallo,
Wer hat eine Lösung für mein Problem???
Ich habe die Adresse von der Variable string (somit auch den Inhalt),der Variable wert zugewiesen.
Wie greife ich von einer anderen .cpp,auf diese Variable wert zu,ohne das der Inhalt verloren geht.
Die Funktion in der anderen .cpp lautet:
extern CString *wert;
void CAusgabe::OnInitialUpdate()
{
m_ausgabe.Format("%i",*wert)
SetDlgItemText(IDC_Static,m_ausgabe);
FileView.cpp
[b]static int wert;[/b]
void CFileView::OnGetDispInfo(NMHDR* pNMHDR, LRESULT* pResult)
{
CString string;
LV_DISPINFO* pDispInfo = (LV_DISPINFO*) pNMHDR;
if (pDispInfo->item.mask & LVIF_TEXT)
{
ITEMINFO* pItem = (ITEMINFO*) pDispInfo->item.lParam;
switch (pDispInfo->item.iSubItem)
{
case 0: // Dateiname
::lstrcpy (pDispInfo->item.pszText, pItem->strFileName);
break;
string.Format (_T ("%u"), pItem->nFileSizeLow);
::lstrcpy (pDispInfo->item.pszText, string);
[b] wert = &string;[/b]
break;
case 1: .....
...
...
}
}
}
Gruß Jim35