|
Well, it's only a try!
Getting all URLs of your web page isn't very complicated - for every frame the function OnBeforeNavigate2 gets called, providing the URL.
But determination on gaining focus should be a more advanced task.
When your document is loaded, you can get a pointer to all frames of your window by IHtmlWindow's get_frames function. Then you should implement a connection sink and connect to all IHtmlElementEvents2. Then you could react on it's onfocus event.
Connecting to the events could be done in the following way:
void CMyClass::ConnectEvents(IHTMLElement* pElem)
{
HRESULT hr;
IConnectionPointContainer* pCPC = NULL;
IConnectionPoint* pCP = NULL;
DWORD dwCookie;
hr = pElem->QueryInterface(IID_IConnectionPointContainer, (void**)&pCPC);
if (SUCCEEDED(hr))
{
hr = pCPC->FindConnectionPoint(DIID_HTMLElementEvents2, &pCP);
if (SUCCEEDED(hr))
{
hr = pCP->Advise(pUnk, &dwCookie);
if (SUCCEEDED(hr))
{
}
pCP->Release();
}
pCPC->Release();
}
}
pElem would be a frame element in your case.
Hope it helps ... and works;)
|
|
|
|
|
THX!!! are you lucky luke?
im'going to understand your code and try it.
i hope it's works
thx again !
|
|
|
|
|
hmm..
sorry i'm don't understand very well
to get a pointer on frames i do :
IDispatch *pDisp = GetHtmlDocument();
IHTMLDocument2 *pDocument = NULL;
pDisp->QueryInterface( IID_IHTMLDocument2, ( void** )&pDocument );
IHTMLFramesCollection2* pFrames;
pDocument->get_frames(&pFrames);
I don't understand what contains pFrames ?
and to pass IHTMLElement* pElem at ConnectEvents i do :
IHTMLElement* pBody = NULL;
pDocument->get_body (&pBody );
ConnectEvents(pBody);
it's right ?
i'm sorry to ask you so many questions but you are my only help.
|
|
|
|
|
jeremysay wrote:
to get a pointer on frames i do :
Yeah, that should work....
jeremysay wrote:
I don't understand what contains pFrame
pFrame contains a collection of all frames of your document. You can then extract the elements by using the item function that IHTMLFrameCollection2 supports. For details you should hava a look at MSDN.
jeremysay wrote:
and to pass IHTMLElement* pElem at ConnectEvents i do :
As you want to get informed about a frame gaining focus, I think IHTMLElement should be replaced by a pointer to a frame object. So once you have pointers to your frames (as mentioned above retrieved by 'item'), I think you should call ConnectEvents with a pointer to your frame.
jeremysay wrote:
i'm sorry to ask you so many questions but you are my only h
There's no reason to be sorry ... I think I'll learn nearly as much as you when trying to solve your problems ... it's everytime a new challenge;)
|
|
|
|
|
THX !
i try to work your soltion....
Schlaubi wrote:
think I'll learn nearly as much as you when trying to solve your problems ... it's everytime a new challenge
Don't panic I have many challenge for you
|
|
|
|
|
I Am Trying To Convert Any Square/Rectangle Bitmap Into An Irregular Shape Bitmap Using MFC .
Any Ideas .
|
|
|
|
|
It's not physically possible to do this. All bitmaps are a square array of bytes, compressed or otherwise. Can you imagine how much harder it would be to define an irregular path for a bitmap ?
You're probably confused by the fact that many applications use masks to draw bitmaps as irregular shapes. GDI+ handles this for you nicely, you can specify a range of colours not to draw and make the central colour in that range the colour you draw the outline area in. A range is good because if you use a lossy formay like jpg, the pixel values will wander a bit.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
Hi Christian,
I Got The Feeling From Ur Mail That u have Not Got My Point.
u Wrote About Mask's I Am Familar With That Types Of Mask Creation Process And Use It in Our Packages.
But As u Know That We View a Bitmap on Screen As Rect/Square .
But i Have To Make it Look Round This Process Will Surely Have Some Data Loss We Are Ready For That.
if u Have Gone Through Some Graphical Packages Such Photoshop it Has Provision For Irregular Shape Bitmaps .
Regards
Praveen
|
|
|
|
|
All Photoshop does is hide the details from you. There ONLY way Windows can deal with a bitmap is as an array of scanlines, which may or may not be padded, depending on bit depth. They are always rectangular. End of story.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
I was created toolbar using CToolbarctrl.I was used Loadimages for loading the Single Bitmap,having no of different bitmaps.Then I was used TBBUTTON structre.
b[0].iBitmap=0; ie means I was assigned index of the bitmap resource.
This program sucessfully run on WIN98.But while running the on WIN2000
Bitmaps are not appeared on the bitmap.what shall I do?Please tell me
changes?
|
|
|
|
|
Hi,
I work on a project composed with several libs including MFC's and resources on visual c++ V6.0
i have a toto.lib and toto.res that i link with others but i saw that all resources was present in toto.res AND in toto.lib. I would like to trash toto.res and use only resources included in toto.lib but the linker want absolutely toto.res. I can't find a way to link with toto.lib only and load resources from this static lib.
Any solution?
Thanks
|
|
|
|
|
If .lib your are talking about is surrogate created to link to some DLL then you have no choice.
If you are talking about true static lib there could be no resources in it, even though it can reference one.
Anonymous wrote:
load resources from this static lib
This statement is confusing - please clarify what is it you are trying to do?
|
|
|
|
|
Hi,
I have strange problem with my dialog based app.
I use modified PropertySheet/PropertyPages on main dialog
Base is StackDialog by Zoran M.Todorovic, found on codeguru or maybe on codeproject.
In some moment i realized that when I close application, no one get focus.
Alt+Tab combination don't work. Alt+Esc stil can to open start meny, and after that Alt+Tab work well.
Main dialog have added menu, tooltips...
I try to set focus to the previous application in ExitInstance
Question is
1. How to repair application to exit properly
2. How to find which app is behind my app, (in z-order)
e.g. how to force regular exit
thanks for every suggestion
|
|
|
|
|
Im trying to undefine a setting from a function one file
that calls another file where the actual #define is used.
the problem is much the same as this code.
I know you can fix this by putting the volume code
below main() but is their any way around this other than
moving the code ?
<br />
#define VOLUME_UNITS 1<br />
<br />
int volume ()<br />
{<br />
#ifdef VOLUME_UNITS<br />
return 10;<br />
#else<br />
return 20;<br />
#endif<br />
}<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
int vol;<br />
#ifdef VOLUME_UNITS<br />
#undef VOLUME_UNITS<br />
vol = volume ();<br />
#define VOLUME_UNITS <br />
#else<br />
vol = volume ();<br />
#endif <br />
<br />
printf ("%d\n", vol);<br />
<br />
#ifdef VOLUME_UNITS<br />
vol = volume ();<br />
#endif <br />
<br />
return 1;<br />
}<br />
|
|
|
|
|
Little bit confused as to what you are trying to do, but just looking at the code, the #ifdef and #undef's in the main funtion don't really serve any purpose. Any #directive is dealt with by the compiler, not the linker or at runtime. I'm guessing by the bit of code that goes (code is paraphrased!):
#ifdef VOLUME_UNITS
#undef VOLUME_UNIT
vol = volume()
#define VOLUME_UNITS
...
#endif
... you are trying to turn off the VOLUME_UNITS for that particular execution of volume(), won't work - the evaluation of VOLUME_UNITS will only occur when compiled, not when volume() is executed. In effect, the code above is equivalent to:
main ()
{
int vol;
vol = volume ();
:
#ifdef VOLUME_UNITS
vol = volume ();
#endif
}
If you want something evaluated runtime then the only thing is to do it runtime (extra argument, an 'if' statement etc)! Alternatively, I may have misunderstood your question...
|
|
|
|
|
What segment of the SDK needs to be updated to get the gdi+ lib, dll and header files?
I need to know this as i wont have enough hd space for the full SDK platform upgrade. (Note I am assuming GDI+ is in one of the platform upgrades)
|
|
|
|
|
Is this a wise thing? I have a heap of little tables that would never have more than 100 or so entries so did not want to use a database like Access or MSDE.
I was thinking of using XML to store the data and DOM to access it, I basically need to be able to add/modify/delete records and do some simple queries, e.g. "give me all records where this element equals this value", this should all be possible using DOM?
|
|
|
|
|
yes, this is possible, but you won't be able to use automated queries, stored procedures... having less work in order to connect to the database (because there is not a database at all), but having more work in order to make it give you the right results because you'll need to make all the normal database stuff for yourself...
Hope this helps...
|
|
|
|
|
For years now we have all been working with two software configs
Debug and Release (cross product with other things like Unicode,
or various languges etc.)
I have been thinking about adding an additional type of config
to my projects, and wanted your opinions. Debug, of course, is
overloaded with extra debugging checks, ASSERTS, ASSERT_VALID
and so forth. Consequently, it is loaded down with extra stuff
that makes it run slow. (Also the optimizer is generally off
to make single stepping code easier.) Release turns off all that
stuff to maximize the speed of the program (which, BTW, usually
means mimizing the size of the program rather than the number of
instructions on modern CPUs, but that is a different issue.)
I have been considering an intermediate type of configuration,
call it Rebug a combination of Release and Debug. This tool
keeps all the ASSERTS and other debugging tools, but redefines
them to log as errors, and dump minidumps as opposed to breakpoints.
Similar with unhandled exceptions etc. Rebug is also stripped
of symbols (though I keep a pdb.)
What is the purpose of Rebug? Well it is released as part of
the install, and installed right next to the release version.
If a bug happens in the field, the user can switch to the
Rebug version (presumably through a menu command in the Release
version), recreate the bug, and generate all sorts of tracking
information for the debugger back at home base. In particular
it catches problems early, by detecting failed assertions,
uncaught exceptions, and so forth. Rebug would also include
various options like range checking, stack frame checking,
dog tags and so forth. It would allow the generation of
a good debug run in the field for debugging without sending
out the debug version, and having a breakpoint fire in the
middle of a real user session.
Why not just use the standard XP mechanism for handling crashes?
Because the Rebug version can potentially catch the problem
early enough that it is readily apparent what is happening,
rather than looking at a static picture where the data set is
already screwed up.
I wonder what y'all think of this idea?
|
|
|
|
|
We have been using this sort of setup for a few years now, and it is very usefull indeed. In fact, we usually have more than just debug,release and the one you call "rebug". We also have Debug Optimised, ( "Derel" ? ), which is the full debug-build with optimisation turned on. When you have something which only crashes in release, it can be good to go backwards towards the normal debug build through these two extra targets.
The only problem with the scheme is that multiple configurations like these are poorly supported by VC...well, at least VC 6. It's a hassle to maintain and there are bugs which will mess up your configurations when you alter options in the menus. The configuration manager in VC 7 seems better.
-=jarl=-
|
|
|
|
|
DOS prompt
i use VC++ 6.0, what header can i include and what command can i use to copy the contents of a DOS screen to a file, like if i wanted to copy the directory of a folder to a file.
EMAIL
i made a program that displays info and i just copy and paste it to an email, is there anything i can do to just directly send the info to the email? i doubt it's possible, i want to send it to NETSCAPE COMPOSER, thanks
|
|
|
|
|
It's very simple. In DOS world, try this:
c:\> dir *.* > myfile.txt
In this manner, all of reports from dir command will be redirect to myfile.txt
you can use ShellExecute or ShellExecuteEx API to do that for you. Remember that "*.* > myfile.txt" is argument of dir command.
A. Riazi
|
|
|
|
|
in order to access the menu items in an MDI app would you call getMenu() on the child frame or the parent frame?
Ben
Oh wow
|
|
|
|
|
How can i associate a file type with my application.
|
|
|
|
|
Depends on OS. For NT5+ you can use the commands assoc and ftype at the command prompt.
If you're willing to do it manually, use Regedit.
|
|
|
|