Вопрос

I'm migrating some old classic ASP code to ASP.Net. One of the pages creates an instance of a COM component with:

obj = Server.CreateObject("myProgId").

In the C# version I'm trying to do the same using something like this:

dynamic obj = Activator.CreateInstance(Type.GetTypeFromProgID("myProgId"));

The question is if both lines of code get an instance of the same class considering that the same ProgID could be registered more than once with a different ClassID.

Second question: Is there any way to know which ClassID is using Server.CreateObject() to create the instance?

Thanks.

Это было полезно?

Решение

Using this sysinternals tool I could figure out which file handles where open when creating the instance.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top