|
I tried deleting .ncb file,
it did not helped.
|
|
|
|
|
Hi,
is it possible to store the content (text+format) of a CRichEditCtrl to a variable and serialize it later?
I need this because I have an Array (CObArray) with my class derived from CObject. Each item in this array should store a content of a RichEdit....
Thanks for your help...!
|
|
|
|
|
Yes, its possible for serializing the contents of a CRichEditCtrl.
Just get the text and its format in a CString and serialize that CString. While loading get that string and display that one.
If the replies helps you, rate them.
|
|
|
|
|
But how can I put the content of a CString to my CRichEditCtrl?
following the part I put my text from CRichEditCtrl to a CString
<br />
static DWORD CALLBACK MyStreamOutCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)<br />
{<br />
<br />
CString *pTempString = (CString*) dwCookie;<br />
<br />
pTempString->AppendFormat("%s",pbBuff);<br />
<br />
*pcb = pTempString->GetLength();<br />
<br />
return 0;<br />
}<br />
void CMyTestDlg::OnBnClickedButton5()<br />
{<br />
EDITSTREAM es;<br />
<br />
es.dwCookie = (DWORD) &m_szRTF;<br />
es.pfnCallback = MyStreamOutCallback; <br />
m_rtfAuswertung.StreamOut(SF_RTF, es);<br />
<br />
}<br />
<br />
|
|
|
|
|
I believe you'll want to use CRichEditCtrl::StreamOut(SF_RTF, ...) for this. Simply getting the text via GetWindowText() won't work as it will lose the formatting.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Can someone help me turn this into c++ code. I thought I had it but I keep getting errors. What am I doing wrong? N is an exponent.
Payment = Rate * (1 + Rate)N
-------------------- * L
((1 + Rate)N – 1)
Here is my code:
double payment=(mrate*(1+mrate)* exp (n)/((1+mrate)* exp(n)-1))*l;
BINARY
-- modified at 3:22 Monday 31st October, 2005
|
|
|
|
|
Binary0110 wrote: I keep getting errors
Do you mean compiling errors, or errors in the formula ?
~RaGE();
|
|
|
|
|
Hi,
What do mean saying that N is exponent? Do you mean e^N or x^n?
Where have declared the rest of variables; mrate, n, l?
double mrate = some_initial_value;
double l = some_initial_value;
double n = some_initial_value;
Anyway, if you mean e^N, the code might look like so:
double payment =<br />
(mrate * (1 + mrate) * exp(n) / ((1 + mrate) * exp(n) - 1)) * l;
If you mean x^N:
double payment =<br />
pow(mrate * (1 + mrate), n) / (pow((1 + mrate), n) - 1) * l;
--
======
Arman
|
|
|
|
|
Binary0110 wrote: ...but I keep getting errors.
Such as?
Binary0110 wrote: double payment=(mrate*(1+mrate)* exp (n)/((1+mrate)* exp(n)-1))*l;
Make sure the numeric constants are floating point values, like:
double payment=(mrate*(1.0+mrate)* exp (n)/((1.0+mrate)* exp(n)-1.0))*l;
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi,
I want to find out what is the length (or maybe I should say width of a char* object / string in pixels so I could set the width of column (in List Ctrl) to fit the text length.
Is there any (MFC) function or some kind of trick I can use to find out this attribute?
thanks,
yaron.
|
|
|
|
|
Yaron Abershitz wrote: I should say width of a char* object / string in pixels so I could set the width of column (in List Ctrl) to fit the text length.
check out of thsi function GetCharWidth(...)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
Take a look at CDC::GetTextMetrics
--
======
Arman
|
|
|
|
|
|
Yaron Abershitz wrote: so I could set the width of column (in List Ctrl) to fit the text length.
How about CListCtrl::SetColumnWidth(..., LVSCW_AUTOSIZE) ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi.
I have a program that reads a database and displays its graphics into a CScrollView Instance. To do that it reads records from the database and creates a small metafile for each of it. Finaly, when all those metafiles are created it replays them over the view and displays those that are part of the visible (on screen) window.
I want to create that view invisible (not on the screen) and using the same functions I would like to create all those metafiles. Then rather than replaying them on the display I would like to save them in the disk as EMF.
So far I manage to create the EMF and to replay over it the metafiles. However, I am always getting a part of my image in the saved file and not the whole image (wich be larger than the screen). I do not display the view on the screen thus the CGetClientBox CGetClipBox functions return a zero size rectangle. I 've tried to use functions to manipulate the window extend and the viewport but I am not sure that I understand them.
Can some explain to me what are window origin/extend versus viewport ones? And how can I affect the size of a disk saved MetaFiles?
Thanks a lot
|
|
|
|
|
|
|
Hi,
I have a modal CDialog which displays a (modeless) CPropertySheet with some CPropertyPages. Everything works fine so far. However, when I show a MessageBox in responese to a button on one of the property pages being clicked, I get a deadlock and the message box does not appear. When I show the message box in response to a button directly on the dialog being clicked, everything works fine.
In short:
Modal_Dialog -> Button -> MessageBox: works
Modal_Dialog -> PropertySheet -> PropertyPage -> Button -> MessageBox: deadlock
I've tried various owner windows for the message box: NULL, the dialog, the main app. window - always the same result. Actually, I'd like to display a CColorDialog, it's the same problem here.
Any help is highly appreciated!
I'm running Visual C++ 6.0 under Windows XP Pro.
Best regards,
Andreas
|
|
|
|
|
|
Great!
That solved my problem, thanks a lot, SkyWalker!
Best regards,
Andreas
|
|
|
|
|
Hello,
I need some help. I’m working on a project with some schools that involve Windows and “hosts” file work. The network I’m working on requires several pre defined domains that need to be assigned to a different IP address which is achieved through using the hosts file.
The problem that I’m running into is that a hosts file over 150K will start to crash the Dnscache service under Windows 2000 and XP. I have to disable this service in order to have everything work. The problem with doing this is that resolving a host without Dnscache has considerable latency issues and an overall slow connection time without the Dnscache service running. It doesn’t matter if the hosts file is 1K or 300K, without DNS caching, it is very slow.
I would very much appreciate it if someone could assist me or even just write a small C or C++ win32 console app that can be run and installed as a service through the command line using the “sc config” and “net start” commands. It would need to be able to replace the Dnscache “dnsrslvr.dll” service. This service is nice but not very robust when it comes to actually using the hosts file for what it was designed for.
Really, it doesn’t have to load the whole hosts file into memory like the Dnscache “dnsrslvr.dll” service does. All this program would need to do is pre allocate a small chunk of memory and then just monitor domain name requests. When the IP address is returned from the DNS server out on the web or from the hosts file, it would just need to cache it into memory. The initial connection would still be the time required to ask the DNS server or hosts file for the IP address but after that, the site would load faster because all of the graphics, applets and so on would already be pointing to the IP address.
I would even be willing to compensate a bit for the time spent doing this. I know time is valuable. Please contact me at jamie@unitedcomputerservice.com
I will also keep checking the post here. Thank you in advance for anyone who could help me in this effort. I write code but this one is a bit out of my area to be comfortable.
|
|
|
|
|
c++code101 wrote: The problem that I’m running into is that a hosts file over 150K will start to crash the Dnscache service under Windows 2000 and XP.
Have you seen this?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
yes, very much so. The Dnscache service doesn't work very well with a large hosts file because it loads the whole hosts file in memory. It is different from computer to computer on what size of hosts file will crash it. I have seen 300+ kb size files run fine before.
|
|
|
|
|
hi all,
can u please help me ?
For the below code,
CString csFileString(_T(""));
if(oChunk.m_oEvntMsg.message == WM_LBUTTONDOWN)
{
csFileString.Format (_T("Message LBUTTONDOWN (%d) recieved from '%s'\r\n"),oChunk.m_oEvntMsg.message,oClass.szClassName );
}
else if(oChunk.m_oEvntMsg.message == WM_LBUTTONUP)
{
csFileString.Format (_T("Message LBUTTONUP (%d) recieved from '%s'\r\n"),oChunk.m_oEvntMsg.message,oClass.szClassName );
}
else
{
csFileString.Format (_T("UnknownMessage (%d)' recieved from '%s'\r\n"),oChunk.m_oEvntMsg.message,oClass.szClassName );
}
output is,
Message LBUTTONDOWN (513) recieved from 'Internet Explorer_Server'
Message LBUTTONUP (514) recieved from 'Internet Explorer_Server'
Message LBUTTONDOWN (513) recieved from 'Internet Explorer_Server'
Message LBUTTONUP (514) recieved from 'Internet Explorer_Server'
Message LBUTTONDOWN (513) recieved from 'Internet Explorer_Server'
Message LBUTTONUP (514) recieved from 'Internet Explorer_Server'
UnknownMessage (516)' recieved from 'Internet Explorer_Server'
Message LBUTTONDOWN (513) recieved from 'Internet Explorer_Server'
UnknownMessage (517)' recieved from 'Internet Explorer_Server'
Message LBUTTONUP (514) recieved from 'Internet Explorer_Server'
Message LBUTTONDOWN (513) recieved from 'Internet Explorer_Server'
Message LBUTTONUP (514) recieved from 'Internet Explorer_Server'
if u look at out put....
Message LBUTTONDOWN (513) recieved from 'Internet Explorer_Server'
Message LBUTTONUP (514) recieved from 'Internet Explorer_Server'
LBUTTONDOWN (513) and LBUTTONUP (514) from same class that is...'Internet Explorer_Server'.
i want to bring up that as below,
LBUTTONDOWN (513) and LBUTTONUP (514) from 'Internet Explorer_Server'.
can u please give me tip..?
iam greatful to you..
best regards,
tirucapricorn.
tirucapricorn.
|
|
|
|
|
...what exactly do you want to ... bring up ?
SkyWalker
|
|
|
|