Ernie, The "this" pointer I use in C++ (no MFC or ATL) is a pointer to a *Class* that contains all of the code I use to create and manipulate the WebBrowser control. The last param of CoCreateInstance is used elsewhere: // Create and WebBrowser control that we are hosting. CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC, IID_IOleObject, (LPVOID*)&_pIOleObject); // Set the Web Browser Control's site (this) _pIOleObject->SetClientSite(this); How do I do the above in asm? ;) Xtreme
Posted on 2001-02-04 15:39:00 by Xtreme
I still don't know the answer to the above question, but... I've achieved partial success!! CoCreateInstance returns SUCCEEDED! I should have the browser control on a window by later tonight. Xtreme
Posted on 2001-02-04 17:01:00 by xtreme
If you want me to help any with the browser control. Tell me, I'd most definately like to use this in one of my projects. However my only COM experience was all gleaned off Ernie, so I can't help to much. But if you give me the C source code I can almost always translate it into MASM, I've done that lot's. Best of luck! See ya, Ben
Posted on 2001-02-04 17:48:00 by cyberben
xtreme, Congrats on initializing the explorer object. But now, your fun REALLY starts. You now have to return a reference to your client site object to the MSIE object. Actually, this should have already existed when you called CoCreate, as you really should have aggregated the MSIE object into your ClientSite. Aggregation is COM's runtime inheritance, it makes the MSIE object seem to be part of the client site to anyone QueryInterface-ing the client site. But you can probably sort that detail out later (and you might get by without doing it at all). S0... a client site object is an object you create yourself. One site per control you use. Look in "Inside OLE" for ActiveX controls for a list of the MINUMUM list of interfaces, and start there. Your task is now to create a class that has all of those interfaces... some 20-30 methods as memory serves me. Most of them will be trivial, lots will just return S_OK. But they all must be there. Look at my scripter app tut on how to create an object inside your exe and pass it off, you are doing the same thing. The scripter requires a much simpler interface then a client site, but the basic details are the same as for a visual control. The CoLib's AllocObject will instance a COM object for you (that's what it's designed to do). OK, so you define the client site class, create one with AllocObject (say called pMyClientSite), CoInstance a MSIE object (using the client site to aggregate to), then.... // Set the Web Browser Control's site (this) coinvoke _pIOleObject, SetClientSite, pMyClientSite That's going to start off a storm of messages back and fourth between the MSIE object and your client site, and the MSIE object looks to see what it needs to know. A lot of these messages will be in the form of QueryInterface requests looking for other interfaces. I hope you are real good at viewing asm code executing, cause you'll need to see what MSIE is trying to get so you can supply it. One last clue for tonight: look inside my component.inc file. I've defined most if not all of the interfaces you'll be using. However, the implimentation is up to you. Good luck, keep us posted. Ernie
Posted on 2001-02-04 18:16:00 by Ernie
Update: I have the browser on the screen. Other interfaces are being implemented. I don't have all of the handlers written yet but like Ernie said most of them just return S_OK or E_NOTIMPL. I should be able to load a web page by noon today. Code will be posted soon. Good night all... (yawn) Xtreme This message was edited by xtreme, on 2/5/2001 3:02:21 PM
Posted on 2001-02-05 01:55:00 by xtreme
Update: The "white rectangle" is now acting more like a browser. My code has grown to the point that it has its own zip code. However, the code is very straight forward and easier to understand and those stupid C++ classes. I can't believe how simple the code looks compared to C++. I'm looking for a free site to post the code. NEXT: Click "Organize Favorites" in IE 5.0+. See the list of folders above the Close button? That is an undocumented control. Its name is the "ShellNameSpace control". Itz next!! Xtreme This message was edited by xtreme, on 2/5/2001 4:13:25 PM
Posted on 2001-02-05 16:12:00 by xtreme