473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

c# complier options from inside IDE???

Hi

Does anyone know how to specify a compiler option (/r) from inside the
..NET IDE? I'm calling a COM object, I've alreay registered the type
library and now have to compile with /r:TypeLibname.dll. Any ideas on
how to do this from within Visual Studio? (please no command line
suggestions)
Thanks
Nov 16 '05 #1
6 1410
Paul,

In VS.NET 2002, it is possible only if there is a representation of it
in the designer. For what you want to do, you want to add a reference to
the COM object. Right click on the references folder in your project view
and select "add reference". If you did register the COM object correctly,
then it will be visible in the list on the "COM" tab. Select the component,
and a managed wrapper will be created for you which you can use in your
application.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Paul" <pa******@hotmail.com> wrote in message
news:7e*************************@posting.google.co m...
Hi

Does anyone know how to specify a compiler option (/r) from inside the
.NET IDE? I'm calling a COM object, I've alreay registered the type
library and now have to compile with /r:TypeLibname.dll. Any ideas on
how to do this from within Visual Studio? (please no command line
suggestions)
Thanks

Nov 16 '05 #2
From the Solution Explorer window, right-click on the References node and
add a COM reference to your COM library. IDE will create an interop wrapper
for your COM DLL and that will automatically be used during compilation.

HTH.

"Paul" <pa******@hotmail.com> wrote in message
news:7e*************************@posting.google.co m...
Hi

Does anyone know how to specify a compiler option (/r) from inside the
..NET IDE? I'm calling a COM object, I've alreay registered the type
library and now have to compile with /r:TypeLibname.dll. Any ideas on
how to do this from within Visual Studio? (please no command line
suggestions)
Thanks
Nov 16 '05 #3
Paul wrote:
Hi

Does anyone know how to specify a compiler option (/r) from inside the
.NET IDE? I'm calling a COM object, I've alreay registered the type
library and now have to compile with /r:TypeLibname.dll. Any ideas on
how to do this from within Visual Studio? (please no command line
suggestions)
Thanks


Add a reference to your VS.NET project to TypeLibname.dll.
--
Tom Porterfield
Nov 16 '05 #4

I've done what you suggest but I'm getting an error when I attempt to
create the object at runtime:

SprayAngleLib.SprayAngle sprayAngleObj = new SprayAngleLib.SprayAngle();

An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred in multiViews.exe

Additional information: COM object with CLSID
{C32E12E3-8A63-4851-945A-2792E4EAFA03} is either not valid or not
registered.

The same COM worked fine in VB6 so I don't think there's anything wrong
with it...

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #5
Tried it but still no luck... basically, I'm adding a reference to COM
dll by going into References, add component etc... the wrapper is
automatically created and called SprayAngleLib.dll. this has a class
ID of {DF20FEC8-D3D4-4A66-9DB5-113FA05BF829}. But when I execute, the
error message says it can't find COM object with CLSID
{C32E12E3-8A63-4851-945A-2792E4EAFA03}. I've done a search in the
registry for this but it wasn't found. Why is it looking for this
other thing? What's going on?!?!?!

Tom Porterfield <tp******@mvps.org> wrote in message news:<Of**************@TK2MSFTNGP10.phx.gbl>...
Paul wrote:
Hi

Does anyone know how to specify a compiler option (/r) from inside the
.NET IDE? I'm calling a COM object, I've alreay registered the type
library and now have to compile with /r:TypeLibname.dll. Any ideas on
how to do this from within Visual Studio? (please no command line
suggestions)
Thanks


Add a reference to your VS.NET project to TypeLibname.dll.

Nov 16 '05 #6
By the way, the COM was assembled in Fortran... I don't suppose this
has anything to do with it

Tom Porterfield <tp******@mvps.org> wrote in message news:<Of**************@TK2MSFTNGP10.phx.gbl>...
Paul wrote:
Hi

Does anyone know how to specify a compiler option (/r) from inside the
.NET IDE? I'm calling a COM object, I've alreay registered the type
library and now have to compile with /r:TypeLibname.dll. Any ideas on
how to do this from within Visual Studio? (please no command line
suggestions)
Thanks


Add a reference to your VS.NET project to TypeLibname.dll.

Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Seven Kast USA | last post by:
Hi pelase explain me complier design of c and i need a small example complier design all phases in c programming . by KAST
2
by: qbin_wang | last post by:
Hi: now i want to download a free c complier which can be used in windows system.and i see many posts in the comp.lang.c,but i don't find the answer.who can tell me the true and correct website...
2
by: qbin_wang | last post by:
Hi: now i want to download a free c complier which can be used in windows system.and i see many posts in the comp.lang.c,but i don't find the answer.who can tell me the true and correct website...
2
by: goblinsleez | last post by:
Ok , heres the thing. I have a project im workin on, and i have my exe , in a directory, with a subdirectory named DLL and inside that my dll. I was sure that csc /t:winexe /lib:DLL...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.