Click here to Skip to main content
16,012,223 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDLL help - VB/C++ working together Pin
rajdawg25-Aug-03 16:09
rajdawg25-Aug-03 16:09 
GeneralRe: DLL help - VB/C++ working together Pin
Mike Dimmick25-Aug-03 22:35
Mike Dimmick25-Aug-03 22:35 
Generalinclude text file in program Pin
Steve L.25-Aug-03 15:44
Steve L.25-Aug-03 15:44 
GeneralRe: include text file in program Pin
Neville Franks25-Aug-03 18:20
Neville Franks25-Aug-03 18:20 
GeneralRe: include text file in program Pin
Abin25-Aug-03 20:40
Abin25-Aug-03 20:40 
GeneralRe: include text file in program Pin
Steve L.26-Aug-03 4:58
Steve L.26-Aug-03 4:58 
GeneralRe: include text file in program Pin
Blake Miller26-Aug-03 13:53
Blake Miller26-Aug-03 13:53 
GeneralRe: include text file in program Pin
Abin26-Aug-03 14:13
Abin26-Aug-03 14:13 
Well I was just giving the original hoster a rough idea on how to use a custome resource in his application, and of course the sample code were not perfect and he should change it a bit to fit his particular needs if he wants to employe the code pieces.

And yes, the issue you pointed out was existing, I did not address it in my post because I thought it'd better to leave things short and clear... hehe, anyway, we can do this:
DWORD GetResourceSize(UINT nResourceID, LPCTSTR lpResourceType)
{
    HRSRC hRs = ::FindResource(NULL, MAKEINTRESOURCE(nResourceID), lpResourceType);
    return ::SizeofResource(NULL, hRs);
}

Then in our application we should be able to allocate exact amount of memory needed.
// Amount of memory needed, in bytes
DWORD dwMyTextSize = GetResourceSize(MYTEXT, _T("TXT"));
BYTE* pData = new BYTE[dwMyTextSize];
/*Copy the resourse and use it here...*/
delete [] pData;
pData = NULL;


This should be better. Smile | :)
GeneralRe: include text file in program Pin
Braulio Dez26-Aug-03 1:02
Braulio Dez26-Aug-03 1:02 
GeneralDouble data type validation Pin
Anonymous25-Aug-03 14:48
Anonymous25-Aug-03 14:48 
GeneralRe: Double data type validation Pin
Navin25-Aug-03 15:00
Navin25-Aug-03 15:00 
GeneralRe: Double data type validation Pin
Anonymous25-Aug-03 20:20
Anonymous25-Aug-03 20:20 
GeneralRe: Double data type validation Pin
Abin26-Aug-03 3:10
Abin26-Aug-03 3:10 
Generalsetting the application icon at runtime Pin
Jim Crafton25-Aug-03 13:58
Jim Crafton25-Aug-03 13:58 
GeneralRe: setting the application icon at runtime Pin
Navin25-Aug-03 14:51
Navin25-Aug-03 14:51 
GeneralRe: setting the application icon at runtime Pin
Jim Crafton25-Aug-03 16:38
Jim Crafton25-Aug-03 16:38 
GeneralRe: setting the application icon at runtime Pin
Toni7825-Aug-03 20:36
Toni7825-Aug-03 20:36 
GeneralRe: setting the application icon at runtime Pin
DaFrawg29-Sep-03 2:27
DaFrawg29-Sep-03 2:27 
QuestionHow to include dialog in the view Pin
Binayak25-Aug-03 13:20
Binayak25-Aug-03 13:20 
GeneralControl Bars Pin
Xakep25-Aug-03 12:59
Xakep25-Aug-03 12:59 
GeneralRe: Control Bars Pin
Thomas Lau25-Aug-03 16:22
Thomas Lau25-Aug-03 16:22 
GeneralRe: Control Bars Pin
Mike Dimmick25-Aug-03 22:42
Mike Dimmick25-Aug-03 22:42 
GeneralClosing the handle of a dynamically spawned thread Pin
Kuniva25-Aug-03 12:17
Kuniva25-Aug-03 12:17 
GeneralRe: Closing the handle of a dynamically spawned thread Pin
Mike Dimmick25-Aug-03 22:43
Mike Dimmick25-Aug-03 22:43 
GeneralDialog prompts in German - would like to restore to English Pin
Peter Maton25-Aug-03 11:15
Peter Maton25-Aug-03 11:15 

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.