Click here to Skip to main content
15,922,145 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralConverting an in-proc server to out-of-proc server Pin
Roozbeh6922-Feb-04 21:55
professionalRoozbeh6922-Feb-04 21:55 
GeneralRe: Converting an in-proc server to out-of-proc server Pin
Jörgen Sigvardsson23-Feb-04 10:46
Jörgen Sigvardsson23-Feb-04 10:46 
GeneralRe: Converting an in-proc server to out-of-proc server Pin
Vi223-Feb-04 20:17
Vi223-Feb-04 20:17 
GeneralMenu in IE window Pin
Abhi Lahare22-Feb-04 18:37
Abhi Lahare22-Feb-04 18:37 
GeneralAttaching string wrapper to preallocated string Pin
Alvin77720-Feb-04 21:25
Alvin77720-Feb-04 21:25 
GeneralRe: Attaching string wrapper to preallocated string Pin
Michael Dunn22-Feb-04 5:55
sitebuilderMichael Dunn22-Feb-04 5:55 
QuestionIDocHostUIHandler::ShowUI?? Pin
Abhi Lahare20-Feb-04 19:10
Abhi Lahare20-Feb-04 19:10 
GeneralBHO reading HTML input value Pin
macattack20-Feb-04 10:53
macattack20-Feb-04 10:53 
I am trying to read an html page and retrieve the value of three hidden input fields sure as:
<input name=port type=hidden value=1500>

VC++6.0/ATL/BHO -- Below is the code I am working with to read in the value (1500) but it is not working. I think i am missing something.

HRESULT hr;
TCHAR sPort[25];
IDispatch* pElemDisp = NULL;
IHTMLInputHiddenElement* pElem = NULL;
IHTMLElementCollection *pElemcoll;

// Get the WebBrowser's document object
CComPtr<IDispatch> pDisp;
HRESULT hr = m_spWebBrowser2->get_Document(&pDisp);
if (FAILED(hr)) return false;

CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTML;
spHTML = pDisp;

_variant_t tagName("input");
_variant_t tagNamePort("port");

BSTR* pValuePort = NULL;

spHTML->get_forms(&pElemcoll);

hr = pElemColl->tags( tagName, &pElemDisp );
if ( SUCCEEDED(hr) )
{
hr = pElemDisp->QueryInterface( IID_IHTMLInputHiddenElement, (void**)&pElem );
if ( SUCCEEDED(hr) )
{
hr = pElem->get_value(pValuePort);
if ( SUCCEEDED(hr) )
{
//Set port
_stprintf(sPort, _T("%s"), (LPCTSTR)pValuePort);
m_sPort = (int)sPort;
}
pElem->Release();
}
pElemDisp->Release();
}

//at this point m_sPort is NULL not 1500 Frown | :-(
I think I may not be handling the Element Collection object correctly. Any pointers as to where i am going wrong?
Thank you for any help you can give..
GeneralRe: BHO reading HTML input value Pin
Michael Dunn20-Feb-04 17:12
sitebuilderMichael Dunn20-Feb-04 17:12 
GeneralBuild ATL Server problem Pin
Member 4337820-Feb-04 3:28
Member 4337820-Feb-04 3:28 
GeneralRe: Build ATL Server problem Pin
macattack20-Feb-04 10:57
macattack20-Feb-04 10:57 
GeneralRe: IObjectWithSite in ATL Object Wizard Pin
Abhi Lahare19-Feb-04 22:21
Abhi Lahare19-Feb-04 22:21 
GeneralIObjectWithSite in ATL Object Wizard Pin
Abhi Lahare19-Feb-04 19:42
Abhi Lahare19-Feb-04 19:42 
GeneralRe: IObjectWithSite in ATL Object Wizard Pin
Jörgen Sigvardsson19-Feb-04 21:42
Jörgen Sigvardsson19-Feb-04 21:42 
GeneralAtrocious template library Pin
Anonymous19-Feb-04 5:48
Anonymous19-Feb-04 5:48 
GeneralRe: Atrocious template library Pin
Daniel Turini19-Feb-04 5:55
Daniel Turini19-Feb-04 5:55 
GeneralRe: Atrocious template library Pin
Jörgen Sigvardsson19-Feb-04 7:16
Jörgen Sigvardsson19-Feb-04 7:16 
GeneralRe: Atrocious template library Pin
Balkrishna Talele24-Feb-04 0:09
Balkrishna Talele24-Feb-04 0:09 
Questionhow to pass activeX control as parameter from client to server? Pin
hongzterr19-Feb-04 5:17
susshongzterr19-Feb-04 5:17 
GeneralCreateFromFile() ,CreateFromClipboard(),CreateFromData() Pin
anshumanshinde18-Feb-04 1:02
anshumanshinde18-Feb-04 1:02 
GeneralRe: CreateFromFile() ,CreateFromClipboard(),CreateFromData() Pin
Anonymous19-Feb-04 13:04
Anonymous19-Feb-04 13:04 
GeneralRe: CreateFromFile() ,CreateFromClipboard(),CreateFromData() Pin
anshumanshinde19-Feb-04 18:06
anshumanshinde19-Feb-04 18:06 
Generalagain, Using COM+ services Pin
Roozbeh6917-Feb-04 20:31
professionalRoozbeh6917-Feb-04 20:31 
GeneralRe: Using COM+ services Pin
Steve S17-Feb-04 22:12
Steve S17-Feb-04 22:12 
GeneralRe: Using COM+ services Pin
Steve S18-Feb-04 1:59
Steve S18-Feb-04 1:59 

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.