|
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.
|
|
|
|
|
HiFive wrote: ...opens up MS Excel with a varying number of sheets and does something (display table, chart, etc) in each sheet.
It sounds like you need to use Excel's COM interface. Search for "Excel Automation."
"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
|
|
|
|
|
Hi, I'm rewriting a small utility myself in plain API code and the utility needs to know when there are any maximized Windows.
The original utility, an AutoHotKey script, simply polled all top-level windows about once every second, I'm convinced there must be a more efficient solution.
System hooks seemed like the obvious method to use but in the end the only hooks which would reliably detect a window being maximized from any previous state was a WH_CALLWNDPROC or WH_CALLWNDPROCRET hook. Currently I use a CALLWNDPROCRET hook to detect a window being maximized and then poll that window with an IsZoomed() call until it is 'un-maximized'. This feels quite far from the elegant solution I was sure I could come up with An alternative to the IsZoomed() poll would be to have the hook check on subsequent WM_SIZE messages to catch when the window is un-maximized but I'm not sure if that is actually better or worse.
Would anyone have some thoughts on the efficiency of these methods or even some other techniques altogether?
Kind regards, Eóin.
|
|
|
|
|
I am facing problem in reading data from clipboard with 16-bit settings. I able to read and save image in 32 bit settings. I want to convert 16-bit clipboard image to 24-bit or 32-bit BMP file.
Sethuraman.K
|
|
|
|
|
If you want to do the conversion yourself, the docs for the BITMAPINFOHEADER[^]
struct explains the various ways 16-bit pixel data is formatted.
You can also use GDI or GDI+ to convert the format by drawing the bitmap to a new bitmap.
It's a shame the GDI+ Bitmap::ConvertFormat() method isn't available except on Vista+.
With that, you could do the conversion in a couple lines of code
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|