The ms_instances array contains pointers to Ball objects
What happens when j = 0;
Ball * const ball = ms_instance;
Does this mean it has no pointers because ms_instance ?
Do you need atleast j = 1 to create a pointer ........ like ms_instance means 1 pointer
.... ms_instance means array of two pointers......... so what does 0 mean?
ms_instances is apparently an array of pointers to instances of some kind of object.
this code gets element 'j' (a pointer) out of the array, then casts that pointer to a pointer-to-a-Ball: "compiler, treat this pointer as if it was a pointer to a Ball, instead of a pointer to whatever it is actually pointing at. then it dereferences the pointer and sets the m_state* member variable of what we all hope is an actual Ball object.
I'm using the web browser active-x control in an MFC application to browse some web sites. If I need to click links within this site however, sometimes it opens up a new IE window. I need it to always open up within the same window. In other words always target _SELF.
I tried looking through MSDN and other sites, but everything is always so cryptic and the examples are scarce.
Write now I call Browser.Navigate(myURL,NULL,NULL,NULL,NULL); to open a site. The 2nd NULL is supposed to be for the target name. I have yet to see an example where these 4 NULL's are actually set to anything else.
Can anyone shed some light as to how to do what I am trying to do.
Ok, that compiled. However my original problem still exists. When I navigate to the page and click a link within, it still opens a new IE window. Something tells me I have to intercept it with NewWindow2(), but when I tried setting up that event, nothing happened. I do have OnNavigateComplete and OnBeforeNavigate2 working, but when I tried adding OnNewWindow2 to the list of events, nothing happens when it spawns a new window.
Obviously now that I can cancel it from spawning a new window, I need to still be able to open it within the same window. get_locationURL isn't going to work obviously since it can't establish the new URL yet. Do you know how to extract the URL from the link you click on so I can call it in a new Navigate() command?
If it is, I'm not able to get the URL the link is pointing to. It's probably something that would still be handled by NewWindow... My guess is there's a few more parameters available, one of which would contain the URL to the link. Then I could simply navigate to it after the *Cancel = TRUE; command is processed.
I've been looking at KB Article Q185538 which is basically ideal for this situation, but the sample is in VB. I'm sure it must be related somehow but I haven't got it to work yet.
If it is, I'm not able to get the URL the link is pointing to. It's probably something that would still be handled by NewWindow... My guess is there's a few more parameters available, one of which would contain the URL to the link.
If I put *Cancel = TRUE; in NewWindow to prevent it spawning a new window then BeforeNavigate never gets called. It works for anything that doesn't spawn, however. Any other ideas? I can't imagine why something like this would be so difficult. It'd make a useful article if we can get it working....