Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
dbeaugez  
#1 Posted : Sunday, July 24, 2005 10:29:00 AM(UTC)
dbeaugez

Rank: Member

Groups: Member
Joined: 1/2/2004(UTC)
Posts: 2

I've been using the ActiveX bitmap viewer for some time now in an HTA file (thanks to your example). But now I'd like to use it in an HTM file. When doing that, IE6 complains about there being an unsave ActiveX object. I can handle creating a wrapper for things like GraphicsMill.Bitmap (in my case using C#) that implements IObjectSafety. But what can I do about the bitmap viewer, which is loaded using the HTML Object tag?

Here's a trivial piece of code that demonstrates the issue. It's interesting that the viewer will load but complains when attaching the event (or calling any method).

Code:
<html>
	<head>
	<script for="bitmapViewer1" event="MouseDown(button, shift, x, y)" language="JavaScript">
		alert("Mouse Down");
	</script>

	</head>
	<body>
	<object id="bitmapViewer1" name="bitmapViewer1" classid="clsid:C5B6FED0-DEA2-4A82-B585-9B952C959838" 
		width="800" height="600" viewastext
		style="border: 3px red solid;">
	</object>
		
	</body>
</html>


Again, my objective is to get this to run from an HTM file without the IE ActiveX warnings. (Would the .NET version help?)

Thanks
Donald Beaugez

Edited by user Sunday, December 23, 2007 5:49:51 PM(UTC)  | Reason: Not specified

Fedor  
#2 Posted : Monday, July 25, 2005 9:57:00 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,530

Thanks: 4 times
Was thanked: 53 time(s) in 52 post(s)
Hello Donald,

I think you can wrap Graphics Mill Bitmap Viewer control into your own control using VB6 or C++code. After it should mark your control as safe for scripting.
Best regards,
Fedor Skvortsov
Andrew  
#3 Posted : Monday, July 25, 2005 9:59:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 866

Thanks: 2 times
Was thanked: 26 time(s) in 26 post(s)
If you need to load ActiveX control without security warning, you have to tweak security settings in the Internet Explorer. With default security settings it will:

- silently suppress unsigned ActiveX control;
- display security dialog for signed ActiveX controls ("are you sure you want to install ...").

Not sure whether .NET will help you to avoid security warnings. Anyway, you will have to edit security policy for it (even for pure .NET control).

Also, if the wrapper is not marked as "Safe for Scripting", it will not work even if you sign the control. You mention that you implement IObjectSafety interface - what flags are returned by GetInterfaceSafetyOptions? Btw, alternatively you can add the control to CATID_SafeForScripting category instead of implementing IObjectSafety interface.

Hope this helps.
dbeaugez  
#4 Posted : Tuesday, July 26, 2005 5:29:00 AM(UTC)
dbeaugez

Rank: Member

Groups: Member
Joined: 1/2/2004(UTC)
Posts: 2

I tried adding the CATID_SafeForScripting entries to the viewer - see below - but I still get the warning popup.

Code:
[HKEY_CLASSES_ROOT\CLSID\{C5B6FED0-DEA2-4A82-B585-9B952C959838}]
@="Aurigma Graphics Mill 2.0 Bitmap Viewer"
"AppID"="{FDF99D47-11A7-4551-A7D4-26A2FBDDAAC6}"


[HKEY_CLASSES_ROOT\CLSID\{C5B6FED0-DEA2-4A82-B585-9B952C959838}\Implemented Categories]
@=""

[HKEY_CLASSES_ROOT\CLSID\{C5B6FED0-DEA2-4A82-B585-9B952C959838}\Implemented Categories\7DD95801-9882-11CF-9FA9-00AA006C42C4]
@=""

[HKEY_CLASSES_ROOT\CLSID\{C5B6FED0-DEA2-4A82-B585-9B952C959838}\Implemented Categories\7DD95802-9882-11CF-9FA9-00AA006C42C4]
@=""




As for the IObjectSafety flags -- here's what I using. As I said, these work well in other situations.

Code:
private const int INTERFACESAFE_FOR_UNTRUSTED_CALLER = 0x00000001;
private const int INTERFACESAFE_FOR_UNTRUSTED_DATA = 0x00000002;

public int GetInterfaceSafetyOptions(ref Guid riid, out int pdwSupportedOptions, out int pdwEnabledOptions)
{
	pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA;
	pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA;
	return 0;
}


thanks

Edited by user Sunday, December 23, 2007 5:45:41 PM(UTC)  | Reason: Not specified

Andrew  
#5 Posted : Tuesday, July 26, 2005 1:06:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 866

Thanks: 2 times
Was thanked: 26 time(s) in 26 post(s)
You need to put a wrapper to category, not the control itself.

There are two kind of protection in Internet Explorer:
  • Protection from being installed.
  • Protection from being used in JavaScript.
Marking an object as "Safe for Scripting" removes the second kind of protection. But you will still have problems during installation (unless you install the control manually). Or it is not a problem?

Edited by user Sunday, December 23, 2007 5:45:59 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.