Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2007

Tip: Looking for answers? Try searching our database.

"Any CPU" build for C++/CLI

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dirk - 11 Jun 2007 09:47 GMT
Hello

Can I create a C++/CLI assembly with /clr:pure that is platform agnostic? C#
projects use "Any CPU" as the default platform and the output can be loaded
into a 32-bit or 64-bit process.

I have a VS solution with a C++/CLI dll and a C# exe which uses this dll.
When the exe runs on Windows x64 the C++ dll must be built with x64 as the
target platform. If Win32 is used a BadImageFormatException is thrown. I
tried to modify the Win32 version with CorFlags.exe /32BIT-. This time I do
not get a BadImageFormatException but the Module constructor throws a
FileNotFoundException because msvcm80.dll cannot be found.

Thanks
Jochen Kalmbach [MVP] - 11 Jun 2007 10:35 GMT
HI Dirk!

> Can I create a C++/CLI assembly with /clr:pure that is platform
> agnostic? C# projects use "Any CPU" as the default platform and the
> output can be loaded into a 32-bit or 64-bit process.

You must compile with /clr:safe to support 32 and 64-Bit with one assembly.

See also:
http://msdn2.microsoft.com/en-us/library/31zwwc39

Greetings
  Jochen

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.