Click here to Skip to main content
15,878,970 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to convert bstr to char[256] Pin
ashish8patil24-Jun-09 22:20
ashish8patil24-Jun-09 22:20 
Questionwua api help Pin
ashish8patil24-Jun-09 20:28
ashish8patil24-Jun-09 20:28 
QuestionMTOM without .Net framework how ? Pin
ERLN24-Jun-09 19:58
ERLN24-Jun-09 19:58 
AnswerRe: MTOM without .Net framework how ? Pin
Stuart Dootson24-Jun-09 22:35
professionalStuart Dootson24-Jun-09 22:35 
Questionhmm... Now why did this work? Pin
UserNameless24-Jun-09 19:52
UserNameless24-Jun-09 19:52 
AnswerRe: hmm... Now why did this work? Pin
Rajesh R Subramanian24-Jun-09 20:19
professionalRajesh R Subramanian24-Jun-09 20:19 
GeneralRe: hmm... Now why did this work? Pin
UserNameless24-Jun-09 20:34
UserNameless24-Jun-09 20:34 
GeneralRe: hmm... Now why did this work? Pin
Rajesh R Subramanian24-Jun-09 21:01
professionalRajesh R Subramanian24-Jun-09 21:01 
You can even write inline assembly to manipulate everything. But the question is: Do you really need to do it, given that you're already using a framework which makes things much more simpler?

I am saying that you should not be using std::string in an MFC program. But given that CString does everything that you need to, I simply fail to see any justification for using std::string. (OK, you're manipulating files? Then you could use CFile or CStdioFile or ...).

And why do I use MFC when I can do everything with vanilla C or C++? Because I'd like to leave for home at 5.

I may use something like an std::string within an MFC program very rarely (may be I'm using some third party code and a function expects a reference to an std::string, or whatever)...


sadman89 wrote:
drive when I click the Open button. my code for it is:


You are again providing code in bits and pieces. That works for me and I can't tell you why it didn't work in your case unless I can see the whole of your code (relevant code, please).

See if this helps:
CFileDialog cfd(true);
CString szStr;
cfd.m_pOFN->lpstrInitialDir = _T("C:\\");
if(cfd.DoModal == IDOK)
{
  szStr = cfd.GetFileName();
  AfxMessageBox(szStr);
}



It is a crappy thing, but it's life -^ Carlo Pallini

GeneralRe: hmm... Now why did this work? Pin
UserNameless24-Jun-09 21:24
UserNameless24-Jun-09 21:24 
GeneralRe: hmm... Now why did this work? Pin
Rajesh R Subramanian24-Jun-09 22:03
professionalRajesh R Subramanian24-Jun-09 22:03 
GeneralRe: hmm... Now why did this work? Pin
UserNameless24-Jun-09 22:44
UserNameless24-Jun-09 22:44 
QuestionRe: hmm... Now why did this work? Pin
David Crow25-Jun-09 4:05
David Crow25-Jun-09 4:05 
QuestionExecuting external DOS command with output redirecting to file Pin
Rajesh_Parameswaran24-Jun-09 19:44
Rajesh_Parameswaran24-Jun-09 19:44 
AnswerRe: Executing external DOS command with output redirecting to file Pin
Stuart Dootson24-Jun-09 22:30
professionalStuart Dootson24-Jun-09 22:30 
GeneralRe: Executing external DOS command with output redirecting to file Pin
Rajesh_Parameswaran24-Jun-09 23:25
Rajesh_Parameswaran24-Jun-09 23:25 
GeneralRe: Executing external DOS command with output redirecting to file Pin
Stuart Dootson24-Jun-09 23:38
professionalStuart Dootson24-Jun-09 23:38 
QuestionRe: Executing external DOS command with output redirecting to file Pin
David Crow25-Jun-09 4:12
David Crow25-Jun-09 4:12 
AnswerRe: Executing external DOS command with output redirecting to file Pin
Rajesh_Parameswaran25-Jun-09 23:31
Rajesh_Parameswaran25-Jun-09 23:31 
QuestionIs it Possible to Create Bad sectors on hard disks?? Pin
lek25824-Jun-09 19:06
lek25824-Jun-09 19:06 
AnswerRe: Is it Possible to Create Bad sectors on hard disks?? Pin
Hamid_RT24-Jun-09 19:15
Hamid_RT24-Jun-09 19:15 
QuestionMinigui build OS Pin
tuan111124-Jun-09 18:37
tuan111124-Jun-09 18:37 
AnswerRe: Minigui build OS Pin
Cedric Moonen24-Jun-09 20:21
Cedric Moonen24-Jun-09 20:21 
QuestionC6 _asm and graphics.h Pin
tuan111124-Jun-09 17:36
tuan111124-Jun-09 17:36 
QuestionRe: C6 _asm and graphics.h Pin
CPallini24-Jun-09 21:06
mveCPallini24-Jun-09 21:06 
QuestionClash between VS 2003 and VS 2005 Pin
rohitgonsalves24-Jun-09 17:14
rohitgonsalves24-Jun-09 17:14 

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.