Need urgent help
-
Please I want to know how to register dll com component in C# using windows API not shell command. Please I need it very urgent. -- modified at 11:55 Monday 15th May, 2006
Umm, AFAIK, you can do this only using the regsvr32 executable. Thus, you will have to pass it a shell command. What's wrong with that? You can still use C# code to execute the shell command:
Process proc = new Process();
proc.StartInfo.FileName = "regsvr32";
proc.StartInfo.Arguments = "myComDll.dll";
proc.Start();Tech, life, family, faith: Give me a visit. I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
Umm, AFAIK, you can do this only using the regsvr32 executable. Thus, you will have to pass it a shell command. What's wrong with that? You can still use C# code to execute the shell command:
Process proc = new Process();
proc.StartInfo.FileName = "regsvr32";
proc.StartInfo.Arguments = "myComDll.dll";
proc.Start();Tech, life, family, faith: Give me a visit. I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
Thank you for your help I know that I can still use C# code by using shell commands. But actually I am doing it for someone that asked me to do it using windows API without using the shell commands! So please if you/anyone have any ideas please send it. Thank you
-
Thank you for your help I know that I can still use C# code by using shell commands. But actually I am doing it for someone that asked me to do it using windows API without using the shell commands! So please if you/anyone have any ideas please send it. Thank you
As far as I know, COM dlls are registered on the system using regsvr32. I've never seen an API that registers a COM dll manually. That said, I'm no COM expert. I mean, dll registration is simply adding the dll to the system and making it known throughout the registry; all things that can be done with the Win32 API of course. In the end though, I see no reason not to simply use the regsvr32 executable; that's what it's there for. I suppose you might want to try the COM forum instead, as this more pertains to COM than C#.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
Thank you for your help I know that I can still use C# code by using shell commands. But actually I am doing it for someone that asked me to do it using windows API without using the shell commands! So please if you/anyone have any ideas please send it. Thank you
There is no one API call that does this. You have to open the component file, parse and get the ALL of the GUIDs and names for each object, method, property, ...whatnot.... Then write each GUID and name to the registry in the appropriate locations. You can try to implement something like this, probably taking you 6 months of work as you figure out the internals of COM and the API's involved. Or, do it the easy way, and shell out to RegSrv32, and have it done in 5 minutes. Which option do you think would be more cost effective? Dave Kreskowiak Microsoft MVP - Visual Basic