|
Unfortunately, I do that already dynamically as the view size changes (use SetScrollSizes() that is) and I tried adding some padding to force the scroll bars to remain visilbe but the effect would be somewhat confusing to the user as it is a fit to width application.
Some commercial products allow the user to temporarily scroll beyond the image edge and add some drawing primitive or object and recalculate the page size and readjust the scroll sizes on the next view resize or scroll bar action to remove the excess space that wasn't needed. They leave the horizontal scroll bar visible but the thumb is full size (or darn near close to it). VC++ 6.0 kinda does this when you scroll past the bottom of a document.
Thanks for taking the time to give me some advice. When it appears that I might be creating more work than necessary, I like to get some professional feedback as a sanity check. Unfortunatley, it looks like I'm going to have to derive from CView at this point.
Thanks again and take care.
|
|
|
|
|
I'm not sure how much you're going to have to fight the MFC code to do this.
Take a look at the source (viewscrl.cpp), particularly all the calls to SetScrollInfo() and
SetScrollRange().
There's the SIF_DISABLENOSCROLL flag for SetScrollInfo() but while letting the bar remain shown,
it will be disabled which isn't what you need.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I'm betting I'm going to have to revert back to deriving from CView.
I guess I'll earn my pay today.
Thanks for taking the time to share your thoughts and advice.
|
|
|
|
|
Why the wizard dont give a destructor for the CDialog derived class.
Is there a special reason?
Thnak you.
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: Why the wizard dont give a destructor for the CDialog derived class.
Its not always necessary. But if you need it, just add it.
|
|
|
|
|
Thak you.
I just wanted that.
KIRAN PINJARLA
|
|
|
|
|
Hi,
As all the destructors. The reason is to free the possible resources that have to be removed to avoid memory leaks or trash in memory. Specially the ones you are using during the whole life-time of the Dialog itself.
The only problem with that is that you can not free "graphical" resources because you don't have the parent window (the dialog) anymore, so the m_hWnd is NULL and is impossible to access them. In this point is better to use the WM_CLOSE because it is called just before destroying the window/dialog.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
how to get a ascii value of address in ip address control
|
|
|
|
|
prathuraj wrote: how to get a ascii value of address in ip address control
Do you mean the textual representation of the IP address?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i want to get ascii value because i cant differenciate (. . . .) and (0.0.0.0) in ipaddress control.I want to check each field in ipaddress control with space or zero.how to do that
I read the value from ipaddress control by Getdlgitem(id)->getWindowtext(cstring)
|
|
|
|
|
Have you ignored the GetAddress() method? In addition to getting the actual value from the control, it returns the number of non-blank fields.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
how to use getaddress function for dynamic one
|
|
|
|
|
prathuraj wrote: ...for dynamic one
You created a "SysIPAddress32" control dynamically?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
no,I used the class CIPAddressCtrl
|
|
|
|
|
prathuraj wrote: I used the class CIPAddressCtrl
Which has no bearing on whether you created the underlying control at design time or at run time (i.e., dynamic).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I've written a little web crawler in VC++, which grabs financial indices and quotes from different websites and shows them.
If the sources are plain html, everything is fine.
Now I've got a website which shows the quotes dynamically (http://www.forexpf.ru/quote_show.php[^]).
IMHO there are 2 ways to get the information extracted:
1. grab the page as image, make OCR and extract the info
2. load the page into a browser control to build the content, copy the content text (into clipboard) and extract information
#1 works in general, but ocr actually isn't accurate enough.
#2: Are there any examples to show the handling of clipboard?
On the other hand: Use of clipboard wouldn't be my first choice because the grab process is repeated automatically in background and with use of clipboard other applications running would be influenced. Are there any other ideas to solve the problem?
TIA
M.
|
|
|
|
|
Mathefreak wrote: 2. load the page into a browser control to build the content, copy the content text (into clipboard) and extract information
Try using IWebBrowser2, IHTMLDocument, IHTMLElement , and related interfaces.
Regards,
Paresh.
|
|
|
|
|
Mathefreak wrote: If the sources are plain html, everything is fine.
Now I've got a website which shows the quotes dynamically (http://www.forexpf.ru/quote_show.php[^]).
But the tables are still HTML. Unless I am not understanding, isn't row #3 of the upper-left table always "NASD Comp?" Or are you saying that the first column in each table continually changes?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
By "dynamically", I assume you mean you can't rely on the order of information? If so, you could scrape tuples (eg: "NASD100=1888.08") instead of assuming the location of specific entries in the table.
Btw, I wrote this[^] in order to build this[^].
/ravi
|
|
|
|
|
The only things which changes in the resulting webpage are the quote.
My aim is to get the quote for DAX (7th row in upper left table).
Are there any example to use the IWebBrowser2 interface to get the information.
TIA M.
|
|
|
|
|
Mathefreak wrote: My aim is to get the quote for DAX (7th row in upper left table).
That's plain HTML and trivial to scrape. There's no need to use IWebBrowser2 to do that.
/ravi
|
|
|
|
|
Hi Ravi,
it's not only plain html, unfortunately. There are some java functions embedded to grab the actual quotes.
Nevertheless, after searching around the net a bit, I'm proudly present the solution, which works for me
Sample application:
- simple MFC-Dialog
- one Webbrowser control (m_WebBrowserCtrl)
- website is loaded and refreshed by button click
- by clicking on a button the content of the site (plain text, not the html source) is copied into a CString variable to parse the data.
<br />
void CWebbrowser_TestDlg::OnCopy() <br />
{<br />
IHTMLDocument2* m_pHTMLDocument2;<br />
LPDISPATCH lpDispatch;<br />
lpDispatch = m_WebBrowserCtrl.GetDocument();<br />
HRESULT hr;<br />
if (lpDispatch)<br />
{<br />
hr =<br />
lpDispatch->QueryInterface(IID_IHTMLDocument2,<br />
(LPVOID*)&m_pHTMLDocument2);<br />
lpDispatch->Release();<br />
ASSERT(SUCCEEDED(hr));<br />
}<br />
<br />
<br />
CString sText;<br />
IHTMLElement *iSource;<br />
BSTR bstrSource;<br />
<br />
m_pHTMLDocument2->get_body(&iSource);<br />
iSource->get_outerText(&bstrSource);<br />
sText = bstrSource;<br />
<br />
MessageBox(sText);<br />
<br />
}<br />
Comments are welcome.
Next step is to use the code in my application, but that seems to be easy.
Greets M.
|
|
|
|
|
How can i import .jpg or jpeg images into resources off workspace instead of .bmp
|
|
|
|
|
Right click on your project on the solution explorer and select Add Resource and click on Import button and your file(jpg),and if you want to load them of resource see Loading JPG & PNG resources using GDI+ [^]
|
|
|
|
|
I have a MFC/C++ SDI application that reads data from a file and does a bunch of processing. I'd like to add a button to my GUI that when pressed opens up MS Excel with a varying number of sheets and does something (display table, chart, etc) in each sheet. Any ideas how/where to get started? Is there an example out there that calls MS Excel and does this sort of thing so I can get some idea of how it might work.
|
|
|
|