|
How can I set an icon to an ActiveX Control in the Internet Explorer 8 Manage-Addons-Dialog.
I know how to do it with a Browser-Extension but not how to do it with an ActiveX Control.
I even can't find any example.
Any help or tip would be great!
|
|
|
|
|
Juergen wrote: I know how to do it with a Browser-Extension but not how to do it with an ActiveX Control.
I even can't find any example.
Any help or tip would be great!
Do you have a link to information saying it can be done?
|
|
|
|
|
No I do not have a link to information saying it can be done but also no that it cannot be done.
I supposed if the Control has a place for Icons, then there should be a way to display one for each element not only Browser-Extensions.
|
|
|
|
|
Juergen wrote: I supposed
Well that doesn't give me any information to investigate with so I guess I can't help. Good luck.
|
|
|
|
|
Could you please describe how to add icon in IE8 Manage-Addons-Dialog for the Browser-Extension?
|
|
|
|
|
You have to add an registry-entry.
Here is an example:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Extensions\{FB5F1910-F110-11d2-BB9E-00C04F795683}]
"ButtonText"="Messenger"
"CLSID"="{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}"
"Default Visible"="Yes"
"Exec"="C:\\Programme\\Messenger\\msmsgs.exe"
"HotIcon"="C:\\Programme\\Messenger\\msmsgs.exe,302"
"Icon"="C:\\Programme\\Messenger\\msmsgs.exe,301"
"MenuText"="Windows Messenger"
"ToolTip"="Windows Messenger"
HotIcon/Icon also could be a path to a "Image.ico"
|
|
|
|
|
Hm, I think I asked the wrong question.
Under the "Browser extensions" I mean also the objects such as BHOs and custom ToolBands.
The one way I know to add icon for this object is to create a key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Extensions\<GUID> where GUID is a CLSID of my BHO or ToolBand object. In this key I specify the ButtonText and Icon values.
After this manipulations I have:
1)Additional record in Manage Add-ons window
2)Icons for both records with specified CLSID.
In this solution I don't like additional record in Manage Add-ons window. I will appreciate if someone will describe how to add icon for BHO or ToolBand without adding additional record in Manage Add-ons window.
|
|
|
|
|
i am not sure how i would do this but i am trying to modify the code below to take a directory entry and check the last logon time on eache domain controler currently it does a directory sear on each domain controler and it becomes unresponsive (this method is being call 1 time for each user on my domain i have over 3,000 users and i already have a DictionaryEntry object created
public DateTime LastLogon(string user, string domain)
{
DirectoryContext context = new DirectoryContext(DirectoryContextType.Domain, domain);
DateTime latestLogon = DateTime.MinValue;
string servername = null;
bool processed = false;
DomainControllerCollection dcc = DomainController.FindAll(context);
foreach (DomainController dc in dcc)
{
DirectorySearcher ds;
//System.Console.WriteLine(dc.Name);
bool exist = false;
using (dc)
using (ds = dc.GetDirectorySearcher())
{
ds.Filter = String.Format("(sAMAccountName={0})", username);
ds.PropertiesToLoad.Add("lastLogon");
dc.GetDirectoryEntry
ds.SizeLimit = 1;
// this search is killing my server
SearchResult sr = ds.FindOne();
if (sr != null)
{
DateTime lastLogon = DateTime.MinValue;
if (sr.Properties.Contains("lastLogon"))
{
exist = true;
lastLogon = DateTime.FromFileTime((long)sr.Properties["lastLogon"][0]);
}
if (DateTime.Compare(lastLogon, latestLogon) > 0)
{
latestLogon = lastLogon;
servername = dc.Name;
}
}
}
}
return latestLogon;
}
|
|
|
|
|
I think you might have got the wrong forum - your post certainly has nothing to do with COM - I suspect you may get more assistance posting in the C# forum.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I have one existing idl file(Add.idl) where the interface and the library is look like the following
interface IAdd:IDispatch
{
[id(1), AddNumber("Add two number")]
}
library ADDLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(339171FF-A6E7-433F-A314-FF740F53FE56),
helpstring("Add Class")
]
coclass Add {
[default] interface IAdd;
};
};
Now I need to create one new ATL project which will import this file(Add.idl) and my interface will be derived from IAdd interface.
Then I will have to implement the AddNumber() method described in IAdd interface along with some new methods that will be present
in the newly implemented interface.
So,after implementation my idl file should look like this
import "Add.idl";
interface Isample:IAdd
{
};
Can any one tell me the steps how to implement this in VS2008.
I am very new to this , please help me..
|
|
|
|
|
kakamoni wrote: Can any one tell me the steps how to implement this in VS2008
Microsoft can[^].
Obviously at some point you'll need to edit the generated IDL to import your IDL, but this takes you 99% of the way there...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I have a custom interface and my own interface with me. Now I want to develop an interface supporting those wo interfaces without any coclass.
Can I do this in COM. If yes, pls tell me how to do this.
Thanks for your help
|
|
|
|
|
kuttiam wrote: Now I want to develop an interface supporting those wo interfaces
'Support' in what way? Give us some detail - the question you've posed is so vague that it's impossible to answer with any confidence, 'cause I'm not sure what you're really asking for.
kuttiam wrote: without any coclass.
Can I do this in COM
If you need to create COM objects, then at some point you're going to be needing a co-class, so the answer's likely to be no.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
kuttiam wrote: without any coclass.
kuttiam wrote: Can I do this in COM
No.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I am trying to instantiate a COM object of class GPM (gpmgmt.h and gpmgmt.dll) using CoCretateInstance. It returns "0x80040154 Class not registerd" error. The code snippet is -
::CoCreateInstance( __uuidof(GPM), // CLSID_GPM
NULL,
CLSCTX_LOCAL_SERVER,
__uuidof(IGPM), // IID_IGPM
(void **)&m_IGPMObj);
, where m_IGPMObj is a IGPM pointer.
I am building my code with VS2005 in XP Professional SP2.
The required header file and idl file are present in my machine, but not the dll (I dont know why). MSDN suggests that the dll is available in vista and 2008 server and redistributable for 2003 server and XP SP1. I have searched the dll in 2008 server and vista, it is not there also. I also tried to install GPMC in a XP SP3 machine, it simply fails saying that - LoadLibray fails.
Any help is appriciated.
|
|
|
|
|
If the DLL's not present then no, the class won't be registered. Big surprise. So, your problem boils down to 'why can't you install GPMC'?
You could use Dependency Walker[^] (specifically its 'Profile' feature) to see what LoadLibrary call is failing - open msiexec with Dependency walker, then in the Profile options, set the gpmc MSI file as a command line argument and run it.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
Try the following....
Go to the .Net command prompt & enter the command below:
RegAsm api_name.dll /tlb:api_Name.tlb /codebase
Note: It will register into GAC & export a tlb file.
Thanks
Md. Marufuzzaman
|
|
|
|
|
I use __try and __except in my code to catch exception.But it doesn't work.Who can tell me how to catch exception in COM?Thanks in advance.
modified on Wednesday, July 22, 2009 3:07 AM
|
|
|
|
|
What sort of exception - what's throwing it?
__try and __except == structured exceptions[^], IIRC.
try and catch == C++ exceptions[^]
COM, on the other hand, doesn't throw exceptions - it returns status codes in HRESULTs. Which is why I ask - where do these exceptinos come from?! Share some code, man!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
for instance, there is a method in COM named f defined as followed
void f()
{
__try
{
int* pInt = NULL:
*pInt = 0;
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
printf("exception!\n");
}
}
when I call f(), an exception is raised and the programe crash.
|
|
|
|
|
That's COM? Mmmmm.
denghp wrote: int* pInt = NULL:
*pInt = 0;
Look at your code. You're writing to a null pointer. Yes, you get an access violation. What is pInt meant to point at?
The problem you need to solve is not catching the exception - your problem is rewriting the code so it doesn't cause the access violation in the first case.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I just want to test if __try and __except is in effect, so I write codes like that.The result is it doesn't work.
|
|
|
|
|
So....your question had nothing to do with COM...OK
Anyway - I wrote this sample program:
#include <windows.h>
#include <iostream>
int f()
{
__try
{
*(int*)0 = 0;
std::cout << "good!\n";
}
__except( EXCEPTION_EXECUTE_HANDLER)
{
std::cout << "exception!\n";
}
return 3;
}
int main()
{
f();
}
and compiled it with VS2008 using the command cl -EHa a.cpp (you apparently need -EHa for structured exception handling to work correctly).
As expected, it printed exception! - the structured exception handler was called correctly.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
OK,I will check my project configuration.Thank you very much.
|
|
|
|
|
Hi,
I think you should through the exception from you COM+ function, & show / manage detail from where you call the function. Like
Try
{
}
Catch(Exception ex)
{through ex;}
Thanks
Md. Marufuzzaman
|
|
|
|