|
ahhh. i c
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
levay wrote:
If linewrap is set at 80, then I move to that pos in the line then look for the next space...
Shouldn't you be looking for the previous space? If position 80 is in the middle of a 10-letter word, you'd actually be breaking at position 85.
|
|
|
|
|
Agreed. Relative wrapping was good enough for what I was trying to accomplish at that time. I'll probably go back later and make it more accurate (ie: <= linewrap), but at this time it wasn't a priority.
|
|
|
|
|
I don't know what your CStringEx extension class is or how it is defined but by the symptoms, I'd guess you have stack corruption. The fact that the bug goes away when you allocate more memory leads me to believe that something is trashing the stack if that allocation doesn't take place.
I tried to reproduce this problem using CString but couldn't (in debug and retail). Have you tried to use CString instead of CStringEx? What you could also do is debug the retail executable in the dissasembler and keep watching the stack to see if the return pointer is kept intact.
|
|
|
|
|
Your hunch was right. Not sure where the corruption is happening yet, but I was able to preempt it by doing the following:
<br />
MsgQry->m_strBodyText.GetBuffer(dwSize + 1);<br />
MsgQry->m_strBodyText.ReleaseBuffer(dwSize + 1);<br />
I have never used GetBuffer/ReleaseBuffer for pre-allocating CString memory before. Anything I should be aware of? Any performance hits by allocating in this way? Is there a better way to allocate than this?
Thanks
|
|
|
|
|
Other than the fact you are starting with intLineSize set equal to intWrapSize, instead of 0, I do not not see the problem. I am looking at you your code and I feal like the is something wrong. I do not know what it is (at 4:28 AM), but it is there.
Trust in the code Luke. Yea right!
|
|
|
|
|
Hi,
does anybody know how to implement a multiline list view? I need list items which are 2 or 3 lines high. \n, \r\n and \r\r\n don't work.
Regards,
Happosai
------------------------------------
http://www.happosai.tk
|
|
|
|
|
Try this article http://www.codeproject.com/listctrl/lvcustomdraw.asp the last pic in the article has a multi line list.. I haven't gone through the code but it may be a place to start..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi,
sure, it's a place to start, but not for a beginner like me "I achieved this by doing all the painting on my own." That's too hart for me but thanks anyway.
Regards
Happosai
------------------------------------
http://www.happosai.tk
|
|
|
|
|
Is there a way that you can open solitare through a C++ command and if there is what is it?
Thanks
Matt
Matt Millican
http://www.internetmill.com
|
|
|
|
|
InternetMill wrote:
Is there a way that you can open solitare through a C++ command and if there is what is it?
Try the ShellExecute function.
-Nick Parker
|
|
|
|
|
Not with C++ (it knows nothing about launching applications). With the Windows SDK, you can use WinExec (not recommended), ShellExecute, or CreateProcess.
|
|
|
|
|
Hi, working on an instalation project and would like to know if there is any safe way to install a .inf file with some C++ code, for win 95, 98, NT4, 2k and XP.
The problem is that I have a USB device and would like to install the driver for it witout the need for the device to be inserted into the computer.
regards ME
|
|
|
|
|
Yes.
I am not sure why you need to install an .ini file(assume .inf was a mistake). But you need to not only copy the driver to the %windir%\system32\drivers directory you need to modify the registry (so it knows it exist).
Note: None of the above can be done on WinNT/Win2000/WinXp unless an Adiminstrator is doing the install.
Trust in the code Luke. Yea right!
|
|
|
|
|
I want to add new records with my program to my database
but I don't know how to do this .
please help me.
|
|
|
|
|
Are you wanting to know how to use CRecordset::AddNew()?
|
|
|
|
|
yes I want to know how can I use this method in a dialog base application . please give me an example
|
|
|
|
|
Have you checked out MSDN, or Googled for examples?
|
|
|
|
|
yes but I cann't find something that help me.
try
{
//update the current record
//CGuard obj;
piAdoRecordBinding->Update(&rsRecSet);
//can we add a new record?
if(m_pRs->Supports(adAddNew))
{
piAdoRecordBinding->AddNew(&rsRecSet);
}
is it correct
|
|
|
|
|
|
In this case AddNew is done through the CADORecordsetBinding class and since you don't know much about this subject, you should not use this method (until you improve your ADO skills) because it is not that straight forward. On the other hand, database programing is something that takes a couple of weeks at least to understand, so just by looking at examples won't work.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
|
I have the following annoying thread problem
A message is handled in my dialog class.
Call AfxBeginThread() with a static stub method as the thread entry point, passing a this pointer in.
Call ( (CMyClass*) arg)->MyThreadEntryPoint to get back into the class scope.
Now, back in my class member function, one of the first lines is UpdateData( true ). This crashes with a memory error. Is that not a legal way of using threads? I guess there are then two threads working in the same class, if that's a problem.
If possible I want to avoid deriving from CWinThread. This is a worker thread, btw.
Thanks
Dave
|
|
|
|
|
Since it is a worker thread, it cannot be doing anything with the UI, at least with any hope of success. It appears that MyThreadEntryPoint() is the worker threads' way of "sneaking" back into the dialog's thread. If the worker thread must do anything with the UI, it must use PostMessage() to the main thread.
|
|
|
|
|
DavidCrow you are a true *.
|
|
|
|