473,385 Members | 1,582 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,385 software developers and data experts.

verifiable DLL

Hi,

I'm trying to build a verfiable DLL using Visual Studio C++ 2005. I've
applied the /clr:safe, /CLRIMAGETYPE:SAFE and /noentry options. The
code is:

// TestRobot.h
#include "stdafx.h"

#pragma once

using namespace NRobot::Robot;

[assembly:RobotClass("NRobot.MyName.MyRobot")];

namespace NRobot {
namespace MyName {
[OwnerEmail("me@example.com")]
[TeamInfo(Name="My Team2", BodyColor=0xffff00)]
[RobotInfo(1, Name="My Robot")]
public ref class MyRobot : public IRobot {
public:
virtual void Start(StartState ^state) {
}
virtual void Tick(TickState ^state) {
state->MoveSpeed = 10;
state->TurnSpeed = 10;
state->Fire();
}
};
}
}

But the output DLL dosen't seem to be right. It won't load in an
application domain with restricted privileges (The C# version of the
same code works fine). Any idea?

Thanks in advance!

Mar 21 '06 #1
4 1207
Are all source files in your project compiled with /clr:safe?

Marcus

<ke**@cpttm.org.mo> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
Hi,

I'm trying to build a verfiable DLL using Visual Studio C++ 2005. I've
applied the /clr:safe, /CLRIMAGETYPE:SAFE and /noentry options. The
code is:

// TestRobot.h
#include "stdafx.h"

#pragma once

using namespace NRobot::Robot;

[assembly:RobotClass("NRobot.MyName.MyRobot")];

namespace NRobot {
namespace MyName {
[OwnerEmail("me@example.com")]
[TeamInfo(Name="My Team2", BodyColor=0xffff00)]
[RobotInfo(1, Name="My Robot")]
public ref class MyRobot : public IRobot {
public:
virtual void Start(StartState ^state) {
}
virtual void Tick(TickState ^state) {
state->MoveSpeed = 10;
state->TurnSpeed = 10;
state->Fire();
}
};
}
}

But the output DLL dosen't seem to be right. It won't load in an
application domain with restricted privileges (The C# version of the
same code works fine). Any idea?

Thanks in advance!

Mar 21 '06 #2
1. What does peverify.exe tells you when run on the assembly?
2. Where do you load the assembly from and what exception is threre thrown
on you when you load the assembly in the partial trusted AD?

Willy.

<ke**@cpttm.org.mo> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
| Hi,
|
| I'm trying to build a verfiable DLL using Visual Studio C++ 2005. I've
| applied the /clr:safe, /CLRIMAGETYPE:SAFE and /noentry options. The
| code is:
|
| // TestRobot.h
| #include "stdafx.h"
|
| #pragma once
|
| using namespace NRobot::Robot;
|
| [assembly:RobotClass("NRobot.MyName.MyRobot")];
|
| namespace NRobot {
| namespace MyName {
| [OwnerEmail("me@example.com")]
| [TeamInfo(Name="My Team2", BodyColor=0xffff00)]
| [RobotInfo(1, Name="My Robot")]
| public ref class MyRobot : public IRobot {
| public:
| virtual void Start(StartState ^state) {
| }
| virtual void Tick(TickState ^state) {
| state->MoveSpeed = 10;
| state->TurnSpeed = 10;
| state->Fire();
| }
| };
| }
| }
|
| But the output DLL dosen't seem to be right. It won't load in an
| application domain with restricted privileges (The C# version of the
| same code works fine). Any idea?
|
| Thanks in advance!
|
Mar 21 '06 #3
Willy Denoyette [MVP] wrote:
1. What does peverify.exe tells you when run on the assembly?
c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin>peverify
"c:\Documents a
nd Settings\kent\My Documents\Visual Studio
2005\Projects\TestRobot\Debug\TestRo
bot.dll"

Microsoft (R) .NET Framework PE Verifier. Version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

All Classes and Methods in c:\Documents and Settings\kent\My
Documents\Visual St
udio 2005\Projects\TestRobot\Debug\TestRobot.dll Verified.
2. Where do you load the assembly from and what exception is threre thrown
on you when you load the assembly in the partial trusted AD? From a NET v1.1 C# EXE. I remember the exception is saying file not

found.

Mar 22 '06 #4
Yes, there is only a single source file.

Mar 22 '06 #5

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

Similar topics

15
by: Marc Le Roy | last post by:
Hello, ADA Ravenscar is a restricted subset of the ADA language that has been defined for real-time software development in safety critical applications. Completed with additional restrictions...
1
by: Gideon | last post by:
I have got some C++ code that uses STL containers. I need to use that code from a C# application, so compiled it as a .NET assembly. As I wish to run the project on a web environment, the DLL...
40
by: Neo The One | last post by:
I think C# is forcing us to write more code by enforcing a rule that can be summarized as 'A local variable must be assgined *explicitly* before reading its value.' If you are interested in what...
7
by: Edward Yang | last post by:
A few days ago I started a thread "I think C# is forcing us to write more (redundant) code" and got many replies (more than what I had expected). But after reading all the replies I think my...
12
by: Herby | last post by:
Hi, I am currently reviewing what is required to convert a current MFC, COM server application into a .NET application. The objective is to compile ultimately to clr/safe. So we are seeking a...
77
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html The above link shows that C# is 450% slower on something as simple as a nested loop....
19
by: Ole Nielsby | last post by:
How does the GetHashCode() of an array object behave? Does it combine the GetHashCode() of its elements, or does it create a sync block for the object? I want to use readonly arrays as...
62
by: Born | last post by:
GC is really garbage itself Reason 1: There is delay between the wanted destruction and the actual destruction.
0
by: InstantDegrees.Net | last post by:
The Largest Network of Universities in the World http://instantdegrees.net offer Your degree package includes from US$ 100 only ; ** Covering note from the University you graduated. **...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.