|
OK... I had a program (originally written using VC 6.0) that, as part of its function, retrieves values from an open Internet Explorer window. However, when I compile the SAME EXACT code that works in VC6 in VS.NET, the retrieve function fails.
In the code, once I get the IE window, I check for frames:
IDispatchPtr dis;
IHTMLDocument2Ptr doc;
spBrowser->get_Document(&dis); //spBrowser is earlier declared and initialized
dis->QueryInterface(&doc);
IHTMLFramesCollection2* frames;
long num;
doc->get_frames(&frames); /* THIS IS THE PROBLEM
if (frames == NULL)
///failed
else
{
....
}
In VC6, the get_frames function returns a valid address everytime, whether it is a framesize of 1, or 2 or whatever...
However, when compiled in VS.NET, 'frames' ALWAYS ends up NULL.
What would cause this?
I am using the VS.net Beta 2. Is this a known problem that is fixed in the final release? Is there a solution??
Or is the problem something else entirely?
This was tested and confirmed using both IE5.5 and IE6.
Thanks!
Adam
cabadam@houston.rr.com
|
|
|
|
|
I was just curious how I can change the background color of my dialog box. Any assistance would be appreciated.
Thanks in advance,
Garry
|
|
|
|
|
See the VC forum FAQ (link at the top of the page).
--Mike--
"COM didn't solve the old version of DLL hell - it just provided us with a new and improved version of hell."
-- John Simmons, 1/22/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Have a look at WM_CTLCOLOR (OnCtlColor if MFC) - you get a chance to return the brush used to paint the background of this and other controls.
|
|
|
|
|
Overwrite CWnd::OnEraseBkgnd ( for WM_ERASEBKGND message), and paint yourself the background. For example :
BOOL CTestDlg::OnEraseBkgnd(CDC* pDC)
{
CRect rect;
GetWindowRect( &rect);
ScreenToClient( rect);
CBrush brh;
brh.CreateSolidBrush( RGB( 0, 0, 255));
pDC->FillRect( rect, &brh);
brh.DeleteObject();
return TRUE;
}
this will make the background for CTestDlg blue.
|
|
|
|
|
Thanks everyone for your help. It's people like you that make it all seem possible to distraught newbies like me.
|
|
|
|
|
In Prolog, if you are not interested in some variables, you can use "_" to represent it. It means you do not care its returned values or input values. In VC++, do we have some mechanism like Prolog does?
|
|
|
|
|
In functions, just leave out the variable name
int func ( int n, char ch, long, void* )
{
}
--Mike--
"COM didn't solve the old version of DLL hell - it just provided us with a new and improved version of hell."
-- John Simmons, 1/22/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Whats the easiest way to dynamically load HTML into the IWebBrowser2 control ? If I have a CString that holds html text is it possible to load it into a browser control ?
Thanks in advance
|
|
|
|
|
Yes you can . Get the document, and use IHTMLDocument2::write / writeln methods to write raw HTML data into. Or if you want to use IWebBrowser2 interface direcly , use Navigate2 method.
|
|
|
|
|
|
You can also load the page from a resource using the LoadFromResource method. (Assuming you are using CHTMLView) or by using the res protocol (res:/<MODULE_NAME>/<RESOURCE>)
|
|
|
|
|
One way i use is to get a pointer to an Element,
usually the BODY element, but you can do the
trick with any other elements (DIVs,SPANs,Ps,etc).
Then use the put_InnerHTML method.
One bug/feature of this trick is that you can
load an HTML file from the disk/Resourse and then
replace the body with a dynamically generated HTML string.
The document will still have the Stylesteets,scripts,METAs
defined in the section and also the attributes
defined in the body.
ex.
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
Dear all.
How to get the name of the recently added file to a Particular folder?
In my project i have to find the recently added file name for particular directory.
Presently i am watching the folder continuously and i am catching the event when ever the new file is entered to this folder( for this i am using Franky Braem Filemonitor control.. this is an exelent ATL control,please go through )
But i have to get the file name which is recently added to the folder.
advance thanks.
anju
|
|
|
|
|
Why not look at the time of last modification or time of creation, when you have to display the list of recently modified files.
But, if you have to display it realtime, watching the folder continuously seems to be the only option that you have ... If you need to display only the files that are modified during the lifetime of your application, then monitoring would be the best solution. It is not very expensive because the app is just waiting on an object...
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Thank u for sugesstion.
The problem is i have to intimate recently added file name to front end (it is in VB)by REAL Time.
Is there any API is available.Please ...it is very urgent for me
thank u once again
anju
|
|
|
|
|
The Win32 API functions to do this are
1. ReadDirectoryChangesW - not supported in 95/98/ME
2. FindFirstChangeNotification and
FindNextChangeNotification functions - works from 95 upwards
There is a C++ example in MSDN under the title
"Monitoring Changes in a Directory or Directory Tree". If you search this in MSDN for the exact string, ie using quotes on both sides, the example is the first result.
I am not very familiar with VB, so I do not know how you can use this info in VB. In C++, I would have a worker thread, that calls a callback function, with the changes as and when they occur.
Hope this helps
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I know it's possible to wrap my entire application in an exception handler so that when our code does something it's not supposed to do, I can pop up a dialog saying, "We're crashing, here's a log of the application state."
I've even cut and pasted an example from MSDN, and I'm in the midst of trying to find that again. Can someone point me in the right direction?
J
|
|
|
|
|
Try SEH exception to hook GPFs. There are a few articles on CP about this. Also search MSDN with SEH Exception to find more.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
Bingo! Thanks a bunch. I knew it was around...
J
|
|
|
|
|
Check in MSDN for ::SetUnhandledExceptionFilter. It works on W95 > , NT3.5 >.
|
|
|
|
|
Yah, as it turns out, this is what I need. After reading a bunch on SEH, I feel enlightened, but for what I need, SetUnhandledExceptionFilter() is perfect.
Thank you.
J
|
|
|
|
|
Hi,
Has anyone written or come across code to display a thumbnail image in
a CListCtrl in report or list view (ie., not icon or small icon)? Basically
I would like to develop a CListCtrl that would display a small picture alongside every entry in the list.
Thanks in advance
Wayne.
|
|
|
|
|
|
Hi All,
I have a problem which is only manifesting itself in the 'Build for Release' version of my MFC app.
I have an app which creates a worker thread, the thread returns data to the document. As soon as the worker thread terminates however all the file operations on my menus become greyed out. Has anyone seen this before , any solutions?
Many Thanks,
Louis
|
|
|
|