Click here to Skip to main content
15,898,036 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Access Denied when MapViewOfFile Pin
Nelek18-Dec-07 22:26
protectorNelek18-Dec-07 22:26 
AnswerRe: Access Denied when MapViewOfFile [modified] Pin
G Haranadh14-Nov-11 0:17
G Haranadh14-Nov-11 0:17 
GeneralGetting Events from an embedded HTML viewer control Pin
Dave Calkins18-Dec-07 4:06
Dave Calkins18-Dec-07 4:06 
GeneralRe: Getting Events from an embedded HTML viewer control Pin
led mike18-Dec-07 5:03
led mike18-Dec-07 5:03 
GeneralRe: Getting Events from an embedded HTML viewer control Pin
Dave Calkins18-Dec-07 5:46
Dave Calkins18-Dec-07 5:46 
GeneralRe: Getting Events from an embedded HTML viewer control Pin
led mike18-Dec-07 6:58
led mike18-Dec-07 6:58 
GeneralRe: Getting Events from an embedded HTML viewer control Pin
Paresh Chitte18-Dec-07 18:00
Paresh Chitte18-Dec-07 18:00 
QuestionHow to Create and Load automatically a form type interface Pin
Larry Mills Sr18-Dec-07 3:34
Larry Mills Sr18-Dec-07 3:34 
AnswerRe: How to Create and Load automatically a form type interface Pin
CPallini18-Dec-07 3:48
mveCPallini18-Dec-07 3:48 
GeneralRe: How to Create and Load automatically a form type interface Pin
Larry Mills Sr18-Dec-07 9:07
Larry Mills Sr18-Dec-07 9:07 
AnswerRe: How to Create and Load automatically a form type interface Pin
David Crow18-Dec-07 10:09
David Crow18-Dec-07 10:09 
GeneralRe: How to Create and Load automatically a form type interface Pin
Larry Mills Sr20-Dec-07 13:10
Larry Mills Sr20-Dec-07 13:10 
GeneralRe: How to Create and Load automatically a form type interface Pin
David Crow21-Dec-07 4:13
David Crow21-Dec-07 4:13 
GeneralAudio Capture Before DAC Pin
Saurabh Srivastava18-Dec-07 3:26
Saurabh Srivastava18-Dec-07 3:26 

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.