mscorlib.dll

R

rupert

I have loaded Xll+ which is a excel development addin. I
have included as first line of my VC++ module (visual
studio.net 2003):

#using <mscorlib.dll>

and yet get compile error:

fatal error C1190: managed tageted code requires '#using
<mscorlib.dll>' and '/clr' option

also, I would like to use Random() so I can use Random.Next
() but only rand() will work.

In other VS projects (without Xll+), Random works fine and
so I think its something to do with the Xll+ addin.
 
W

William DePalo [MVP VC++]

rupert said:
I have loaded Xll+ which is a excel development addin. I
have included as first line of my VC++ module (visual
studio.net 2003):

#using <mscorlib.dll>

and yet get compile error:

fatal error C1190: managed tageted code requires '#using
<mscorlib.dll>' and '/clr' option

Choose Properties from the Project menu. Then click on the Configuration
folder. Under it, select the General Options. In the edit box labelled "Use
Managed Extensions" in the right pane make sure "Yes" is selected. That
turns on the "/clr" switch that the diagnostic references.

That should remove the error but note that I have no idea as to whether
Excel add-ins may be cast in managed code. You may want to post again in a
group devoted to Office development topics.

If it turns out that you can not use managed code in an add-in, then you'd
likely have to use one of the interoperability mechanisms ("it just works"
aka IJW or "Platform Invoke" aka P/Invoke) to get your unmanaged Excel DLL
to load a managed assembly and to make use of the services that assembly
provides.

Just by the way, if you get stuck, you should be able to find help on
interoperability issues here.

Regards,
Will
 
C

chinthamani

hai
I am trying to convert the VC++ code to VC++.Net. So i included the
<mscorlib.dll> which has created a problem of /clr. I rectified this
problem using the "Use Managed Extensions". But i am getting another
error. "Command Line error D2016: RTC1 and clr command line are
incompatible". Can you help me to rectify this error.

Vinodh Noel
Bells Softech Ltd.
 
W

William DePalo [MVP VC++]

chinthamani said:
I am trying to convert the VC++ code to VC++.Net. So i included the
<mscorlib.dll> which has created a problem of /clr. I rectified this
problem using the "Use Managed Extensions". But i am getting another
error. "Command Line error D2016: RTC1 and clr command line are
incompatible". Can you help me to rectify this error.

Take a look at the prooperties page for the project and/or individual source
files. Open up the C++ "folder" of properties. Click on the "Code
Generation" item. In the pane to the right, look for the line labelled
"Basic Runtime Checks". Somewhere, the /RTC1 option is set in error.

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top