Set DVXRT = VBA.CreateObject("DVXR48OLE.CDVXRT") If (DVXRT.Login(nFirma, sCode$, sPWT$, gsDBServer, sPath)) Then.....
<pre lang="c#"> Object obj = Activator.CreateInstance(Type.GetTypeFromProgID("DVXR48OLE.CDVXRT")); If (obj.Login(nFirma, sCode$, sPWT$, gsDBServer, sPath)
Type custom = Type.GetTypeFromProgID("DVXR48OLE.CDVXRT"); //magic word: dynamic! dynamic obj = Activator.CreateInstance(custom); //late binding in action! if (obj.Login(nFirma, sCode$, sPWT$, gsDBServer, sPath) { //... }
using System.Dynamic;
obj
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)