Click here to Skip to main content
15,903,201 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionif I add a text file to the resource, how could I get this file in the programe? Pin
benben21-Jul-03 20:29
benben21-Jul-03 20:29 
AnswerRe: if I add a text file to the resource, how could I get this file in the programe? Pin
Eugene Pustovoyt21-Jul-03 20:41
Eugene Pustovoyt21-Jul-03 20:41 
GeneralRe: if I add a text file to the resource, how could I get this file in the programe? Pin
benben22-Jul-03 4:42
benben22-Jul-03 4:42 
AnswerRe: if I add a text file to the resource, how could I get this file in the programe? Pin
Jens Doose21-Jul-03 22:05
Jens Doose21-Jul-03 22:05 
GeneralThanks Pin
benben22-Jul-03 0:25
benben22-Jul-03 0:25 
GeneralRe: Thanks Pin
Jens Doose22-Jul-03 1:06
Jens Doose22-Jul-03 1:06 
GeneralThanks Pin
benben22-Jul-03 4:32
benben22-Jul-03 4:32 
GeneralRe: Thanks Pin
Jens Doose23-Jul-03 21:35
Jens Doose23-Jul-03 21:35 
Hmmm, one annotation:

The more I think about it the more I get convinced, that it is not allowed to just cast the memory pointer to an LPCTSTR, because the trailing zero is missing.
Instead it should be copied to an according buffer.

So it should be:
LPCTSTR lpszString = reinterpret_cast< LPCTSTR>( lpVoid );
TCHAR *tcBuffer    = new TCHAR[ dwSize + 1 ];
if ( NULL != tcBuffer )
{
  ZeroMemory( tcBuffer, ( dwSize + 1 ) * sizeof( TCHAR ) );
  memcpy( tcBuffer, lpszString, dwSize * sizeof( TCHAR ) );
}


But this is only the case with strings.
Byte buffer or similar can't be used directly anyway (like LPCTSTR).

Jens
GeneralAmazing problem Help!!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
xxhimanshu21-Jul-03 20:22
xxhimanshu21-Jul-03 20:22 
GeneralRe: Amazing problem Help!!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
J. Dunlap21-Jul-03 20:39
J. Dunlap21-Jul-03 20:39 
GeneralRe: Amazing problem Help!!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
xxhimanshu21-Jul-03 21:15
xxhimanshu21-Jul-03 21:15 
QuestionHow to use CString variable in regular DLL Pin
Eugene Pustovoyt21-Jul-03 19:01
Eugene Pustovoyt21-Jul-03 19:01 
AnswerRe: How to use CString variable in regular DLL Pin
Toni7821-Jul-03 19:35
Toni7821-Jul-03 19:35 
GeneralRe: How to use CString variable in regular DLL Pin
Eugene Pustovoyt21-Jul-03 19:56
Eugene Pustovoyt21-Jul-03 19:56 
GeneralRe: How to use CString variable in regular DLL Pin
Toni7821-Jul-03 20:09
Toni7821-Jul-03 20:09 
GeneralTranfer double data between dialogs Pin
spaced_out21-Jul-03 17:58
spaced_out21-Jul-03 17:58 
GeneralRe: Tranfer double data between dialogs Pin
Eugene Pustovoyt21-Jul-03 19:07
Eugene Pustovoyt21-Jul-03 19:07 
GeneralRe: Tranfer double data between dialogs Pin
melwyn21-Jul-03 22:05
melwyn21-Jul-03 22:05 
GeneralRe: Tranfer double data between dialogs Pin
Bob Stanneveld22-Jul-03 3:01
Bob Stanneveld22-Jul-03 3:01 
GeneralRe: Tranfer double data between dialogs Pin
spaced_out22-Jul-03 5:07
spaced_out22-Jul-03 5:07 
GeneralProblem Solved!! Pin
spaced_out22-Jul-03 18:24
spaced_out22-Jul-03 18:24 
Generaloutput "%" to Text Pin
wow999921-Jul-03 17:20
wow999921-Jul-03 17:20 
GeneralRe: output "%" to Text Pin
John M. Drescher21-Jul-03 17:30
John M. Drescher21-Jul-03 17:30 
GeneralRe: output &quot;%&quot; to Text Pin
Ryan Binns21-Jul-03 18:00
Ryan Binns21-Jul-03 18:00 
GeneralRe: output &quot;%&quot; to Text Pin
John M. Drescher21-Jul-03 18:04
John M. Drescher21-Jul-03 18:04 

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.