Click here to Skip to main content
15,889,335 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strings in Studio 2005 v. Studio 6.0 Pin
john john mackey7-May-08 10:19
john john mackey7-May-08 10:19 
QuestionApp which would work on every Windows system Pin
Lutosław7-May-08 7:42
Lutosław7-May-08 7:42 
AnswerRe: App which would work on every Windows system Pin
CPallini7-May-08 8:14
mveCPallini7-May-08 8:14 
AnswerRe: App which would work on every Windows system Pin
David Crow7-May-08 8:21
David Crow7-May-08 8:21 
QuestionOverriding the maximize button for the main window in a MDI application Pin
berger_the_great7-May-08 5:00
berger_the_great7-May-08 5:00 
AnswerRe: Overriding the maximize button for the main window in a MDI application Pin
Randor 7-May-08 6:00
professional Randor 7-May-08 6:00 
GeneralRe: Overriding the maximize button for the main window in a MDI application Pin
berger_the_great9-May-08 5:16
berger_the_great9-May-08 5:16 
QuestionHow to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 4:48
Larry Mills Sr7-May-08 4:48 
I need someone to please help me figure out how to get a TCHAR into a CString; when I will NOT know in advance what the TCHAR will be. Here's my code:
// SysData.h : header file
//

#pragma once



// CSysData
// Class that contains the System File Data

class CSysData
{
public:
// Functions:
CSysData(); // Default Constructor
~CSysData(); // Default Destructor
void CreateDirectoryName(CSysData cData);
void CleanUp(void);

// Copy Constructor:
CSysData(const CSysData& cSource);

// Assignment operator:
CSysData& operator= (const CSysData& cSource);
CString SetPathName(CString str);

//Varables:
CString m_csOperatorName;
CString m_csWellName;
CString m_csPath;
CString m_IsFileName;
CString m_csDirections;
CString m_csTanks;
};

Here's how I obtain the path:
CString CSystemDB::SetPath(CSysData cSysData)
{
CString str, str1, str2, str3;
str1 = _T("c:\\Wells\\Program\\DataBases\\Operators\\");
// Make path for SystemDB.bku file for each Operator:
str3 = "c:\\Wells\\Program\\DataBases\\SystemDB\\SystemDB.bku";
m_csSystemDB_BKU = str3;
// Make path for SystemDB.sdb file for each Operator:
str2 = "c:\\Wells\\Program\\DataBases\\Operator\\";
str2 += cSysData.m_csOperatorName;
str2 += _T("\\");
str2 += "SystemDB.sdb";
m_csSysNameTMP = str2;
str = str1;
str += cSysData.m_csOperatorName + _T("\\");
str += cSysData.m_csWellName;
str += _T("\\");
m_vSys.m_cSysData.m_csPath = str;
DoDirectory(m_vSys.m_cSysData);
// Now get the file filename:
cSysData.m_IsFileName = cSysData.m_csWellName;
cSysData.m_IsFileName += ".wdb";
m_csFileName = str;
}
The cSysData data was collected from dialog editbox input from the User.
now I must open a CStdioFile using a TCHAR filename. m_csFileName has that filename at this point, BUT it is not a TCHAR. How do I make it into a TCHAR? I simply don't know how. Mark showed me how to do it using the CString Constructor, but this is not possible after the CString has already been constructed.
Can someone please help me?

A C++ programming language novice, but striving to learn
AnswerRe: How to Get a TCHAR into a CString? Pin
toxcct7-May-08 4:54
toxcct7-May-08 4:54 
AnswerRe: How to Get a TCHAR into a CString? Pin
CPallini7-May-08 5:06
mveCPallini7-May-08 5:06 
QuestionRe: How to Get a TCHAR into a CString? Pin
David Crow7-May-08 5:26
David Crow7-May-08 5:26 
AnswerRe: How to Get a TCHAR into a CString? Pin
Randor 7-May-08 5:41
professional Randor 7-May-08 5:41 
AnswerRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery7-May-08 6:52
Mark Salsbery7-May-08 6:52 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 7:34
Larry Mills Sr7-May-08 7:34 
GeneralRe: How to Get a TCHAR into a CString? Pin
CPallini7-May-08 7:42
mveCPallini7-May-08 7:42 
GeneralRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery7-May-08 7:53
Mark Salsbery7-May-08 7:53 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 10:56
Larry Mills Sr7-May-08 10:56 
GeneralRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery7-May-08 11:13
Mark Salsbery7-May-08 11:13 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 12:37
Larry Mills Sr7-May-08 12:37 
GeneralRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery9-May-08 7:36
Mark Salsbery9-May-08 7:36 
AnswerRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery9-May-08 7:47
Mark Salsbery9-May-08 7:47 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr9-May-08 16:05
Larry Mills Sr9-May-08 16:05 
QuestionToolbar in dialog based project Pin
ilgale7-May-08 4:28
ilgale7-May-08 4:28 
AnswerRe: Toolbar in dialog based project Pin
Mark Salsbery7-May-08 7:01
Mark Salsbery7-May-08 7:01 
QuestionCapturing a video using opencv on MFC Pin
Collin Xie7-May-08 4:18
Collin Xie7-May-08 4:18 

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.