| | |
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: 95
Reputation:
Solved Threads: 9
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
Views: 610 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client code color control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file form format forms ftp function gdi+ http httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving serialization server sleep socket sql statistics string table textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





