|
I have implemented the MFC CRichEditView class, which is a CRichEditCtrl wrapped in a CScrollView. MFC provides a lot of functionality for character and paragraph formatting but they fall off the edge of the earth with respect to printing---setting margins, formatting to margins, pagination, etc. I would expect that something as simple as setting page margins would be straightforward, but I have found no documentation for any of this. There is one obscure MFC sample written in C, which I found pretty useless! This has to be an intentional deletion on Microsoft's end because, what good is all the wonderful formatting functionality they provide if I can't print anything?
Does anyone have ideas about how to print the CRichEditView?
Thanks
Mike Newberry
|
|
|
|
|
Hello to all fellow programmers
Like the title says... What's the best method to get a CPropertySheet pointer from within a CPropertyPage ?
Thanx in advance for any help and have a nice day !
|
|
|
|
|
I guess you may use a simple GetParent(), because the pages are children of the property sheet and not of the tab control.
The best way to know is trying
Cheers,
Paolo.
|
|
|
|
|
Paolo is right, but you'll need to cast the return from GetParent() to a CPropertySheet*. So you'd do this in your CPropertyPage-derived class:
CPropertySheet* pSheet = (CPropertySheet*) GetParent();
If you need to access memebers of your CPropertySheet-derived class, just replace CPropertySheet in the code above with the name of your derived class.
|
|
|
|
|
G'day Luc,
Something that I do quite frequently when dealing with property sheets is to create a base class for the property pages - say CBasePropertyPage - and add member functions to access the parent property sheet.
I.e
CMyPropertySheet* CBasePropertyPage::GetPropSheet()
{
return (CMyPropertySheet*)GetParent();
}
I also add member functions to access data that is stored or managed by the property sheet.
I.e.
CMyDataClass* CBasePropertyPage::GetDataPtr()
{
return GetPropSheet()->m_pDataPtr;
}
I then derive my property pages from this class.
This gives *all* of the property pages easy access to the parent property sheet and any data that it maintains.
Hope this helps.
Steve
|
|
|
|
|
Good
Thanx for everyone who gave me an answer
It's fun to have such a good support from anyone in the world
Have a nice day !
|
|
|
|
|
Dear All,
Can anyone tell that how can one enable/disable the tray menu items? If EnableMenuItem() can be used for this purpose then how?
Thanks in advance,
Regards,
Atif
|
|
|
|
|
Hi,
I need to Bold the text on the property page tab when the page is active.
I have been successful in setting all the tabs to bold with the
following Code:
BOOL CPropSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
// Set the attributes of the font.
LOGFONT logFont;
memset(&logFont, 0, sizeof(LOGFONT));
logFont.lfWeight = FW_BOLD;
// create the new font.
CFont font;
font.CreateFontIndirect(&logFont);
// set the control to use the new font.
CTabCtrl* pTabCtrl = GetTabControl();
pTabCtrl->SetFont(&font);
return bResult;
}
I have placed the code in the OnSetActive() event for the Pages
but I can't seem to get the handle to the sheet to use the
GetTabControl() function.
If anyone has any ideas on how to do this or can provide a
sample application it would be greatly appreciated.
TIA,
Lori
|
|
|
|
|
From any of the pages, you can get a pointer to the sheet with:
CPropSheet* pSheet = (CPropSheet*) GetParent();
However your code has another bug. You have the font variable on the stack, so as soon as the function returns, font gets destroyed, taking the GDI font object with it. Make the CFont variable a member variable of the sheet so it will be available for the lifetime of the sheet.
|
|
|
|
|
I have been attempting to create my first control in ATL. I have managed to get the font, backcolor, and forcolor properties to work fine. I am now trying to get the BackStyle property to work. I can statically set the property in code (OPAQUE or TRANSPARENT), but I have not been able to populate the property dropdown list with these strings. Does anyone know how to do this?
|
|
|
|
|
Now i want to read file from server to CString Buffer and now i can do that But
When i call my function again, it not work But i exit my program i can do that again Please Help me!!!
When i call this function
i call "GetFileToBuffer(m_serverName, getObject, getHeader, getFile);"
With m_serverName = "204.188.96.251";<- This is assume ip ; )
getOpject = "test/Palm/text.xx";
getHeader = "";
getFile = NULL;
and my function coding is
void CWeb::GetFileToBuffer(const CString & ServerName,
const CString & strObject,
const CString& strHeaders,
CHttpFile * & pFile)
{
m_serverName = "216.188.96.251";
INTERNET_PORT nPort = INTERNET_DEFAULT_HTTP_PORT;
if (m_serverName != ServerName)
{
// Picked a new server, close out connection and make a new one:
if (m_pServer)
m_pServer->Close ();
delete m_pServer;
m_pServer = NULL;
}
if (m_pServer == NULL)
{
m_pServer = m_pSession->GetHttpConnection(ServerName, nPort);
m_serverName = ServerName;
}
pFile = m_pServer->OpenRequest(CHttpConnection::HTTP_VERB_GET,
strObject, NULL,1, NULL, NULL, INTERNET_FLAG_EXISTING_CONNECT);
pFile->AddRequestHeaders(strHeaders);
TRY{
pFile->SendRequest();
}
CATCH_ALL(e){
TCHAR szCause[255];
e->GetErrorMessage(szCause, 255);
}
END_CATCH_ALL
CString buffer;
while(pFile->ReadString(buffer) != NULL);
}
|
|
|
|
|
Hi all,
I am writing a setup application, which has to exchange some third-party libraries. Unfortunately, these libraries are loaded during my setup. Therefore, I want to exchange the files at the next boot.
Some time ago, I have read about a shell function, which stores the files in a temporary folder, writes the appropriate information into the registry, and Windows will read this information at next boot time and move the files to their proper destination folder. My problem is, that I cannot find this function anymore. I suspected SHFileOperation, but the docs do not give any hints. Can anyone help me?
Thanks in advance,
Thomas
|
|
|
|
|
I don't know about the Shell function but I do know that you can use the MoveFileEx function with the MOVEFILE_DELAY_UNTIL_REBOOT flag to do what you need.
Regards,
Alvaro
|
|
|
|
|
This only works on NT, though. On Win 9x you need to write entries to the WININIT.INI file to replace files at the next boot.
|
|
|
|
|
Dear Developer
I'm developing webbrowser using CHtmlView.
But i don't know handler that received WM_PAINT message.
For example
LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
if( message == WM_NOTIFY ||
message == WM_PAINT ) {
// paint code here
}
}
return CFrameWnd::WindowProc(message, wParam, lParam);
}
Above example does not repaint properly.
For example "Scroll event"
When i draw in my program and scroll the window then doesn't repaint.
Please help.
Thanks in advance
dooly
|
|
|
|
|
The CHtmlView is just a container for the WebBrowser control .To intercept the events you must connect to the events of the HTML document that is displayed in the control .Also , you can intercept some messages via WM_NOTIFY .
|
|
|
|
|
Hi
Thanks for your reply.
But i don't know how connect to the event.
Have you some sample code?
Or Have you method to catch scrollbar event?
Thanks in advance again.
dooly
|
|
|
|
|
check this address :
http://msdn.microsoft.com/workshop/c-frame.htm?/workshop/browser/default.asp
You can catch all the events for an DHTML object , so you can handle the scroll event also ( this event is received by the BODY element )
|
|
|
|
|
Hello,
No doubt everyone knows there's a fine utility in the Visual C++ Add-In sample directory, called AutoBld Add-In. I'm currently adapting this DLL to be used in our development environment.
One of the options of that DLL, is sending a mail with the results (amount of errors/warnings) of the different compilations done. I do, however, want to have more information into that mail message. I also would like to have the output of the Build tab in my message.
Does anyone know how to 'grab' the output of that Build window? Is there a possibility via the Application object (like you have e.g. the properties 'Errors' and 'Warnings') or is there another way to do it?
Since this is my first 'touch' with COM-alike stuff, any help would be highly appreciated.
Thanks very much in advance,
Best regards,
Geert
|
|
|
|
|
Hi
I am finding a way to read text from that windows too.
But I wrote my own add-in that may be resolve your problem
visit http://zmanagers.chat.ru and look how I send build output to "macros" window
Zmike
|
|
|
|
|
Hi,
I am trying to use the map data structure of the STL.
When I declare the map, map<int,int> var , I get all sorts of warnings
(something like 92 of them) saying that some names are longer than 255
characters. Can someone please tell me how do get rid of these warnings?
For your information, here is a few of those warnings:
d:\vc98\include\utility(21) : warning C4786: 'std::reverse_bidirectional_iterator<std::_tree<int,std::pair<int const="" ,int="">,std::map<int,int,std::less<int>,std::allocator<int> >::_Kfn,std::less<int>,std::allocator<int> >::iterator,std::pair<int const
="" ,int="">,std::pair<int const="" ,int=""> &,std::pair<int const="" ,int=""> *,int>' : identifier was truncated to '255' characters in the debug information
d:\vc98\include\utility(21) : warning C4786: 'std::reverse_bidirectional_iterator<std::_tree<int,std::pair<int const="" ,int="">,std::map<int,int,std::less<int>,std::allocator<int> >::_Kfn,std::less<int>,std::allocator<int> >::const_iterator,std::pair<int
const="" ,int="">,std::pair<int const="" ,int=""> const &,std::pair<int const="" ,int=""> const *,int>' : identifier was truncated to '255' characters in the debug information
d:\vc98\include\utility(21) : warning C4786: 'std::pair<std::_tree<int,std::pair<int const="" ,int="">,std::map<int,int,std::less<int>,std::allocator<int> >::_Kfn,std::less<int>,std::allocator<int> >::iterator,std::_Tree<int,std::pair<int const="" ,int="">,std:
:map<int,int,std::less<int>,std::allocator<int> >::_Kfn,std::less<int>,std::allocator<int> >::iterator>' : identifier was truncated to '255' characters in the debug information
d:\vc98\include\utility(21) : warning C4786: 'std::pair<std::_tree<int,std::pair<int const="" ,int="">,std::map<int,int,std::less<int>,std::allocator<int> >::_Kfn,std::less<int>,std::allocator<int> >::const_iterator,std::_Tree<int,std::pair<int const="" ,int
="">,std::map<int,int,std::less<int>,std::allocator<int> >::_Kfn,std::less<int>,std::allocator<int> >::const_iterator>' : identifier was truncated to '255' characters in the debug information
Draggable.cpp
DrawUndo.cpp
|
|
|
|
|
#pragma warning(disable:4786)
|
|
|
|
|
I have created a Dialog based application. I want it to have a menu with the standard things like "File" with
"Open", "New", "Save" and "Save As." I would like to use the defaults of these functions which come up in the
Document based programs. Is there any way to import or implement these into my current program? Thanks.
Ryan
|
|
|
|
|
There are two answers to your questions. The simple answer to your direct quesion is that yes it is possible. See "TN022: Standard Commands Implementation".
Unfortunately, though, the answer to your less direct question is that it is not possible, since the Standard Commands require the document/view architecture.
|
|
|
|
|
Hi,
I have a vertical slider control in my dialog. The maximum
value appears at the bottom and the minimum appears at the top. How can I change it, so the minimum value will be at the bottom and the maximu at the top ?
Thanks,
Shai
|
|
|
|
|