|
Hi all.
How can I get the coordinates IHTMLLIElement (Highlights, Latest releases, Using your computer, ..) at www.microsoft.com
code:
pDoc2 - pointer to the document frame containing element
pElement - pointer at the element
Text - text links
void CExplorerWindow::GetLinkRect(CComPtr<ihtmldocument2> pDoc2, CComQIPtr<ihtmlelement,&iid_ihtmlelement> pElement, BSTR Text, LPRECT Rect)
{
long Top = 0;
long Hight = 0;
long Left = 0;
long Width = 0;
CComPtr<idispatch> pDisp = NULL;
if (pWebBrowser2)
{
pWebBrowser2->get_Document (&pDisp);
if (pDisp)
{
CComPtr<ihtmldocument2> pDoc = NULL;
pDisp->QueryInterface (IID_IHTMLDocument2, (void **) &pDoc);
if (pDoc)
{
CComPtr<ihtmlframescollection2> m_frame = NULL;
pDoc->get_frames(&m_frame);
if (m_frame)
{
long len = 0;
m_frame->get_length (&len);
if (len)
{
CComQIPtr<ihtmlelement> pEl ;
if (SUCCEEDED(pDoc2->get_body(&pEl)))
{
CComQIPtr<ihtmlbodyelement> pBodyElement ;
pBodyElement = pEl;
if (pBodyElement)
{
CComQIPtr<ihtmltxtrange> pTxtRange;
pBodyElement->createTextRange(&pTxtRange);
if (pTxtRange)
{
if (pTxtRange->moveToElementText(pElement) == S_OK)
{
VARIANT_BOOL ok;
if (pTxtRange->findText(Text,wcslen(Text),0,&ok) == S_OK)
{
CComQIPtr<ihtmltextrangemetrics2> pTextRangeMetrics2;
pTextRangeMetrics2 = pTxtRange;
CComQIPtr<ihtmlrectcollection> ptrRectColl;
CComQIPtr<ihtmlrect> ptrHTMLRect;
if (pTextRangeMetrics2->getClientRects(&ptrRectColl) == S_OK)
{
long Len;
ptrRectColl->get_length(&Len);
if (Len)
{
VARIANT VarInd, VarDisp;
VarInd.vt = VT_I4;
for(int i = 0; i < Len;i++)
{
VarInd.lVal = i;
ptrRectColl->item (&VarInd, &VarDisp);
ptrHTMLRect = VarDisp.pdispVal;
long Top = 0;
long Right = 0;
long Left = 0;
long Bottom = 0;
if (ptrHTMLRect)
{
ptrHTMLRect->get_left (&Left);
ptrHTMLRect->get_top (&Top);
ptrHTMLRect->get_right (&Right);
ptrHTMLRect->get_bottom(&Bottom);
//!!! Left, Top, Right, Bottom - 0
}
SetRect(Rect, Left, Top, Right, Bottom);
}
}
else
{
pElement->get_offsetHeight(&Hight);
pElement->get_offsetWidth(&Width);
pElement->get_offsetTop(&Top);
pElement->get_offsetLeft(&Left);
IHTMLElement* pParentElement = NULL;
while (SUCCEEDED(pElement->get_offsetParent(&pParentElement)))
{
if (!pParentElement) break;
long ParentLeft, ParentTop;
pParentElement->get_offsetTop(&ParentTop);
pParentElement->get_offsetLeft(&ParentLeft);
Top += ParentTop;
Left +=ParentLeft;
pElement = pParentElement;
pParentElement->Release();
}
}
ptrRectColl.Detach();
}
}
}
}
}
}
}
else // no frames
{
CComQIPtr<ihtmlelement2> pElement2(pElement);
CComPtr<ihtmlrect> BoundingRect;
if (pElement2)
{
if (SUCCEEDED(pElement2->getBoundingClientRect(&BoundingRect)) && BoundingRect)
{
BoundingRect->get_top(&Top);
BoundingRect->get_left(&Left);
}
else
{
Top = 0; Left = 0;
}
}
pElement->get_offsetHeight(&Hight);
pElement->get_offsetWidth(&Width);
SetRect(Rect, Left, Top, Left + Width, Top + Hight);
}
}
else //m_frame == 0
{
CComQIPtr<ihtmlelement2> pElement2(pElement);
CComPtr<ihtmlrect> BoundingRect;
if (pElement2)
{
if (SUCCEEDED(pElement2->getBoundingClientRect(&BoundingRect)) && BoundingRect)
{
BoundingRect->get_top(&Top);
BoundingRect->get_left(&Left);
}
else
{
Top = 0; Left = 0;
}
}
pElement->get_offsetHeight(&Hight);
pElement->get_offsetWidth(&Width);
SetRect(Rect, Left, Top, Left + Width, Top + Hight);
}
}
}
}
if (IsRectEmpty(Rect)) Beep(200,100); - only if pElement == Highlights, Latest releases, Using your computer, ..
}
|
|
|
|
|
How can i place a file From One system to Another System using
FileSystemObject in javascript?????????
|
|
|
|
|
Hello to all,Please i need to hide my vb code in my asp.net website as all the source code is been copied to IIS when i deploy.
I ll really appreciate all replies.
Thanks
Solami
|
|
|
|
|
What do you mean by hiding your code, to whom you want to hide your code from if you think that users will access these files then you are wrong they are protected by the server itself. If you don't want to use the code behind files then you can also implement the same code inside your aspx pages but it's not recommended you should always separate the business logic with your design.
AliAmjad(MCP)
|
|
|
|
|
I want to package the application and give it to some one to deploy but i dont want im to have access to my source files.(.vb) thats why i really need to hide the code
|
|
|
|
|
If you really wanted to hide your code then why didn't you implement the logic of your application in a class library and used the reference of dll in your application, in this way you can easily encapsulate your code and prevent anyone to access it.
AliAmjad(MCP)
|
|
|
|
|
Compiling code into a DLL won't prevent someone getting hold of the source. A .NET assembly can easily be reverse-engineered by using a tool like Reflector[^]. Using an obfuscator tool will make the code more difficult to understand, but a resourceful person will still be able to reverse-engineer it. If safeguarding intellectual property is paramount, developing in .NET has its drawbacks.
Paul Marfleet
|
|
|
|
|
You can create a Web Application, which puts your code in an assembly. You might need to get an update for Visual Studio to support this.
Then when you publish select "Only files needed to run this application".
Regardless, IIS will not serve .VB files unless you manually configure the MIME type.
|
|
|
|
|
help me in asp code
i wants to create a voice forum and wants to count how many reply is posted and how much time it is read and how many user logon.
so plz help me what is the logic and code we have to use.
other work is i have two table and one table has one primary key and other have two foriegn key when i am inserting data by one post then only one reply is submited if next reply is submitted in child table then error is parrent key not found. if one more record is inserted in parent table then child table also fetch next record but one record .
i.e no of parent table record is equal to child table record .
where is the problems plz any body help me soon as possible.
sanjeev
|
|
|
|
|
idsanjeevjha wrote: where is the problems plz any body help me soon as possible.
You won't find out until you try for yourself.
Your question is of too general a nature to be answered - read the forum guidelines. The programming forums are intended for questions relating to a specific technical problem. If, during the course of developing this piece of software you do encounter some specific issues, by all means post another question.
Paul Marfleet
|
|
|
|
|
Hi,
help me..i want to change the visibility of a div control through javascript...
what i did
var c=document.getElementById(ctl00_divErrorMessageContainer);
c.style.display = 'none';
please anybody help me
|
|
|
|
|
Malayil alex wrote: var c=document.getElementById(ctl00_divErrorMessageContainer);
c.style.display = 'none';
var c=document.getElementById("ctl00_divErrorMessageContainer");
c.style.display = 'none'; also make sure this id exist in the page
|
|
|
|
|
|
Hello,
lately I looked at the Snap Shots preview widget (www.snap.com) and wondered how a specific feature has been implemented:
If you select the options (top right corner) and select something (f.e. a longer delay until the window pops up) the information is stored in a cookie belonging to the snap.com domain. This is no problem, because the options panel shown in the widget is an iframe which is loaded from the snap.com domain.
My question is now, how they get the information in the cookie belonging to the domain snap.com, if the javascript runs in the contex of a completely different domain??
It works, you can try... but how is this done? All I know is, that it is prohibited to access cookies of other domains.
Thanks! I am very interested in any ideas!
Constantin
|
|
|
|
|
I don't remember the specifics of how to accomplish this but it is probably similar to how whenever you go to any Microsoft website you first go to the passport website to get credentials.
Try Google for a writeup of how Microsoft accomplishes this. It was written up and spread on the internet a few years ago.
|
|
|
|
|
Hi Jimmy!
Thanks for your reply! I guess this may be a way to accomplish this effect.
Although the Snap widget doesn't use any redirects...
Best,
Constantin
|
|
|
|
|
Hey - Iam not sure if this is even possible with the limited API in classic ASP, but I need to find a way to forward a HTTP post request to a given URL. I need to do this to avoid a cross domain scripting issue where I cant get the target users to change their security settings. The client server is using IIS5 on windows2000 server so iam assuming I have no .net. The only other way of achieve this task instead of using classic ASP or .net is to use a console style CGI maybe - but id rather not rely on this!
Thanks for any help in advance - Mike
|
|
|
|
|
You can propagate the post parameters into some hidden form fields (using server side scripting) of a form with an action specifying the target URL and submit the form in an onload event.
|
|
|
|
|
If you are talking about having the server forward a post request, you may be able to do something like this. My VBScript is kinda rusty, so expect a bug or two:
<br />
<%<br />
Dim postData<br />
Dim xmlhttp <br />
<br />
'sample form-POST data<br />
postData = "data=100"<br />
<br />
'setup form post object<br />
'we use the XML HTTP object<br />
Set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP")<br />
<br />
'replace with the server you would like to post to<br />
'make sure "POST" is capitalized<br />
xmlhttp.Open "POST","http://my.target.server/target.asp",false<br />
<br />
'set header with Content-Type rule for a typical form post<br />
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"<br />
<br />
'send data in key=value pairs<br />
xmlhttp.send(dataToSend)<br />
<br />
'write out return response from POST<br />
Response.Write xmlhttp.responseXml.xml<br />
<br />
'destroy the http object<br />
Set xmlhttp = nothing<br />
%><br />
If you are talking about just taking the browser post point to a differant location, if it's the same server, just use:
<br />
Server.Transfer ("newlocation.asp", true)<br />
-------------------------
Spiffdog Design
It's ok.. he's no ordinary dog...
|
|
|
|
|
Does anyone have experience, good or bad, with phpBB.
I have a client who wants for me to look into this product to see if it is suitable for his web site.
If you could relay your experiences with it I would be interested in hearing about them.
Thank you.
|
|
|
|
|
JimmyRopes wrote: Does anyone have experience, good or bad, with phpBB.
I have kind of a pretty nice experience with it because once uploaded it for some client using MySQL and implemented many forums and tested it. It was kind of a reliable thing for me.
AliAmjad(MCP)
|
|
|
|
|
Thank you for your reply Ali. Glad to hear you had a good experience with it.
|
|
|
|
|
http://acsource.net/acforum/viewforum.php?f=1&sid=770d21a72edd773153898ec359d84e0e
I like it but I like some others better. phpBB, a little simple
http://www.driveaccord.net/forums/index.php?s=94f76578d5359d487102da5889d7eacd
vBulletin, pretty. This may be my new favorite.
http://www.honda-tech.com/zerosearch?cmd=activethreads
zeroforum, not as pretty, the best for me for all around use. Might fall back to second.
This is from a user stand point.
|
|
|
|
|
Thank you for the links. I'll look into them.
|
|
|
|
|
Yeah. phpBB is nice one.. but you have to careful in choosing the anti-spam plug-ins... because a lot of spambot knows so well about phpbb. one of my friends run the forum by using phpBB once.. he was not able to flight the spam then he shut down the site finally.
everything has good points and weak points.. so, if you wanna know about the bad point, you may google it. phpbb sucks[^]
|
|
|
|