Click here to Skip to main content
15,891,721 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VC 2008 problem Pin
peterchen10-May-10 2:19
peterchen10-May-10 2:19 
GeneralRe: VC 2008 problem Pin
Tim Craig10-May-10 10:04
Tim Craig10-May-10 10:04 
GeneralRe: VC 2008 problem Pin
Abin10-May-10 15:57
Abin10-May-10 15:57 
Questiondata between forms sdi Pin
hellogany9-May-10 20:05
hellogany9-May-10 20:05 
AnswerRe: data between forms sdi Pin
Cedric Moonen9-May-10 20:21
Cedric Moonen9-May-10 20:21 
AnswerRe: data between forms sdi Pin
KarstenK9-May-10 21:31
mveKarstenK9-May-10 21:31 
QuestionHow to load swf from resources Pin
rahul.kulshreshtha9-May-10 19:49
rahul.kulshreshtha9-May-10 19:49 
AnswerRe: How to load swf from resources Pin
Stuart Dootson9-May-10 21:40
professionalStuart Dootson9-May-10 21:40 
You can get a resource into memory (as if you'd read it from a file) like this:

std::vector<BYTE> LoadFileFromResource(HINSTANCE hmodResource, LPCTSTR name, LPCTSTR type)
{
   if (!type)
      type = ::PathFindExtension(name) + 1;
   HRSRC rsrcFile = ::FindResource(hmodResource, name, type);
   if (!rsrcFile) return std::vector<BYTE>();
   HGLOBAL gblFile = ::LoadResource(hmodResource, rsrcFile);
   if (!gblFile) return std::vector<BYTE>();
   DWORD sizeFile = ::SizeofResource(hmodResource, rsrcFile);
   if (!sizeFile) return std::vector<BYTE>();
   LPVOID filePointer = ::LockResource(gblFile);
   if (filePointer)
   {
      return std::vector<BYTE> contents((BYTE*)filePointer, sizeFile);
      ::FreeResource(gblFile);
      return contents;
   }
   return return std::vector<BYTE>();
}


I take a copy of it here, to make resource management easier, but you don't have to do that...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

CodeProject MVP for 2010 - who'd'a thunk it!

AnswerRe: How to load swf from resources Pin
peterchen10-May-10 2:21
peterchen10-May-10 2:21 
QuestionWindowFromPoint and layered windows Pin
Code-o-mat9-May-10 7:07
Code-o-mat9-May-10 7:07 
AnswerRe: WindowFromPoint and layered windows Pin
Randor 9-May-10 9:42
professional Randor 9-May-10 9:42 
GeneralRe: WindowFromPoint and layered windows Pin
Code-o-mat9-May-10 10:21
Code-o-mat9-May-10 10:21 
GeneralRe: WindowFromPoint and layered windows Pin
Randor 9-May-10 11:24
professional Randor 9-May-10 11:24 
GeneralRe: WindowFromPoint and layered windows Pin
Code-o-mat9-May-10 11:36
Code-o-mat9-May-10 11:36 
GeneralRe: WindowFromPoint and layered windows Pin
Randor 9-May-10 12:44
professional Randor 9-May-10 12:44 
GeneralRe: WindowFromPoint and layered windows [modified] Pin
Code-o-mat9-May-10 23:05
Code-o-mat9-May-10 23:05 
QuestionSystem Time Zone Pin
john56329-May-10 6:45
john56329-May-10 6:45 
AnswerRe: System Time Zone Pin
Software_Developer9-May-10 7:46
Software_Developer9-May-10 7:46 
AnswerRe: System Time Zone Pin
Randor 9-May-10 9:21
professional Randor 9-May-10 9:21 
QuestionAfx.h / Win32 Pin
Fareed Rizkalla8-May-10 11:34
Fareed Rizkalla8-May-10 11:34 
AnswerRe: Afx.h / Win32 Pin
Garth J Lancaster8-May-10 13:25
professionalGarth J Lancaster8-May-10 13:25 
GeneralRe: Afx.h / Win32 Pin
Fareed Rizkalla8-May-10 16:15
Fareed Rizkalla8-May-10 16:15 
AnswerRe: Afx.h / Win32 Pin
Stephen Hewitt8-May-10 20:59
Stephen Hewitt8-May-10 20:59 
QuestionLocalization for languages using XML Pin
punyah20108-May-10 9:02
punyah20108-May-10 9:02 
AnswerRe: Localization for languages using XML Pin
CPallini8-May-10 9:53
mveCPallini8-May-10 9:53 

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.