### VS2003呼叫VS2005的COM DLL

http://blog.miniasp.com/post/2008/07/How-to-write-COM-component-using-NET.aspx


Dim A As Object = CreateObject("NameSpace.ClassName")

When your client's .NET 1.1 application trying to call your .NET 2.0 made COM component, the CLR 2.0 will need to be loaded into the running process. However, since CLR 1.1 is already loaded in current process, since CLR 1.1 & 2.0 don't support co-existence in the same process, the latter loaded CLR will always fail. So your .NET 2.0 COM component fails at initialization, and you got a "Cannot Create ActiveX component" message. When you use CreateObject from VB6, it works fine because in this case there is no CLR 1.1 & 2.0 conflict in the same process


[?xml version="1.0" encoding="utf-8" ?]
[configuration]
[startup]
[supportedRuntime version="v2.0.50727"/]
[/startup]
[/configuration]

1. Client環境必須要同時安裝.net framework 2.0 & 1.1
2. 由於是利用CreateObject的方式，程式撰寫過程沒有Intelisence可以使用
3. 偵錯模式不能跑，要直接執行exe檔才能夠看的到效果