| | |
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 ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color combobox control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile globalization httpwebrequest image index input install installer java label list listbox mandelbrot math mono mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox save serialization server sleep socket sql sql-server statistics stream string table text textbox thread time timer timespan update upload usercontrol users validate validation visualstudio webbrowser windows winforms wpf xml





