Click here to Skip to main content
15,906,947 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reading registry with windows services. Pin
VampireLord14-Nov-05 2:45
VampireLord14-Nov-05 2:45 
GeneralRe: Reading registry with windows services. Pin
Curtis Schlak.14-Nov-05 3:22
Curtis Schlak.14-Nov-05 3:22 
QuestionAccessing member variables in destructor Pin
Stylez Daviz13-Nov-05 1:39
Stylez Daviz13-Nov-05 1:39 
AnswerRe: Accessing member variables in destructor Pin
S. Senthil Kumar13-Nov-05 4:31
S. Senthil Kumar13-Nov-05 4:31 
GeneralRe: Accessing member variables in destructor Pin
Stylez Daviz13-Nov-05 5:42
Stylez Daviz13-Nov-05 5:42 
GeneralRe: Accessing member variables in destructor Pin
J4amieC13-Nov-05 10:54
J4amieC13-Nov-05 10:54 
QuestionHelp in C# Pin
myrama13-Nov-05 1:12
myrama13-Nov-05 1:12 
AnswerRe: Help in C# Pin
Christian Graus13-Nov-05 10:33
protectorChristian Graus13-Nov-05 10:33 
QuestionA problem about [xml-serialization and NHibernate] Pin
[chn]striker13-Nov-05 0:53
[chn]striker13-Nov-05 0:53 
Question-Images not Showing in Toolbars Pin
wgroves12-Nov-05 23:42
wgroves12-Nov-05 23:42 
QuestionConvert to C# syntax Pin
dabuskol12-Nov-05 20:12
dabuskol12-Nov-05 20:12 
AnswerRe: Convert to C# syntax Pin
Allah On Acid12-Nov-05 20:52
Allah On Acid12-Nov-05 20:52 
GeneralRe: Convert to C# syntax Pin
dabuskol12-Nov-05 21:00
dabuskol12-Nov-05 21:00 
GeneralRe: Convert to C# syntax Pin
Allah On Acid12-Nov-05 21:03
Allah On Acid12-Nov-05 21:03 
AnswerRe: Convert to C# syntax Pin
Joshua Quick12-Nov-05 22:35
Joshua Quick12-Nov-05 22:35 
GeneralRe: Convert to C# syntax Pin
leppie13-Nov-05 0:09
leppie13-Nov-05 0:09 
Questionhtmleditor Pin
munmat12-Nov-05 13:09
munmat12-Nov-05 13:09 
QuestionClose Child Form Pin
Tyler4512-Nov-05 10:40
Tyler4512-Nov-05 10:40 
AnswerRe: Close Child Form Pin
Colin Angus Mackay12-Nov-05 11:37
Colin Angus Mackay12-Nov-05 11:37 
AnswerRe: Close Child Form Pin
da vinci coder12-Nov-05 15:45
da vinci coder12-Nov-05 15:45 
GeneralRe: Close Child Form Pin
Tyler4513-Nov-05 18:25
Tyler4513-Nov-05 18:25 
QuestionInternet Explorer frames errors Pin
David Bicknell12-Nov-05 10:15
David Bicknell12-Nov-05 10:15 
I have an automation program in C# (latest version with .Net 2.0) that takes control of an instance of IE 6.0 using ShDocVw.dll reference. The other reference is the .NET Microsoft.mshtml.dll. When you navigate to a page with frames, only the top frame is available to use as a document object. I want to programmatically click on a link that is in a frame. I have tried everything to get a reference to the frame and I am getting casting errors in VS. For instance:

InternetExplorer ie = new InternetExplorerClass();
ie.Visible = true;
string url = "http://www.iopus.com/iim/demo/v4/frames/";
Object o = null;
ie.Navigate(url, ref o, ref o, ref o, ref o);
//put a stop here to give time to load all the frames
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)ie.Document;

IHTMLElementCollection fcollection = (IHTMLElementCollection)doc.getElementsByTagName("FRAME");
IEnumerator fEnum = fcollection.GetEnumerator();
fEnum.Reset();
fEnum.MoveNext();
foreach (HTMLFrameElement fElement in fcollection)
{
Console.WriteLine(fElement.tagName + fElement.name);
if (fElement.name == "bottom")
{
object frmNo = 8;
// here it is...
mshtml.IHTMLWindow2 frame = (mshtml.IHTMLWindow2)doc.frames.item(ref frmNo);
}
}

The cast for IHTMLWindow2 does not work. I have tried casting to other things like HTMLDocument, etc and nothing will cast.

The only thing I have found so far that works is to take the src url of the frame and navigate directly to it, then I have the document object available to work with. This method seems wrong. I should be able to enumerate the frames collection and then work with each frame individually.

Has anyone had any luck doing this correctly?

David Bicknell
Questionproblem to set AllowDrop from callback Pin
xjsun12-Nov-05 10:03
xjsun12-Nov-05 10:03 
AnswerRe: problem to set AllowDrop from callback Pin
Leslie Sanford12-Nov-05 10:23
Leslie Sanford12-Nov-05 10:23 
GeneralRe: problem to set AllowDrop from callback Pin
xjsun12-Nov-05 11:39
xjsun12-Nov-05 11:39 

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.