Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: Formatting numbers Pin
Stephane Rodriguez.21-Apr-03 8:17
Stephane Rodriguez.21-Apr-03 8:17 
GeneralRe: Formatting numbers Pin
Alvaro Mendez21-Apr-03 9:41
Alvaro Mendez21-Apr-03 9:41 
GeneralRe: Formatting numbers Pin
Stephane Rodriguez.21-Apr-03 10:15
Stephane Rodriguez.21-Apr-03 10:15 
GeneralRe: Formatting numbers Pin
Alvaro Mendez21-Apr-03 11:04
Alvaro Mendez21-Apr-03 11:04 
GeneralNewbie...DLL/Friend Pin
Kant21-Apr-03 4:46
Kant21-Apr-03 4:46 
GeneralRe: Newbie...DLL/Friend Pin
Kant21-Apr-03 6:38
Kant21-Apr-03 6:38 
GeneralRe: Newbie...DLL/Friend Pin
Alvaro Mendez21-Apr-03 6:46
Alvaro Mendez21-Apr-03 6:46 
GeneralHELP! Making getexternal a usable object!!! Pin
LongRange.Shooter21-Apr-03 3:59
LongRange.Shooter21-Apr-03 3:59 
HISTORY: I'm trying to get the javascript in a page to execute a method in my FAT client. I implemented the DLL from the article here on implementing IDocHostUIHandler. I implemented my own interface. I know IDocHostUIHandler is properly hooked because I am stopping the context menues from displaying.

I was given a quick hint to look at window.getexternal so that window.external does not error with a null object error. BUT now I am getting a null object on window.getexternal. AAAArrrrggghhh. So can anyone tell me where I'm screwing up???? Here are my code pieces:
my html test:
<br />
<HTML><br />
<HEAD><br />
<Title> Test of hooking into IDocHostUIHandler </Title><br />
	<script language="JavaScript" id="clientEventHandlersJS"><br />
	<!--<br />
	function callHostUI(sectionName)<br />
	{<br />
		window.getexternal.ClickEventHandler();<br />
		window.external.ClickEventHandler(sectionName);<br />
	}<br />
	--><br />
	</script><br />
</HEAD><br />
<body><br />
<INPUT id="btnExit" onclick='callHostUI("The test finally worked")' style="Z-INDEX: 102; LEFT: 15px; <br />
WIDTH: 108px; COLOR: white; BORDER-TOP-STYLE: none; FONT-STYLE: normal; <br />
FONT-FAMILY: 'Book Antiqua'; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: <br />
none; POSITION: absolute; TOP: 227px; HEIGHT: 40px; BACKGROUND-COLOR: navy; <br />
BORDER-BOTTOM-STYLE: none" type="button" value="Test GetExternal"><br />
</body><br />
</HTML><br />


my interface implementation:
<br />
interface IPageClickHandler<br />
{<br />
	void ClickEventHandler(string SectionName);<br />
}<br />
<br />
namespace myProgramNamespace<br />
{<br />
	/// <summary><br />
	/// Summary description for pageEditor.<br />
	/// </summary><br />
	public class pageEditor : System.Windows.Forms.Form, IPageClickHandler, IDocHostUIHandler<br />


my IDocHostUIHandler implementation:
<br />
			InitializeComponent();<br />
			holdPageName = pageName;<br />
			object flags = 0;<br />
			object targetFrame = String.Empty;<br />
			object postData = String.Empty;<br />
			object headers = String.Empty;<br />
			this.showWebPage.Navigate("about:blank", ref flags, ref targetFrame, ref postData, ref headers);<br />
			ICustomDoc cDoc = (ICustomDoc)this.showWebPage.Document;<br />
			cDoc.SetUIHandler((IDocHostUIHandler)this);<br />
			this.showWebPage.Navigate(@"D:\TestHTMLData\TestConversation.html", ref flags, ref targetFrame, ref postData, ref headers);<br />

and my getexternal implementation

<br />
		void IDocHostUIHandler.GetExternal([MarshalAs(UnmanagedType.IDispatch)] out object ppDispatch)<br />
		{<br />
			ppDispatch= (IPageClickHandler)this;<br />
			throw new COMException("", S_OK);<br />
		}<br />


No matter what I try, I keep getting window.getexternal is a null object! If I try window.GetExternal I get an error that the method does not exist, so my method call must be somewhat correct. I've tried the call as
window.getexternal.mymethod()

and I tried it as
window.getexternal.myinterface()

both return a null object error.
So what the heck am I doing wrong????? Unsure | :~ I cannot figure it out! Eek! | :eek:

Thanks for ANY help,

MJ

_____________________________________________
The world is a dangerous place.
Not because of those that do evil,
    but because of those who look on and do nothing.

GeneralRe: HELP! Making getexternal a usable object!!! Pin
Stephane Rodriguez.21-Apr-03 8:03
Stephane Rodriguez.21-Apr-03 8:03 
GeneralRe: HELP! Making getexternal a usable object!!! Pin
LongRange.Shooter21-Apr-03 8:37
LongRange.Shooter21-Apr-03 8:37 
GeneralRe: HELP! Making getexternal a usable object!!! Pin
Stephane Rodriguez.21-Apr-03 10:01
Stephane Rodriguez.21-Apr-03 10:01 
GeneralRe: HELP! Making getexternal a usable object!!! Pin
LongRange.Shooter22-Apr-03 3:31
LongRange.Shooter22-Apr-03 3:31 
GeneralRe: HELP! Making getexternal a usable object!!! Pin
Stephane Rodriguez.22-Apr-03 4:43
Stephane Rodriguez.22-Apr-03 4:43 
GeneralRe: HELP! Making getexternal a usable object!!! Pin
LongRange.Shooter22-Apr-03 7:41
LongRange.Shooter22-Apr-03 7:41 
GeneralRe: HELP! Making getexternal a usable object!!! Pin
LongRange.Shooter22-Apr-03 8:11
LongRange.Shooter22-Apr-03 8:11 
GeneralObjects' Binary Representation Pin
fesenjoon21-Apr-03 3:30
fesenjoon21-Apr-03 3:30 
GeneralRe: Objects' Binary Representation Pin
Stephane Rodriguez.21-Apr-03 7:42
Stephane Rodriguez.21-Apr-03 7:42 
GeneralMicrosoft's ShellCmd sample freezes windows Pin
2sky21-Apr-03 2:45
2sky21-Apr-03 2:45 
GeneralRe: Microsoft's ShellCmd sample freezes windows Pin
Stephane Rodriguez.21-Apr-03 5:33
Stephane Rodriguez.21-Apr-03 5:33 
GeneralRe: Microsoft's ShellCmd sample freezes windows Pin
2sky21-Apr-03 11:57
2sky21-Apr-03 11:57 
GeneralGetting properties into Property grid (at runtime) Pin
peterchen20-Apr-03 22:05
peterchen20-Apr-03 22:05 
GeneralRe: Getting properties into Property grid Pin
Stephane Rodriguez.20-Apr-03 22:46
Stephane Rodriguez.20-Apr-03 22:46 
GeneralRe: Getting properties into Property grid Pin
peterchen20-Apr-03 22:52
peterchen20-Apr-03 22:52 
GeneralCreating a struct with an fixed array Pin
Mikaelr20-Apr-03 20:51
Mikaelr20-Apr-03 20:51 
GeneralRe: Creating a struct with an fixed array Pin
Stephane Rodriguez.20-Apr-03 22:58
Stephane Rodriguez.20-Apr-03 22:58 

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.