|
What is strptr declared as?
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
Win wrote:
when I call the function first time, i got no proglem.. but when i calll next time, I got run time error.... why is that?
Does the file even open the second time (i.e. does "stream" really get assigned to a real FILE*)?
|
|
|
|
|
Does the file even open the second time (i.e. does "stream" really get assigned to a real FILE*)?
that's i don't know.. I'm calling from the different program.
I have program 1 and program two.
they both have the function that does the same job. i named it writefile(). program1 call the function within itself first.. then program2 call it later within itself..
eventhoguh both writefile() in both program1 and program2 do the same job, act the same, have the same name, but they are in different program so they are different. oh.. the error message is saying expression : str!=NULL
<br />
class program1<br />
{<br />
.<br />
.<br />
.<br />
void writefile();<br />
.<br />
.<br />
<br />
};<br />
<br />
<br />
class program2<br />
{<br />
.<br />
.<br />
.<br />
void writefile();<br />
.<br />
.<br />
<br />
};<br />
|
|
|
|
|
my bad.. coz of typo.. couldn't open the file..
thanks guys
|
|
|
|
|
Hi !
I added a combo box to a toolbar in my FrameWnd. I can add items and everything but I miss 2 things:
1) If I manually type somwthing in the edit box of the combo box, and press enter, I cant find a handler to detect it.
2) how can I read the string value of waht I just entered ?
In a dialog it was much easier I did UpdateData and I was all set....
Thank you
|
|
|
|
|
1) You could use the ON_CBN_SELENDOK notification.
2) just use GetWindowText()
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
The second one worked great, I wasted the whole morning on that.
The first one I already tried and I have it in my message map, the funny thing is that it will not trigger from some reason, is there anything I have to do when I create the combobox so it will sense the ENTER ?
Thanks !!!
Shay
|
|
|
|
|
The edit control portion of a combo box usually does not receive ENTER notifications since all edit controls do not support this behaviour. ENTER usually means "default button pressed", as in dialogs.
What is the parent window of the combo box? Is it a CFrameWnd? You could also search CP for some of those special toolbars that contain combo boxes to get a hint...
good luck
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
yes, the parent is a FrameWnd, I will look in CP for demoes.
Thank you
|
|
|
|
|
I have to work with time functions. Time and date values have to be stored in string representation and have to be in UTC. Format is yyyymmddhhmmss. Now I use time() to get the current time and gmtime() to break it down into single values for formatting. When converting the string back into a struct tm I cannot use mktime() because that function takes the time zone into account, i.e. the resulting time value is not the same as before. I know that localtime() and mktime() are counterparts, is there any counterpart for gmtime()?
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
If you're using MFC, I would use CTime or COleDateTime instead.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Unfortunately I have to use plain C/C++ for portability reasons...
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
I think you can use _ftime() to get the current timezone.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I have come across this function in the <complex> class template.
template<class t="">
complex<t> conjg(const complex<t>& x);
how do I access this function?
|
|
|
|
|
Hi,
I'm working on a HTML Editor. I've been learning C++ only 2 weeks ago.
I'm making a MFC Application, Dialog-Based.
I use a multiline EditBox to store the HTML code.
I want to add HTML tags (like , which is a new line, for those who don't know HTML) in my EditBox when a user clicks on a menu link.
I want the tag to be displayed where my cursor is, in my editbox, but all I was able to do was to store the current text of the EditBox in a variable, then set the editbox's text and add the variable which contains the tag.
CString text;
CString br = " ";
m_htmlEdit.GetWindowText(text);
m_htmlEdit.SetWindowText(text + br);
So I suppose you know what happens... the text is displayed at the end of my EditBox
Please help me!
Thanks a lot!!
|
|
|
|
|
Use CEdit::ReplaceSel method.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
How does that function work?
Can you give me an example please?
Thanks a lot!
|
|
|
|
|
Using VC help is too difficult?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Sorry but I don't have the MSDN CD so I couldn't install the help.
That's why I'm asking you if you can give me an example.
Thank you.
|
|
|
|
|
Mr_CounterStrike wrote:
Sorry but I don't have the MSDN CD
Hmmm... MSDN CD comes with VC++. Check the MSDN online at msdn.microsoft.com [^] then.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
So I search for: CEdit::ReplaceSel on MSDN?
|
|
|
|
|
ReplaceSel will be enough. I've got 49 hits, first of them was CEdit::ReplaceSel docs which has the description and link to example.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Thanks
That forum is so active!!
I like that
|
|
|
|
|
One final advice: I don't know where did your VC++ disks, but you should visit the place and ask for CD version of MSDN. This will save you lots of time - especially during learning period.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Yeah, 49 results.
Call this function to replace the current selection in an edit control with the text specified by lpszNewText.
void ReplaceSel(
LPCTSTR lpszNewText,
BOOL bCanUndo = FALSE
);
Parameters
lpszNewText
Points to a null-terminated string containing the replacement text.
bCanUndo
To specify that this function can be undone, set the value of this parameter to TRUE . The default value is FALSE.
Is that it?
|
|
|
|