Click here to Skip to main content
15,920,102 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Tricky C++ question Pin
YaronNir29-Oct-03 23:26
YaronNir29-Oct-03 23:26 
GeneralRe: Tricky C++ question Pin
Juan Antonio Bermejo29-Oct-03 23:32
Juan Antonio Bermejo29-Oct-03 23:32 
GeneralRe: Tricky C++ question Pin
YaronNir29-Oct-03 23:38
YaronNir29-Oct-03 23:38 
GeneralRe: Tricky C++ question Pin
Juan Antonio Bermejo30-Oct-03 21:21
Juan Antonio Bermejo30-Oct-03 21:21 
GeneralSysIPAddress32 in VC++ 5.0 Pin
Phil.Benson29-Oct-03 22:44
professionalPhil.Benson29-Oct-03 22:44 
GeneralRe: SysIPAddress32 in VC++ 5.0 Pin
saarfu15-Dec-09 4:51
saarfu15-Dec-09 4:51 
GeneralRe: SysIPAddress32 in VC++ 5.0 Pin
Phil.Benson15-Dec-09 5:26
professionalPhil.Benson15-Dec-09 5:26 
GeneralIHTMLDOMNode appendChild return E_INVALIDARG Pin
ShayAmar29-Oct-03 21:50
ShayAmar29-Oct-03 21:50 
Hi,

I need some help please.
I tried to figure it out, but with no success so far.
Why do I get E_INVALIDARG when I try to use the appendChild Function.
This is my source code:


IHTMLElement* pHTMLElement;
IHTMLElement* pNewHTMLElement;
IHTMLDOMNode* pHTMLDOMNode;
IHTMLDOMNode* pNewHTMLDOMNode;
IHTMLDOMNode* pNew2HTMLDOMNode;
IDispatch* pDisp;


v.vt = VT_BSTR;
v.bstrVal = SysAllocString(L"HEAD");

hResult = pIHTMLElementCollection->tags(v,&pDisp );

if (hResult == S_OK)

{
hResult = pDisp->QueryInterface(IID_IHTMLElementCollection,(void**)&pIHTMLElementCollection);
if (hResult == S_OK)
{
pIHTMLElementCollection->get_length(&lCollectionSize);

v.vt = VT_I4;
v.lVal = 0;

hResult = pIHTMLElementCollection->item(v,v,&pDisp);

if (hResult == S_OK && pDisp != NULL)
{
hResult = pDisp->QueryInterface(IID_IHTMLElement,(void**)&pHTMLElement);
if (hResult == S_OK)
{
hResult = pHTMLElement->QueryInterfa(IID_IHTMLDOMNode,(void**)&pHTMLDOMNode);

if (hResult == S_OK)
{
bstrTemp = SysAllocString(L"BASE");
hResult = pIHTMLDocument2->createElement(bstrTemp, &pNewHTMLElement);
SysFreeString(bstrTemp);

if (hResult == S_OK)
{
bstrTemp = SysAllocString(L"href");
v.vt = VT_BSTR;
v.bstrVal = strWebPageDomain.GetBuffer();

hResult = pNewHTMLElement->setAttribute(bstrTemp, v, 0);

SysFreeString(bstrTemp);

if (hResult == S_OK)
{
hResult = pNewHTMLElement->QueryInterface(IID_IHTMLDOMNode,(void**)&pNewHTMLDOMNode);
if (hResult == S_OK)
{


****************************************************************************
hResult = pHTMLDOMNode->appendChild(pNewHTMLDOMNode, &pNew2HTMLDOMNode);

****************************************************************************
}
}

}
}
}
}
}
}
}
}






GeneralAdd Attachment with Outlook2000 Automation Pin
NaturalBornChilla29-Oct-03 21:08
NaturalBornChilla29-Oct-03 21:08 
GeneralManipulating File Open/Save Filters Pin
Sreeramachandra29-Oct-03 20:34
Sreeramachandra29-Oct-03 20:34 
Generalfinding the IOCTRL for a Driver Pin
Fad B29-Oct-03 20:14
Fad B29-Oct-03 20:14 
GeneralRe: finding the IOCTRL for a Driver Pin
Alexander M.,30-Oct-03 2:37
Alexander M.,30-Oct-03 2:37 
QuestionCan anyone spot my mistake? Pin
georgiek5029-Oct-03 19:06
georgiek5029-Oct-03 19:06 
AnswerRe: Can anyone spot my mistake? Pin
Michael Dunn29-Oct-03 19:11
sitebuilderMichael Dunn29-Oct-03 19:11 
AnswerRe: Can anyone spot my mistake? Pin
Chris Meech30-Oct-03 3:01
Chris Meech30-Oct-03 3:01 
GeneralWhy download html page fail sometimes? I use CHtmlview(vc 6.0) Pin
5200131429-Oct-03 18:58
5200131429-Oct-03 18:58 
GeneralObject-Oriented Classes HELP Pin
bwestend29-Oct-03 17:38
bwestend29-Oct-03 17:38 
GeneralPLEASE HELP ME!!!!!!!!!!!!!!!!!!!!!!!! Pin
bwestend29-Oct-03 17:39
bwestend29-Oct-03 17:39 
GeneralRe: Object-Oriented Classes HELP Pin
Michael Dunn29-Oct-03 19:08
sitebuilderMichael Dunn29-Oct-03 19:08 
GeneralRe: Object-Oriented Classes HELP Pin
bwestend29-Oct-03 19:41
bwestend29-Oct-03 19:41 
GeneralRe: Object-Oriented Classes HELP Pin
Terry O'Nolley29-Oct-03 19:56
Terry O'Nolley29-Oct-03 19:56 
GeneralRe: Object-Oriented Classes HELP Pin
Steve S29-Oct-03 22:34
Steve S29-Oct-03 22:34 
GeneralRe: Object-Oriented Classes HELP Pin
Atlantys30-Oct-03 8:48
Atlantys30-Oct-03 8:48 
GeneralRe: Object-Oriented Classes HELP Pin
Alexander M.,30-Oct-03 2:47
Alexander M.,30-Oct-03 2:47 
GeneralRe: Object-Oriented Classes HELP Pin
Terry O'Nolley29-Oct-03 19:59
Terry O'Nolley29-Oct-03 19: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.