|
-
December 14th, 2011, 05:06 AM
#13
Re: Reading ASCII Strings into a Unicode Program
Thanks for the info. I learned C pretty much formally, but taught myself C++ on the job. There are some gaps in my education.
One thing, I wasn't talking about making a copy of IniPath, just a copy of one of the CStrings in it that was already set with data.
For example,
m_CfgData.PinNamePath is set with data when the INI is read. Then later when that path is used, I do this:
CString filename = pFrame->m_CfgData.PinNamePath;
When the m_CfgData structure is filled within the MainFrame, the above setting of filename results in a NULL string, even though I can look at the string in m_CfgData.PinNamePath and it looks correct.
When I move the code to load data into m_CfgData to the app class, or the document class, setting filename works properly with no problems.
My conclusion is there is something odd about putting this sort of thing in the main frame because it works as expected everywhere else.
I will add the initialization code as you suggest just to be proper and to make sure everything starts in a known state.
Bill
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|