Click here to Skip to main content
15,909,953 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDrag & Drop Pin
ananth_rs5-Nov-01 6:23
ananth_rs5-Nov-01 6:23 
GeneralRe: Drag & Drop Pin
vgandhi5-Nov-01 11:50
vgandhi5-Nov-01 11:50 
GeneralGDI+ Pin
AJ1235-Nov-01 6:17
AJ1235-Nov-01 6:17 
GeneralRe: GDI+ Pin
Michael Dunn5-Nov-01 6:56
sitebuilderMichael Dunn5-Nov-01 6:56 
GeneralWeird problem Pin
Peter Liddle5-Nov-01 6:00
Peter Liddle5-Nov-01 6:00 
GeneralRe: Weird problem Pin
Carlos Antollini5-Nov-01 6:08
Carlos Antollini5-Nov-01 6:08 
GeneralRe: Weird problem Pin
Mukkie5-Nov-01 9:16
Mukkie5-Nov-01 9:16 
GeneralRe: Weird problem Pin
Peter Liddle5-Nov-01 9:39
Peter Liddle5-Nov-01 9:39 
Right the malloc stuff didn't work. This is really stupid cos all that needs to happen is that one of the class functions writes to a DWORD array and one reads from the dword array.

This is basically whats happening at the moment

this bit declares variables needed in class header and private
<br />
private:<br />
	<br />
	TCHAR sSigners[STRING_LENGTH][MAX_SIGNERS];<br />
	TCHAR sCountSigners[STRING_LENGTH][MAX_SIGNERS];<br />
	DWORD dwCountSigners[MAX_SIGNERS]; <br />
	<br />
<br />
	//CountSign *cCountSigners;//[MAX_SIGNERS];<br />
<br />
	UINT uiNumberOfSigners;	<br />
	UINT uiNumberOfCountSigners;<br />
};<br />


this bit writes data to the TCHAR string and DWORD array
<br />
void CViewSigners::AddCounterSignerToDisplay(TCHAR *psCountSignerName, DWORD dwIndexOfSigCountSigned)<br />
{<br />
	if(uiNumberOfCountSigners == MAX_SIGNERS)<br />
	{<br />
<br />
		TCHAR *psErrorMessage;<br />
		TCHAR *psErrorTitle;<br />
					<br />
		psErrorMessage = new TCHAR[STRING_LENGTH]; <br />
		psErrorTitle = new TCHAR[STRING_LENGTH];<br />
<br />
		LoadString(_Module.GetModuleInstance(), IDS_MAX_CERTS, psErrorMessage, STRING_LENGTH);<br />
		LoadString(_Module.GetModuleInstance(), IDS_CERTERROR_TITLE, psErrorTitle, STRING_LENGTH);<br />
<br />
		MessageBox(psErrorMessage, psErrorTitle, MB_OK | MB_ICONWARNING);<br />
<br />
		delete[] psErrorMessage;<br />
		delete[] psErrorTitle;<br />
	}<br />
	else<br />
	{<br />
		char sTest[10];<br />
		_ultoa(dwIndexOfSigCountSigned ,sTest, 10);<br />
		AfxMessageBox(sTest);<br />
<br />
		strcpy(&sCountSigners[uiNumberOfCountSigners][0], psCountSignerName);<br />
		dwCountSigners[uiNumberOfCountSigners] = dwIndexOfSigCountSigned; <br />
<br />
		uiNumberOfCountSigners++;<br />
	}<br />
<br />
}<br />


this bit reads data from the TCHAR string and DWORD array the bottom for loops the one to look at the top for loop is for a different function that similar but that works fine
<br />
BOOL CViewSigners::OnInitDialog() <br />
{<br />
	CDialog::OnInitDialog();<br />
<br />
<br />
	HTREEITEM hItem[MAX_SIGNERS];<br />
	m_imageList.Create(IDB_SIGNER_TREE, 14, 1, RGB(255,0,0));<br />
	m_tSignersView.SetImageList(&m_imageList, TVSIL_NORMAL);<br />
<br />
	CViewSigners::SetWindowText("Signers");<br />
<br />
		//m_stSignersTitle = _T("File Signed By");<br />
		//UpdateData(FALSE);<br />
<br />
	TCHAR sTempCertName[STRING_LENGTH];<br />
<br />
<br />
	for(int i = 0; i < uiNumberOfSigners; i++)<br />
	{<br />
		hItem[i] = m_tSignersView.InsertItem(&sSigners[i][0], 0, 0);<br />
	}<br />
<br />
<br />
	for(int u = 0; u < uiNumberOfCountSigners; u++)<br />
	{<br />
<br />
		m_tSignersView.InsertItem(&sCountSigners[u][0], 1, 1, hItem[dwCountSigners[i]]);<br />
	<br />
		char sTest[10];<br />
		_ultoa(dwCountSigners[i] ,sTest, 10);<br />
		AfxMessageBox(sTest);<br />
<br />
		m_tSignersView.Expand(hItem[u], TVE_EXPAND );<br />
<br />
		//_strset(sTempCertName, NULL);<br />
	}<br />
<br />
return TRUE;  // return TRUE unless you set the focus to a control<br />
	              // EXCEPTION: OCX Property Pages should return FALSE<br />
<br />
}<br />


peter
GeneralRe: Weird problem Pin
Mukkie5-Nov-01 10:11
Mukkie5-Nov-01 10:11 
GeneralRe: Weird problem Pin
Peter Liddle5-Nov-01 10:19
Peter Liddle5-Nov-01 10:19 
GeneralWindows, wndproc, mouse Pin
#realJSOP5-Nov-01 5:47
professional#realJSOP5-Nov-01 5:47 
GeneralRe: Windows, wndproc, mouse Pin
Remi Morin5-Nov-01 10:27
Remi Morin5-Nov-01 10:27 
GeneralRe: Windows, wndproc, mouse Pin
Christian Graus5-Nov-01 10:34
protectorChristian Graus5-Nov-01 10:34 
GeneralRe: Windows, wndproc, mouse Pin
#realJSOP6-Nov-01 3:04
professional#realJSOP6-Nov-01 3:04 
GeneralRe: Windows, wndproc, mouse Pin
#realJSOP6-Nov-01 3:36
professional#realJSOP6-Nov-01 3:36 
GeneralPrinting graphics with nonstandart brush Pin
5-Nov-01 5:36
suss5-Nov-01 5:36 
GeneralRe: Printing graphics with nonstandart brush Pin
Christian Graus5-Nov-01 10:36
protectorChristian Graus5-Nov-01 10:36 
GeneralPlease Help! Pin
Andrew Stampor5-Nov-01 5:33
Andrew Stampor5-Nov-01 5:33 
GeneralSTL Pin
5-Nov-01 4:58
suss5-Nov-01 4:58 
GeneralRe: STL Pin
Christian Graus5-Nov-01 10:38
protectorChristian Graus5-Nov-01 10:38 
GeneralQuestion about working HKEY_CLASS_ROOT\*\shell\ Pin
CMFC6.0VS.NETUser5-Nov-01 4:46
CMFC6.0VS.NETUser5-Nov-01 4:46 
General-- Tomasz Sowinski -- (or anyone) Pin
Rickard Andersson205-Nov-01 4:42
Rickard Andersson205-Nov-01 4:42 
GeneralRe: -- Tomasz Sowinski -- (or anyone) Pin
Fazlul Kabir5-Nov-01 5:03
Fazlul Kabir5-Nov-01 5:03 
GeneralRe: -- Tomasz Sowinski -- (or anyone) Pin
Remi Morin5-Nov-01 5:06
Remi Morin5-Nov-01 5:06 
GeneralRe: -- Tomasz Sowinski -- (or anyone) Pin
Rickard Andersson205-Nov-01 7:53
Rickard Andersson205-Nov-01 7:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.