| | |
Reference COM Libraries
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
Does anyone know how to reference a COM library from the command-line? Specifically, I need to reference CDOSYS.dll. Whenever I try to include the reference when I compile I get a message saying:
fatal error CS0009: Metadata file 'c:\WINDOWS\system32\cdosys.dll' could not be
opened -- 'An attempt was made to load a program with an incorrect
format. '
Anyone know how to do this?
NOTE: I have to do this in command-line. Adding the reference with an IDE isn't an option. I know how to do that.
fatal error CS0009: Metadata file 'c:\WINDOWS\system32\cdosys.dll' could not be
opened -- 'An attempt was made to load a program with an incorrect
format. '
Anyone know how to do this?
NOTE: I have to do this in command-line. Adding the reference with an IDE isn't an option. I know how to do that.
•
•
Join Date: May 2004
Posts: 85
Reputation:
Solved Threads: 5
You can't link directly to a COM library; you have to link to a .NET interop library. The VS IDE secretly generates this library for you when you add a COM project reference. Since you're using the command line, you'll have to generate it yourself. Use tlbimp.exe; it comes with the SDK.
--smg
![]() |
Similar Threads
- Another [Linker error] undefined reference to `WinMain@16' (C++)
- getting the undefined reference error (C++)
- value and reference (C++)
- A problem when I employ GNU Scientific Libraries in a Code (C)
- dynamically loaded libraries (C++)
- undefined reference Dev-C++ (C++)
- Question about Standard C Library. (C)
- What is it meaned [Linker error] undefined reference to `MAPILogon@24' (C++)
- Dev-C++, GLUI linker error, undefined reference (C++)
- Using C libraries in C++ programs (C++)
Other Threads in the C# Forum
- Previous Thread: Reflection question
- Next Thread: 3D graphics vs 2D graphics in games
| Thread Tools | Search this Thread |
.net access activedirectory ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development disabled displayingopenforms draganddrop drawing encryption enum event excel exectuable file files form format forms ftp function gdi+ httpwebrequest image index index-error input install java label list listbox listener mandelbrot math mathematics mouseclick mysql operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox serialization server setup sleep socket sql statistics stream string table tcp text textbox thread time timer update user usercontrol validation visualstudio webbrowser windows winforms wpf xml





