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

C / C++ / MFC

 
QuestionRe: Add icon to ListView Pin
David Crow19-Dec-07 4:14
David Crow19-Dec-07 4:14 
GeneralRe: Add icon to ListView Pin
Hamid_RT18-Dec-07 20:12
Hamid_RT18-Dec-07 20:12 
Questionwhy worker thread(non UI ) can't receive message send by PostThreadMessage Pin
CNJXRZ18-Dec-07 18:38
CNJXRZ18-Dec-07 18:38 
GeneralRe: why worker thread(non UI ) can't receive message send by PostThreadMessage Pin
Naveen18-Dec-07 20:54
Naveen18-Dec-07 20:54 
GeneralRe: why worker thread(non UI ) can't receive message send by PostThreadMessage Pin
JudyL_MD19-Dec-07 2:13
JudyL_MD19-Dec-07 2:13 
GeneralRe: why worker thread(non UI ) can't receive message send by PostThreadMessage Pin
Mark Salsbery19-Dec-07 7:05
Mark Salsbery19-Dec-07 7:05 
GeneralWindow TreadId Pin
nitin318-Dec-07 18:28
nitin318-Dec-07 18:28 
AnswerRe: Window TreadId Pin
Lim Bio Liong18-Dec-07 19:05
Lim Bio Liong18-Dec-07 19:05 
Questiona question about event object Pin
zengkun10018-Dec-07 18:28
zengkun10018-Dec-07 18:28 
GeneralRe: a question about event object Pin
JudyL_MD19-Dec-07 2:19
JudyL_MD19-Dec-07 2:19 
GeneralRe: a question about event object Pin
zengkun10019-Dec-07 3:26
zengkun10019-Dec-07 3:26 
GeneralRe: a question about event object Pin
JudyL_MD19-Dec-07 3:41
JudyL_MD19-Dec-07 3:41 
GeneralRe: a question about event object Pin
zengkun10019-Dec-07 3:50
zengkun10019-Dec-07 3:50 
Generalconverting bitmap to gif through MFC Pin
ias118-Dec-07 18:22
ias118-Dec-07 18:22 
Questionconverting bitmap to gif through MFC Pin
ias118-Dec-07 18:20
ias118-Dec-07 18:20 
AnswerRe: converting bitmap to gif through MFC Pin
Paresh Chitte18-Dec-07 18:56
Paresh Chitte18-Dec-07 18:56 
GeneralRe: converting bitmap to gif through MFC Pin
Hamid_RT18-Dec-07 19:27
Hamid_RT18-Dec-07 19:27 
Generalno debug info at program start Pin
subramanyeswari18-Dec-07 17:36
subramanyeswari18-Dec-07 17:36 
QuestionRe: no debug info at program start Pin
Hamid_RT18-Dec-07 19:30
Hamid_RT18-Dec-07 19:30 
GeneralRe: no debug info at program start Pin
subramanyeswari18-Dec-07 19:38
subramanyeswari18-Dec-07 19:38 
QuestionWindows Media Player CLSID for CD or DVD Pin
GrizzlyDoug18-Dec-07 12:22
GrizzlyDoug18-Dec-07 12:22 
QuestionAccess Denied when MapViewOfFile [modified] Pin
eraccn18-Dec-07 4:40
eraccn18-Dec-07 4:40 
The class is used for recording informations which may be massive.In the initialization:
<code><pre>m_qwFileSize = 0x4000000;
m_qwFileOffset = 0;
m_T = 600 * m_siInfo.dwAllocationGranularity;

m_hMappingFile = ::CreateFileMapping(m_hFile,NULL,PAGE_READWRITE,0,m_qwFileSize + sizeof(TCHAR),NULL);

m_lpStartLoc = ::MapViewOfFil(m_hMappingFile,FILE_MAP_ALL_ACCESS,static_cast<dword>(m_qwFileOffset &gt;&gt; 32),static_cast<dword>(m_qwFileOffset & 0xFFFFFFFF),m_dwBytesInBlock);</dword></dword></pre></code>
When the view's size is larger than 60%,I re-mapping the file:
<pre><code>if (m_qwFileOffset &gt;= m_T){
m_T = m_qwFileOffset + 600 * m_siInfo.dwAllocationGranularity;
::UnmapViewOfFile(m_lpStartLoc);

__int64 qwOldFileOffset = m_qwFileOffset;
RndToSysAllocGranularity(m_qwFileOffset);

__int64 qwOffVar = qwOldFileOffset - m_qwFileOffset;

m_lpStartLoc = ::MapViewOfFile
(m_hMappingFile,FILE_MAP_ALL_ACCESS,static_cast<dword>(m_qwFileOffset &gt;&gt;
32),static_cast<dword>(m_qwFileOffset & 0xFFFFFFFF),m_dwBytesInBlock);

PBYTE pByte = reinterpret_cast<pbyte>(m_lpStartLoc);
pByte += qwOffVar;
m_lpStartLoc = pByte;}</pbyte></dword></dword></code></pre>
in the RndToSysAllocGranularity(), I allocate the File offset:

<code><pre__int64 dwremains="dwValue" %="" m_siinfo.dwallocationgranularity;<br="" mode="hold" /> if (dwRemains){
__int64 dwDevided = dwValue / m_siInfo.dwAllocationGranularity;
dwValue = (dwDevided + 1) * m_siInfo.dwAllocationGranularity;}</code>
When it works, I get the errors and its error code is 0x5,it means access denied.Why?
Later buggers harm more.
modified on Tuesday, December 18, 2007 7:57:40 PM
<div class="ForumMod">modified on Tuesday, December 18, 2007 8:08:17 PM</div>
GeneralPlease reformat your post. Pin
CPallini18-Dec-07 4:50
mveCPallini18-Dec-07 4:50 
GeneralRe: Please reformat your post. Pin
eraccn18-Dec-07 14:04
eraccn18-Dec-07 14:04 
GeneralNope. Pin
CPallini18-Dec-07 21:19
mveCPallini18-Dec-07 21:19 

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.