문제

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