Click here to Skip to main content
15,907,913 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: an interview question of undo/redo Pin
Chris Losinger6-Jul-05 2:13
professionalChris Losinger6-Jul-05 2:13 
GeneralRe: an interview question of undo/redo Pin
Mister Transistor14-Jul-05 3:30
Mister Transistor14-Jul-05 3:30 
GeneralRe: an interview question of undo/redo Pin
qudayong6-Jul-05 4:34
qudayong6-Jul-05 4:34 
GeneralRe: HELP VC++ my program is stuck. Pin
Wes Aday5-Jul-05 7:51
professionalWes Aday5-Jul-05 7:51 
GeneralRe: HELP VC++ my program is stuck. Pin
Anonymous5-Jul-05 8:44
Anonymous5-Jul-05 8:44 
QuestionHow to execute a file in memory being of type CMemFile Pin
Anonymous5-Jul-05 7:15
Anonymous5-Jul-05 7:15 
AnswerRe: How to execute a file in memory being of type CMemFile Pin
David Spain5-Jul-05 17:56
David Spain5-Jul-05 17:56 
GeneralRe: How to execute a file in memory being of type CMemFile Pin
Jose Lamas Rios5-Jul-05 18:25
Jose Lamas Rios5-Jul-05 18:25 
David Spain wrote:
How does CMemFile store its data? Most likely it stores a pointer to the memory that contains the actual data. Look in the Microsoft documentation for CMemFile to see how it stores the data. Hopefully, CMemFile has a method to provide this pointer. An LPCSTR is a pointer to a string, so method could be called and the result could be cast to an LPCSTR if it is not already returned that way. Then this could be provided to the ShellExecute function.

I don't think so. You might obtain the CMemFile data using Detach, which returns a BYTE* and also closes the file. The return type is a BYTE* because a file may contain any type of data, not just text. Casting it to an LPCTSTR makes no sense: it may fool the compiler into accepting it, but the content will still be the same, and if it wasn't text, no one interpreting it as such will have correct results. In this case, in fact, it's an executable (binary) file.

Besides, ShellExecute expects to receive the name of the file path and name, not the content of the file.


--
jlr
http://jlamas.blogspot.com/[^]
GeneralRe: How to execute a file in memory being of type CMemFile Pin
David Spain5-Jul-05 19:10
David Spain5-Jul-05 19:10 
GeneralProxy authentication Pin
Geert van Horrik5-Jul-05 6:04
Geert van Horrik5-Jul-05 6:04 
GeneralRebar controls Pin
__makaveli__5-Jul-05 5:36
__makaveli__5-Jul-05 5:36 
Questionhow to protect dll from replacement. Pin
Abdul Munaf Chhatra5-Jul-05 3:26
Abdul Munaf Chhatra5-Jul-05 3:26 
AnswerRe: how to protect dll from replacement. Pin
David Crow5-Jul-05 3:43
David Crow5-Jul-05 3:43 
AnswerRe: how to protect dll from replacement. Pin
«_Superman_»5-Jul-05 4:01
professional«_Superman_»5-Jul-05 4:01 
QuestionMS Word View->Print-Layout code? Pin
Maverick5-Jul-05 3:10
Maverick5-Jul-05 3:10 
AnswerRe: MS Word View->Print-Layout code? Pin
Chris Meech5-Jul-05 6:33
Chris Meech5-Jul-05 6:33 
GeneralRe: MS Word View->Print-Layout code? Pin
Maverick5-Jul-05 16:05
Maverick5-Jul-05 16:05 
GeneralRe: MS Word View->Print-Layout code? Pin
Jose Lamas Rios5-Jul-05 17:45
Jose Lamas Rios5-Jul-05 17:45 
GeneralCDialogBar and CMDIFrameWnd Pin
__makaveli__5-Jul-05 2:16
__makaveli__5-Jul-05 2:16 
GeneralQuestion about class CSplitterWnd Pin
PRJ15rf5-Jul-05 2:03
sussPRJ15rf5-Jul-05 2:03 
GeneralRe: Question about class CSplitterWnd Pin
PJ Arends5-Jul-05 11:00
professionalPJ Arends5-Jul-05 11:00 
GeneralToolbar Pin
Anonymous5-Jul-05 1:25
Anonymous5-Jul-05 1:25 
GeneralRe: Toolbar Pin
«_Superman_»5-Jul-05 1:57
professional«_Superman_»5-Jul-05 1:57 
GeneralRe: Toolbar Pin
Anonymous5-Jul-05 17:50
Anonymous5-Jul-05 17:50 
GeneralHelp ! Reading a file from the web Pin
nirishere5-Jul-05 0:03
nirishere5-Jul-05 0:03 

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.