|
Mark, I don't know how to insert the string that holds the path into the main public CString m_csFileName(?); Here's how I get path CSysData cSysData is just a class for my vector that holds the data. Here's the path code:
Another question Mark? Here's how I get the path:
CString CSystemDB::SetPath(CSysData cSysData)
{
CString str, str1, str2;
str1 = "c:\\Wells\\Program\\DataBases\\Operators\\";
// Make path for SystemDB.bku file for each Operator:
pszFileName = _T("c:\\Wells\\Program\\DataBases\\Operators\\WSF\\SystemDB.sdb");// hardcoded
pszFileName2 = _T("c:\\Wells\\Program\\DataBases\\SystemDB\\SystemDB.bku");//hardcoded
// Make path for SystemDB.sdb file for each Operator:
str2 = "c:\\Wells\\Program\\DataBases\\Operator\\";
str2 += cSysData.m_csOperatorName;
str2 += "\\";
str2 += "SystemDB.sdb";
m_csSysNameTMP = str2;
str = str1;
str += cSysData.m_csOperatorName;
str += "\\";
str += cSysData.m_csWellName;
str += "\\";
m_vSys.m_cSysData.m_csPath = str;// ============ Path for file lookup ===================
DoDirectory(m_vSys.m_cSysData);
// Now get the file filename:
cSysData.m_IsFileName = cSysData.m_csWellName;
cSysData.m_IsFileName += ".wdb";
m_csFileName = str;
FileSaveSys(str);// create file =================
return str;
}
You didn't use the assignment operator so how do I get "str" passed to FileSaveSys(str) into the global varable m_csFileName where it will work correctly?
A C++ programming language novice, but striving to learn
|
|
|
|
|
I didn't use the assignment operator, but I didn't say there was
anything wrong with using it. You just need to assign a type that's
compatible with one of the assignment operators for the CString class.
You have a CString you're passing to FileSaveSys(), but you also already assign
it to a variable called m_csFileName in your SetPath() method.
I'm not sure why you pass it AND set a member variable...either way, you can use it
in FileSaveSys() however you want - use the passed string or the member variable string...
void CSystemDB::FileSaveSys(CString str)
{
CStdioFile myFile;
CFileException ex;
if(!myFile.Open(<code>m_csFileName</code>, CFile::modeNoTruncate | CFile::modeCreate | CFile::modeReadWrite | CFile::shareDenyWrite | CFile::typeText, &ex))
{
...
void CSystemDB::FileSaveSys(CString <code>str</code>)
{
CStdioFile myFile;
CFileException ex;
if(!myFile.Open(<code>str</code>, CFile::modeNoTruncate | CFile::modeCreate | CFile::modeReadWrite | CFile::shareDenyWrite | CFile::typeText, &ex))
{
...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
This is why:
C:\Wells\Program\DataBases\Operator\WSF\SystemDB.sdb contains an incorrect path. (error message)
"C:\Wells\Program\DataBases\Operator\WSF\SystemDB.sdb" is what is in m_csFileName and the path is correct.
if I hardcode it,(exactly as above), in the constructor it does NOT produce this error. I've tried it so I know this is true.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Mark, I want to appolize to you for taking up so much of your time. I finally found my mistake and it was as you said THE PATH WAS WRONG! It was writing all along but I diden't know it; because it was putting it somewhere else.
Sorry for using your time. I tried to look it up in debug but over looked it!
A C++ programming language novice, but striving to learn
|
|
|
|
|
Good deal! Glad you found it
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I want to know how can i use keyboards kyes like enter,move-down/up/left/right.
Please tell me how can use Enter key in Tree view.and how can select a tree item with the help of Enter key.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
About the Keys, take a look into this message[^] and its answers. With the CTreeCtrl, sorry but I haven't used it yet. Have you checked in the articles? I remember seeing one about an extended tree control, maybe there is info you can use.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
ho can replace a view on click of enter key?
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I find that in my Visual C++ 2008 I can select between Debug and Release modes in two places:
A: at the top of the window just below the Help menu option.
B: reachable by clicking Build, Configuration Manager.
I have found that my C:\3d\makeobj_vc\... keeps two copies of its working: Debug and Release.
What happens with each of these four selections for A and B?:-
A and B both Debug
A and B both Release
A Debug, B Release
A Release, B Debug
modified on Saturday, May 3, 2008 7:23 AM
|
|
|
|
|
Didnt get you completly what you wanna say.
When i do changes from A than automatically B also changes.
It is not possible that if one changes than another is not change.
3) A Debug, B Release
4) A Release, B Debug
please check it again. I think you do changes in project context (configuration manager)not active solution configuration. If yes than when the both condition are different than project is not built and failure occur.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
hi Everyone
i am doing project on GSM modem using AT commands in VC++ programming.
I am not getting how to send,read and receive a sms from GSM modem using AT commands.I am opening port and connecting modem.it is working.But i am not getting how the message shold me send to particular
persons in the list.whether i have to write a function for AT commands or wt.if it is so then tell me how can i do it.
Thanks,
Savitri
|
|
|
|
|
|
savitri wrote: i am doing project on GSM modem using AT commands in VC++ programming.
I am not getting how to send,read and receive a sms from GSM modem using AT commands.I am opening port and connecting modem.it is working.But i am not getting how the message shold me send to particular
persons in the list.whether i have to write a function for AT commands or wt.if it is so then tell me how can i do it.
do you have manual for AT command if yes. then try connecting hardware usin hyper terminal and there you could practice all of your command!
as far a i remember, i used to practice these command on hyperterminal
ctrl + b SMAN 0 ctrl+c
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hi..
Thakns for replying.i tried in hyperterminal but i am not getting how to use those commands in my program.when i open the port it is working.but i want to use AT+CMGS AND AT+CMGR commands in my program.is there any syntax for it.please tell me i am new to this AT commands.PLEASE HELP ME OUT.
PLEASE........
THANKS IN ADVANCE
Savitri
|
|
|
|
|
Hello everyone,
My question is comes from when I write a C++ program. Not find suitable place to post.
My question comes from page 175 of Numerical Computation Guide. Here is a link,
http://www.physics.ohio-state.edu/~dws/grouplinks/floating_point_math.pdf
I do not know why if ß = 2, p = 3, emin = -1 and emax = 2 there are
16 distinct floating-point values in formular (1) in page 174? Are
there any more general formular to calculate the distinct value for
formular (1) for any given ß, p, emin and emax?
(sorry, I can not post math formular in this text box)
thanks in advance,
George
|
|
|
|
|
ß is the base we're working in. When ß is 2, we're dealing with binary floating point.
If emin is -1 and emax is 2, there are four possible values for e: -1, 0, 1, and 2. p represents the number of significant binary digits, but because we're talking about normalized floating point numbers, d0 cannot be 0. Because we're dealing in binary, it must be 1. Therefore, only d1 and d2 can change. Because there are two bits, that means there are four possibilities (1.00, 1.01, 1.10, 1.11). Combining the four possible values of the mantissa with the four possible exponents gives 16 possibilities:
1.00 x 2<sup>-1</sup> = 0.1 (== ½, 0.5 decimal)
1.01 x 2<sup>-1</sup> = 0.101 (0.625)
1.10 x 2<sup>-1</sup> = 0.11 (0.75)
1.11 x 2<sup>-1</sup> = 0.111 (0.875)
1.00 x 2<sup>0</sup> = 1.0 (1.0)
1.01 x 2<sup>0</sup> = 1.01 (1.25)
1.10 x 2<sup>0</sup> = 1.10 (1.5)
1.11 x 2<sup>0</sup> = 1.11 (1.75)
1.00 x 2<sup>1</sup> = 10.0 (2.0)
1.01 x 2<sup>1</sup> = 10.1 (2.5)
1.10 x 2<sup>1</sup> = 11.0 (3.0)
1.11 x 2<sup>1</sup> = 11.1 (3.5)
1.00 x 2<sup>2</sup> = 100.0 (4.0)
1.01 x 2<sup>2</sup> = 101.0 (5.0)
1.10 x 2<sup>2</sup> = 110.0 (6.0)
1.11 x 2<sup>2</sup> = 111.0 (7.0) [Edit: fixed formatting for clarity]
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Cool, Mike! Smart guy!
1.
What is the range of the digit in the left of the point in normalized form of float, in base B? [1, B - 1]?
2.
Your conclusion is matching the answer from the book.
But what makes me confused is, suppose you have significant p1 and p2, and the correspounding exponent e1 and e2. Your counting answer is based on the theory that if p1 and p2 are different, no matter what correspounding values are e1 and e2 are, the result must be different.
My question is, is it possible that p1 and p2 are different, but also e1 and e2 are different, then p1 * e1 and p2 * e2 produce the same resulting value?
regards,
George
|
|
|
|
|
That's what Normalising is all about.
Bram van Kampen
|
|
|
|
|
Thanks Bram,
Could you provide answer to my question (1) and (2) please?
regards,
George
|
|
|
|
|
I subclassed a listview to try and get the HDN_TRACK notification from the header control, but the only notifications that seem to come are NM_RELEASEDCAPTURE and NM_CUSTOMDRAW. Is there any way to get the others?
|
|
|
|
|
Hey Friends
I have a screensaver file.
Now let's say this is abcd.scr
where as in screensaver dialog box it is displayed as 1234
any idea how do they extract 1234?
Regards
|
|
|
|
|
Have you tried looking at the HKCU\Control Panel\Desktop\scrnsave.exe value in the registry? Or, how about opening abcd.scr and looking at the string table resource (value 1)?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yeah Thanks
now i just need to find out how to read string table value of the .scr file
but now i have a way to move forward
thanks a lot
|
|
|
|
|
Helo I want to convert
u_short to long value.
so how to convert it. any library function is used or what?
Regards,
Amit
|
|
|
|
|
You just need to cast it to long;
u_short s = 0;
long l = (long)s;
|
|
|
|