|
the program below ,when i set point(0,0) ,i can see those strings in view ,but when i set point(20,-20) ,those strins only can be seen in File/Print Preview.
void CTestView::OnDraw(CDC* pDC)
{CTestDoc* pDoc = GetDocument();
CString str;
//CPoint point(0,0);
//pDC->TextOut(point.x,point.y,"tanghuitian");
//point+=CSize(20,-20);
str.Format("%6.6s%6.6s%6.6s%6.6s%6.6s","index","left","top","right","bottom");
pDC->TextOut(point.x,point.y,str);
}
|
|
|
|
|
Its the way a window display works. The top left corner is 0,0. So when plotting on your screen display it falls outside the clipping region in use and is not shown. During print preview, no clipping region is in force, and point 0,0 is still in the top left of the page, but at the start of the printable area of the page (i.e. indented by the margin amounts).
Your string at (20, -20) is off the top on screen
but visible in print preview due to the extra canvas and lack of clipping region
Roger Allen - Sonork 100.10016
Strong Sad:
Clever I am? Next to no one.
Undiscovered and soggy.
Look up. Look down. They're around.
Probably laughing. Still, bright, watery.
Listed among the top. Ten.
Nine. Late night. Early morn.
Early mourn. Now I sleep.
|
|
|
|
|
Can somebody post me a link where a UNICODE file is loaded and it's content is displayed on a Dialog? So how to load a UNICODE file ? How to display a UNICODE text on a Dialog?
Thanks
xxx
|
|
|
|
|
I'm sure there was a class on CP that can load Unicode text, try to search. Underneath, the is no easy way to do it - you simply load portion-by-portion, analyzing content. Unicode file can start with signature (FFFE or FEFF) - this will help to to understand what you have. But it is not required - in this case you will have to try to detect if text is unicode (see ::IsTextUnicode()). As for displaying, it depends on your project - if it is Unicode-enabled, then no problems. Otherwise you will need to convert to plain text.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
Here it is:
http://www.codeproject.com/file/stdiofileex.asp
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
Well thanks,
but I also have a problem with displaying the text (_UNICODE is defined on my project). I can display the UNICODE text only with AfxMessageBox , when I try to set a STATIC TEXT control value to that text it does not show it correclty . Also wprintf(...) is not working .
xxx
|
|
|
|
|
have a look at this^[^]
I Dream of Absolute Zero
|
|
|
|
|
I want to create a modeless Property Sheet Wizard, with the Context Help icon in the System Menu (top right corner) ?
Is there a way to get it work ?
|
|
|
|
|
Why do i get in Windows 98 GetClipboardSequenceNumber undeclared identifier?
RegisterShellFilesType(TRUE) for a dialog box based on CRichEditCtrl gives me a debug
assertion failed: appui2.cpp line 191. I find ASSERT(m_pDocManager != NULL); and
m_pDocManager is CDocManager variable type which is a derived class from Object, but what is
CDocManager and what do i have to do in order not to appear this assert?I get this message after i close my app.
How ca I implement MRU list in a dialog box?I know about CRecentFileList, but how can i do it because i need a menu item?
Where I can have the mfc faq?
And please don't tell me about CRichEditView , I already know about it but I can't re-write my entire app because it is quite complex.
I have the following code for Find/Replace , but it doesn't working and not even the selection is not working as it should be.
bool CMyRtfDlg::FindWhatYouNeed( bool bMatchCase, bool bMatchWholeWord, bool bSearchDown)
{
FINDTEXTEX findText;
findText.lpstrText = (LPTSTR) (LPCTSTR) findName;
findText.chrg.cpMin = 0;
findText.chrg.cpMax = -1;
int nLen=findName.GetLength();
long lResult = m_rtf.FindText(0, &findText);
CString s;
s.Format("%d",lResult);
SetWindowText(s);
if (lResult == -1)
{
MessageBox("No matches!");
bSearchDown = false;
return false;
}
else
{
m_rtf.SetSel(lResult,nLen);
bSearchDown=true;
//findText.chrg.cpMin = lResult + 1;
//long lResult = m_rtf.FindText(0, &findText);
}
return true;
}
Thanks a lot.
|
|
|
|
|
Filomela wrote:
Why do i get in Windows 98 GetClipboardSequenceNumber undeclared identifier?
I assume you have the right .h files included. Do you have WINVER defined? If not, take a look at line #4389 of wsinuser.h.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I need a MIS.The personnel asministrative system of company,if you have the source code ,can you give to me as an example,thank you .
my mail box is:xuxu83@hotmail.com
|
|
|
|
|
This makes no sense. What does Management of Information Services have to do with source code?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
what class can use "serialize()"?
|
|
|
|
|
Any class which is derived from Cobject can use Serilize function.
|
|
|
|
|
I want to write OPC client application...I collected some information on it...The information is...to write OPC client application i have to buy OPC client Toolkit which contains COM based interface...and used it with c++ or Visual basic....
Now I want to know that is this information correct?...plz help
|
|
|
|
|
Well, I seriously doubt about it. OPC is just a standard set of interfaces, used for hardware/software communication. All you need is description of interfaces, which you can easily get in internet. However, that toolkit may contain templates and test application, which you will find extremely usefull during development. But maybe such tester and sample is available in internet too, see http://www.opcfoundation.org/
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
why to add _cdecl?what is the meaning of " __cdecl time(time_t *)"?
|
|
|
|
|
check
http://www.codeproject.com/cpp/calling_conventions_demystified.asp
greatest thing is to do wot others think you cant suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
__cdecl, from MSDN:
"This is the default calling convention for C and C++ programs. Because the stack is cleaned up by the caller, it can do vararg functions. The __cdecl calling convention creates larger executables than __stdcall, because it requires each function call to include stack cleanup code. The following list shows the implementation of this calling convention."
|
|
|
|
|
3 months ago I started writing an VC6-ActiveX-project. I choosed to have Runtime License in the project-startup-Wizard.
Now I’m trying to publish it on the net but it will not work. I’ve managed to create an ActiveX in .NET with no Runtime Licence and after creating a CAB-project of my .ocx it all worked on the net…
(All clients that didn’t have the .NET-ActiveX got it to work but not the one with Runtime License created in VS6.)
For me very strange…
Is it possible to take away the Runtime License setting from my old ActiveX-project?
...and justice for all
APe
|
|
|
|
|
Hi everybody,
now i face a strnage problem ,in vc++ 6.0 IDE
when i put the Dot operator after an object , the corresponding member fucntions and variables didnt come..
i deleted the .ncb, .opt, .clw, .aps files and opend the workspace. now member methods & functions window working for the MFC clasess like CString, CDialog etc.. but not for my custom clasess...how can i resolve this..?
The returned pointer may be temporary and should not be stored for later use.
|
|
|
|
|
It can be a little temperamental, especially with custom classes.
Why not try a third-party product called Visual Assist? I've used it for a long time now and just couldn't live without it - check it out at www.wholetomato.com, the latest version is called "Visual Assist X", you can trial it for 30 days free. It offers boat-loads more features than the standard VC++ 6.0 IDE.
|
|
|
|
|
I agree with Rory. I've been using Visual Assist for a few months now and it solves the problems you mentioned and more.
|
|
|
|
|
I agree. The built in intellisense in VC6 just plain sucks. It is very slow at times and often quits working at all. Try visual assist. It fixes all these problems.
John
|
|
|
|
|
Hi all,
I have a small problem of adding a toolbar to outlook express.. i was unable to find any example or code where it can be done... and no tutorials at all..while there are few gurus who can add toolbar to outlook express too.. I hope any one of you people out here at cp can help me out.. any help or pointers are highly appreciated.. thanks a lot in advance..
Regards
himanshu
|
|
|
|