Unanswered .DLL Files

  • Wednesday, December 07, 2005 12:34 AM
     
     
    Ok. I am working on a new program. And I am trying to put a .dll reference from one program and add it to another. But it will not let me. I keep getting the error message saying

    A reference to ‘C:….\enc_wma.dll” could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.


    Could someone tell me whats wrong?

All Replies

  • Wednesday, December 07, 2005 3:09 AM
    Moderator
     
     
    It is probably a native binary and not a .NET assembly or COM object.  You can only add references to .NET assemblies or COM objects.  If it is a COM object then it should be registered on your machine.  In this case go to the Add References\COM tab and find the COM object within there.  The reference will be added automatically.  For .NET assemblies use the Add References\Browse or Add References\.NET tabs to find the assembly.

    For native binaries (i.e. C++ or C DLLs) you use DllImport attribute to reference the binary.  It must be available in the application directory at runtime and no compile-time type checking is done.

    Michael Taylor - 12/6/05