Click here to Skip to main content
16,016,076 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can I get the path of the executed program in this program? Pin
Nish Nishant24-May-02 15:14
sitebuilderNish Nishant24-May-02 15:14 
GeneralRe: How can I get the path of the executed program in this program? Pin
Joao Vaz24-May-02 20:15
Joao Vaz24-May-02 20:15 
GeneralRe: How can I get the path of the executed program in this program? Pin
27-May-02 10:49
suss27-May-02 10:49 
AnswerRe: How can I get the path of the executed program in this program? Pin
Alexandru Savescu24-May-02 12:43
Alexandru Savescu24-May-02 12:43 
GeneralWatch Window Formatting Pin
Mark Donkers24-May-02 3:16
Mark Donkers24-May-02 3:16 
GeneralRe: Watch Window Formatting Pin
Martin Ziacek24-May-02 4:16
Martin Ziacek24-May-02 4:16 
GeneralRe: Watch Window Formatting Pin
Mark Donkers24-May-02 4:23
Mark Donkers24-May-02 4:23 
GeneralAccess violation in clistctrl Pin
SnapRick24-May-02 2:51
SnapRick24-May-02 2:51 
I get the following error "First-chance exception in iss.exe (KERNEL32.DLL): 0xC0000005: Access Violation." with the code below at the statement mlist.GetColumn(i, &lvc);. Could anyone tell me why, I tried a lot of things but I cannot find a cause? Below is the code:

void CAdjustHeaderColumns::SaveColumnHeadingDefaultInfo(CString mCName, CListCtrlEx &mlist)
{
CRegKey reg;
CString g_registry;
g_registry.Format("%s%s", REG_ROOTDIR, COLDIR);
CNewHeaderCtrl* pHeader = (CNewHeaderCtrl*) mlist.GetDlgItem(0);
ASSERT(pHeader);
ASSERT(mlist);
int nMaxHLen = 100;
int mCount = mlist.GetColumnCount();
CString Caption;
CString mNum;
CString mWidth;
CString mCaption;
CString mPrevCaption;
mPrevCaption = "InitialStartUp";
LV_COLUMN lvc;

// Get the Column Info and fill the HDITEM structure
HDITEM HdItem;
HdItem.mask = HDI_TEXT;
HdItem.pszText = Caption.GetBuffer(nMaxHLen);
HdItem.cchTextMax = nMaxHLen;

// Save the default column information to the registry
for (int i = 0; i < mCount; i++)
{
mNum.Format("%d", i);
pHeader->GetItem(i, &HdItem);
mlist.GetColumn(i, &lvc); <--- error occurs here
mWidth.Format("%d", mlist.GetColumnWidth(i) );

m_dpos.Format("%sHDP%d", mCName, i);
m_dwdth.Format("%sHDW%d", mCName, i);
m_dtext.Format("%sHDT%d", mCName, i);

mCaption.Format("%s", Caption);
if (mCaption == mPrevCaption)
mCaption += "2";

if (reg.Open(HKEY_CURRENT_USER, g_registry) == ERROR_SUCCESS)
{
reg.Write(m_dpos, mNum);
reg.Write(m_dwdth, mWidth);
reg.Write(m_dtext, mCaption);
mPrevCaption = mCaption;
}
}
Caption.ReleaseBuffer();
}


Thank-you
Sincerely,
RAH
GeneralRe: Access violation in clistctrl Pin
Joaquín M López Muñoz24-May-02 4:04
Joaquín M López Muñoz24-May-02 4:04 
GeneralRe: Access violation in clistctrl Pin
SnapRick24-May-02 4:27
SnapRick24-May-02 4:27 
GeneralUsing external Members Pin
laphijia24-May-02 2:43
laphijia24-May-02 2:43 
GeneralRe: Using external Members Pin
Alexandru Savescu24-May-02 3:35
Alexandru Savescu24-May-02 3:35 
GeneralRe: Using external Members Pin
laphijia24-May-02 3:59
laphijia24-May-02 3:59 
GeneralRe: Using external Members Pin
Joaquín M López Muñoz24-May-02 3:58
Joaquín M López Muñoz24-May-02 3:58 
GeneralRe: Using external Members Pin
laphijia24-May-02 6:39
laphijia24-May-02 6:39 
GeneralHolding pointers to functions as values in a std::map Pin
Alexandru Savescu24-May-02 2:43
Alexandru Savescu24-May-02 2:43 
GeneralRe: Holding pointers to functions as values in a std::map Pin
Chris Losinger24-May-02 3:03
professionalChris Losinger24-May-02 3:03 
GeneralRe: Holding pointers to functions as values in a std::map Pin
Alexandru Savescu24-May-02 3:13
Alexandru Savescu24-May-02 3:13 
GeneralI'm doing similar but why won't work Pin
24-May-02 3:45
suss24-May-02 3:45 
GeneralRe: I'm doing similar but why won't work Pin
Joaquín M López Muñoz24-May-02 3:54
Joaquín M López Muñoz24-May-02 3:54 
GeneralRe: I'm doing similar but why won't work Pin
24-May-02 4:39
suss24-May-02 4:39 
GeneralRe: Holding pointers to functions as values in a std::map Pin
Vivek Rajan24-May-02 7:54
Vivek Rajan24-May-02 7:54 
GeneralChange scrollbar colour Pin
Nnamdi Onyeyiri24-May-02 1:23
Nnamdi Onyeyiri24-May-02 1:23 
QuestionMath and 3d books ? Pin
Joao Vaz24-May-02 1:04
Joao Vaz24-May-02 1:04 
AnswerRe: Math and 3d books ? Pin
jan larsen24-May-02 2:56
jan larsen24-May-02 2:56 

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.