Click here to Skip to main content
15,908,013 members
Home / Discussions / COM
   

COM

 
GeneralRe: Accessing constants via vb-script ? Pin
Anonymous6-Jun-03 4:24
Anonymous6-Jun-03 4:24 
GeneralRe: Accessing constants via vb-script ? Pin
Hans Ruck6-Jun-03 4:38
Hans Ruck6-Jun-03 4:38 
GeneralMarshalling Pin
act_x5-Jun-03 9:40
act_x5-Jun-03 9:40 
GeneralRe: Marshalling Pin
geo_m5-Jun-03 22:38
geo_m5-Jun-03 22:38 
GeneralRe: Marshalling Pin
act_x6-Jun-03 8:20
act_x6-Jun-03 8:20 
GeneralRe: Marshalling Pin
geo_m6-Jun-03 21:53
geo_m6-Jun-03 21:53 
GeneralRe: Marshalling Pin
Hans Ruck6-Jun-03 2:09
Hans Ruck6-Jun-03 2:09 
GeneralGetting the width of a webbrowser frame Pin
John Oliver4-Jun-03 21:59
John Oliver4-Jun-03 21:59 
Hello,

I have a web browser control in my dialog and I want to resize the control to fit the html inside.

First of all, is it actually possible to get the size of the document/top frame?

There is only one frame in the document and I'm hoping to read it's height and width properties, but I've been trying to drill down to the Frame but I keep getting an error. I've checked a lot of the newsgroups and I think I'm going through the IE DOM correctly. I'd appreciate any help.

Thanks,
John

IDispatch* spDispatch = NULL;
IHTMLDocument* m_spDoc1 = NULL;
IHTMLDocument2* m_spDoc2 = NULL;
IHTMLFramesCollection2* m_pFrames = NULL;
HRESULT hr = NULL;


spDispatch = m_browser.GetDocument();
spDispatch ->QueryInterface (IID_IHTMLDocument, (void**)&m_spDoc1);
m_spDoc1->QueryInterface(IID_IHTMLDocument2, (void**)&m_spDoc2);
m_spDoc2->get_frames(&m_pFrames);

//the following code was taken from an example
//which iterates through the frames
/ but since my page has just one frame, frameCount returns 0
//and since it is zero based I'm presuming this is correct
LONG framesCount;
m_pFrames->get_length(&framesCount);

for( long i=0; i <= framesCount; i++)
{
VARIANT varIdx;
varIdx.vt=VT_UINT;
VARIANT varResult;
varIdx.lVal=i;
VariantInit(&varResult);
hr = m_pFrames ->item(&varIdx, &varResult);
if (SUCCEEDED(hr)) // always fails here


GeneralRe: Getting the width of a webbrowser frame Pin
John Oliver4-Jun-03 23:00
John Oliver4-Jun-03 23:00 
Questionhow to resolve this? Pin
safee ullah4-Jun-03 1:36
safee ullah4-Jun-03 1:36 
AnswerRe: how to resolve this? Pin
Anonymous4-Jun-03 4:39
Anonymous4-Jun-03 4:39 
GeneralRe: how to resolve this? Pin
safee ullah4-Jun-03 20:12
safee ullah4-Jun-03 20:12 
GeneralRe: how to resolve this? Pin
Anonymous5-Jun-03 0:16
Anonymous5-Jun-03 0:16 
GeneralRe: how to resolve this? Pin
safee ullah5-Jun-03 1:29
safee ullah5-Jun-03 1:29 
Generaldispinterface question Pin
Brian van der Beek3-Jun-03 21:40
Brian van der Beek3-Jun-03 21:40 
GeneralRe: dispinterface question Pin
pba_4-Jun-03 7:15
pba_4-Jun-03 7:15 
GeneralRe: dispinterface question Pin
Vi25-Jun-03 1:39
Vi25-Jun-03 1:39 
GeneralRe: dispinterface question Pin
Brian van der Beek5-Jun-03 2:07
Brian van der Beek5-Jun-03 2:07 
GeneralCOM+ Queued Components not working Pin
cfoley3-Jun-03 0:16
cfoley3-Jun-03 0:16 
GeneralIDataObject with delayed rendering Pin
jiang-lei2-Jun-03 22:44
jiang-lei2-Jun-03 22:44 
QuestionBuilding COM object for folder protection?? Pin
Lalit S. Rana2-Jun-03 19:49
Lalit S. Rana2-Jun-03 19:49 
AnswerRe: Building COM object for folder protection?? Pin
Anonymous3-Jun-03 10:16
Anonymous3-Jun-03 10:16 
GeneralRe: Building COM object for folder protection?? Pin
Anonymous3-Jun-03 18:24
Anonymous3-Jun-03 18:24 
Generalasp 0177 Pin
jeff daniels2-Jun-03 19:49
jeff daniels2-Jun-03 19:49 
GeneralShell Programming ICopyHook Pin
Lalit S. Rana2-Jun-03 19:47
Lalit S. Rana2-Jun-03 19:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.