new一般是 new 构造函数()

解决方案 »

  1.   

    应该是将那个dll添加为COM引用,然后用new
      

  2.   

    up。现在的问题是我不知道引用哪个好。引用了一个dll文件。提示不是合法的dll.没法用。
      

  3.   

    要用
    [DllImport("User32.dll")]  
    private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow); 
    ShowWindowAsync (instance.MainWindowHandle , WS_SHOWNORMAL);
      

  4.   

    老大,看不懂啊。能不能给个有说明的地方和。例子啊。 //bow
    我用vb写了个com,得到自己想要的数据,然后把com用.net包装。调用 ,拿到数据了。问题是能不能用.net直接取。就是Dim phd1 As Object
    Dim sss As StringPublic Function hello(ByVal hello1 As String) As String
    Set phd1 = CreateObject("VisualPhd.Data")
    这几句在.net里用什么代替。.net能不能直接象vb一样调用 visualphd.data。vb项目什么都没有引用。就可以直接得到数据。不知道用的哪个dll.查询注册表有个phdata.dll关联visualphd.data,但是添加到.net引用中失败。说不是合法的dll
      

  5.   

    using System.Reflection; public static object Create( string asmName, string typeName, object[] args )
    {
    Assembly assemblyInstance = null;
    Type typeInstance = null; try 
    {
    //  use full assembly name to get assembly instance
    assemblyInstance = Assembly.Load( asmName );
    }
    catch ( Exception e )
    {
    throw new UIPException( Resource.ResourceManager.FormatMessage( "RES_ExceptionCantLoadAssembly", asmName ), e );
    } //  use type name to get type from assembly
    typeInstance = assemblyInstance.GetType( typeName , true, false); try
    {
    if( args != null )
    {
    return Activator.CreateInstance( typeInstance, args);
    }
    else
    {
    return Activator.CreateInstance( typeInstance);
    }
    }
    catch( Exception e )
    {
    throw new UIPException( Resource.ResourceManager.FormatMessage( "RES_ExceptionCantCreateInstanceUsingActivate", typeInstance ), e );
    }
    }
      

  6.   

    可以考虑用vb.net实现这部分功能。