Click here to Skip to main content
15,890,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: plz help me out Pin
Owner drawn30-Dec-05 1:36
Owner drawn30-Dec-05 1:36 
Generalits lik dis Pin
whizano30-Dec-05 20:41
whizano30-Dec-05 20:41 
QuestionHow to find whether a cable is connected to USB port? Pin
call_v_s30-Dec-05 1:12
call_v_s30-Dec-05 1:12 
AnswerRe: How to find whether a cable is connected to USB port? Pin
John R. Shaw31-Dec-05 19:14
John R. Shaw31-Dec-05 19:14 
QuestionDynamic adding of controls to CDialog-based class (MFC) Pin
mankeyrabbit30-Dec-05 0:52
mankeyrabbit30-Dec-05 0:52 
AnswerRe: Dynamic adding of controls to CDialog-based class (MFC) Pin
BadKarma30-Dec-05 11:07
BadKarma30-Dec-05 11:07 
QuestionJust a quick one Pin
thes3cr3t130-Dec-05 0:47
thes3cr3t130-Dec-05 0:47 
AnswerRe: Just a quick one Pin
Owner drawn30-Dec-05 1:10
Owner drawn30-Dec-05 1:10 
LPTSTR pszFileText;//this is the buffer

//....Then somewhere else where you are reading in the file content

DWORD dwFileSize;

//reading the file size
dwFileSize = ::GetFileSize(hFile, NULL);

if(dwFileSize != INVALID_FILE_SIZE)
{
   LPTSTR pszFileText;

   //Take note you are allocating memory here
   HGLOBAL hGlobal = ::GlobalAlloc(GPTR, dwFileSize + 1);

   //lock memory
   pszFileText = (LPTSTR)::GlobalLock(hGlobal);
   if(pszFileText != NULL)
   {
      DWORD dwRead;
      if(::ReadFile(hFile, pszFileText, dwFileSize, &dwRead, NULL))
        ;
      //... rest of the code
   }
   //... if you don't need the contents of the file any more do this

   //open the lock :)
   ::GlobalUnlock(hGlobal);

   //free memory allocated
   ::GlobalFree(hGlobal);
}


Jesus Loves You and Me Smile | :)
<marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord


AnswerRe: Just a quick one Pin
Prakash Nadar30-Dec-05 5:06
Prakash Nadar30-Dec-05 5:06 
AnswerRe: Just a quick one Pin
ToxickZero30-Dec-05 9:41
ToxickZero30-Dec-05 9:41 
Questionbackgound processes Pin
Tonichka29-Dec-05 21:35
Tonichka29-Dec-05 21:35 
AnswerRe: backgound processes Pin
Prakash Nadar29-Dec-05 23:05
Prakash Nadar29-Dec-05 23:05 
GeneralRe: backgound processes Pin
Tonichka29-Dec-05 23:22
Tonichka29-Dec-05 23:22 
GeneralRe: backgound processes Pin
Prakash Nadar29-Dec-05 23:27
Prakash Nadar29-Dec-05 23:27 
GeneralRe: backgound processes Pin
Tonichka29-Dec-05 23:34
Tonichka29-Dec-05 23:34 
GeneralRe: backgound processes Pin
Prakash Nadar29-Dec-05 23:41
Prakash Nadar29-Dec-05 23:41 
GeneralRe: backgound processes Pin
Tonichka29-Dec-05 23:53
Tonichka29-Dec-05 23:53 
GeneralRe: backgound processes Pin
Prakash Nadar29-Dec-05 23:55
Prakash Nadar29-Dec-05 23:55 
GeneralRe: backgound processes Pin
Tonichka30-Dec-05 0:09
Tonichka30-Dec-05 0:09 
GeneralRe: backgound processes Pin
Bob Flynn30-Dec-05 2:46
Bob Flynn30-Dec-05 2:46 
GeneralRe: backgound processes Pin
Tonichka30-Dec-05 2:59
Tonichka30-Dec-05 2:59 
GeneralRe: backgound processes Pin
Bob Flynn30-Dec-05 3:16
Bob Flynn30-Dec-05 3:16 
GeneralRe: backgound processes Pin
Prakash Nadar30-Dec-05 4:59
Prakash Nadar30-Dec-05 4:59 
QuestionLocalServer32 from CLSID Pin
Chintoo72329-Dec-05 21:06
Chintoo72329-Dec-05 21:06 
Questionsystem hang.. when application is started executing Pin
Member 227165529-Dec-05 19:55
Member 227165529-Dec-05 19:55 

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.