Click here to Skip to main content
16,005,682 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WTL::ProgressBarCtrl Question Pin
Ed K20-Jun-02 8:22
Ed K20-Jun-02 8:22 
GeneralLooking for a Graph Control Pin
Jim Crafton18-Jun-02 6:54
Jim Crafton18-Jun-02 6:54 
Generalchar array confusion Pin
Simon Walton18-Jun-02 5:36
Simon Walton18-Jun-02 5:36 
GeneralRe: char array confusion Pin
Chris Losinger18-Jun-02 5:42
professionalChris Losinger18-Jun-02 5:42 
GeneralRe: char array confusion Pin
Simon Walton18-Jun-02 5:45
Simon Walton18-Jun-02 5:45 
GeneralHELP! Catching Events Pin
18-Jun-02 4:36
suss18-Jun-02 4:36 
QuestionVS.NET _bstr_t flawed? Pin
mstephens18-Jun-02 3:47
mstephens18-Jun-02 3:47 
GeneralRelease the memory associated with the element at the head position Pin
Rsh18-Jun-02 3:35
Rsh18-Jun-02 3:35 
I wan to release the memory in CList associated with the element at the head position after reading it. will the RemoveHead() does that? If so, in my application, after reading from the CList, memory usage is not reduced. How to go about it.
Here is the code for reading the CList

void CPLayerApp::ReadFromList()
{
unsigned char data[10],mCnt,mMid;
CMessage* pMess;
CSingleLock singleLock(&m_SyncLock.m_mutex);

CString str="";
while(1)
{
if(m_messList.GetCount() != 0)
{
singleLock.Lock();
pMess = &m_messList.GetAt(m_messList.GetHeadPosition());

mCnt = pMess->m_cnt;
mMid = pMess->m_mid;
pMess->GetData(data);
POSITION pos = m_messList.GetHeadPosition();
m_messList.RemoveHead();
singleLock.Unlock();
if(data[0] == 0x10)
{
str.Format("%0x",data[0]);
AfxMessageBox(str);
break;
}
}
Sleep(200);

}



}


UINT WriteToListThread(LPVOID pParam)
{

CPLayerApp* pPLayerApp = (CPLayerApp*)pParam;

CMessage* pMsg = new CMessage();// = pPLayerApp->m_message;
CMsgList* m_messList = &pPLayerApp->m_messList;
CSyncLock* pSynLock = &pPLayerApp->m_SyncLock;
CSingleLock singleLock(&pSynLock->m_mutex);


unsigned char cnt=3;
unsigned char mid=2;
unsigned char data[14];
data[0]=0x04;
bool bWrite=TRUE;

while(1)
{
if(bWrite)
{
singleLock.Lock();
pMsg->SetValues(cnt,mid,data);
m_messList->AddTail(*pMsg);
singleLock.Unlock();
data[0] += 1;
if(data[0]==0x11)
{
AfxMessageBox("Test");
bWrite=FALSE;
}
}

Sleep(500);
}
return 0;

}

Rsh
GeneralMissing dialog icon in ALT-Tab list Pin
18-Jun-02 2:38
suss18-Jun-02 2:38 
GeneralRe: Missing dialog icon in ALT-Tab list Pin
Mike Nordell18-Jun-02 6:50
Mike Nordell18-Jun-02 6:50 
GeneralRe: Missing dialog icon in ALT-Tab list Pin
18-Jun-02 8:22
suss18-Jun-02 8:22 
GeneralRe: Missing dialog icon in ALT-Tab list (solved) Pin
18-Jun-02 10:04
suss18-Jun-02 10:04 
GeneralRe: Missing dialog icon in ALT-Tab list (solved) Pin
18-Jun-02 10:06
suss18-Jun-02 10:06 
GeneralChanging Windows colors not handled in ownerdraw buttons Pin
18-Jun-02 2:34
suss18-Jun-02 2:34 
GeneralRe: Changing Windows colors not handled in ownerdraw buttons Pin
James R. Twine18-Jun-02 3:10
James R. Twine18-Jun-02 3:10 
GeneralRe: Changing Windows colors not handled in ownerdraw buttons Pin
18-Jun-02 6:08
suss18-Jun-02 6:08 
GeneralCMDIFrameWnd in CMDIChildWnd view Pin
thkoch18-Jun-02 2:27
thkoch18-Jun-02 2:27 
Generalflexgrid woes Pin
yeeeooowww18-Jun-02 2:23
yeeeooowww18-Jun-02 2:23 
GeneralRe: flexgrid woes Pin
Michael P Butler19-Jun-02 1:15
Michael P Butler19-Jun-02 1:15 
GeneralOn dialog box move.... Pin
newneo18-Jun-02 2:02
newneo18-Jun-02 2:02 
GeneralRe: On dialog box move.... Pin
perlmunger19-Jun-02 9:59
perlmunger19-Jun-02 9:59 
GeneralHandling dynamically added toolbar button events... Pin
Mohit Khanna18-Jun-02 1:49
Mohit Khanna18-Jun-02 1:49 
GeneralRe: Handling dynamically added toolbar button events... Pin
dazinith18-Jun-02 4:02
dazinith18-Jun-02 4:02 
GeneralRe: Handling dynamically added toolbar button events... Pin
Mohit Khanna18-Jun-02 4:09
Mohit Khanna18-Jun-02 4:09 
QuestionHow to set IP address on Windows NT/2000? Pin
18-Jun-02 1:17
suss18-Jun-02 1:17 

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.