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

How do I use UIPermissionWindow.NoWindows?

Greetings!

I have a DLL that contains various utility functions. If something goes
wrong, I want to tell the user about it. If the function is being called
from a standard Windows application, I want to show a message box. But if
the function is being called from a Windows service, I want the message
written into the Windows event log. How do I tell the difference?

A colleague suggested using the UIPermissionAttribute class. I can mark the
assembly for the service with NoWindows and an assembly for the GUI app with
AllWindows. But I can't make head or tail out of the examples for using the
UIPermissionAttribute and UIPermission classes. Can somebody give me a
little snippet of code that would illustrate what I want to do?

Thanks very much!

Rob Richardson
Nov 17 '05 #1
0 1039

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

Similar topics

0
by: Nick Zdunic | last post by:
I have this code which throws up an error on my box (Windows Sever 2003 - Enterprise Edition) MsgBox("Message", MsgBoxStyle.Question OrMsgBoxStyle.MsgBoxSetForeground, "Title") I have tried...
0
by: Chad Beckner | last post by:
Hi everyone, I am developing a "common repository" of methods which can be imported into Windows and Web forms. However, I am having some troubles which I need your help with! 1. Every...
5
by: Norsoft | last post by:
I have a .Net 1.1 application which is downloaded into an aspx page. It is a dll which inherits from System.Windows.Forms.UserControl. It works fine on a PC with only the 1.1 Framework. However,...
2
by: Norsoft | last post by:
I have a .Net 1.1 application which is downloaded into an aspx page. It is a dll which inherits from System.Windows.Forms.UserControl. It works fine on a PC with only the 1.1 Framework. However,...
2
by: mvendertaca | last post by:
I've created a usercontrol which is hosted in Internet Explorer. It with some action buttons. I could place all buttons on this usercontrol but I did not. When the user presses one of the buttons i...
1
by: joel | last post by:
I've made a windows form application and started placing security attributes on the assembly. When I use these attributes I always get an annoying ballon on the app with the following text ...
19
by: auratius | last post by:
http://www.auratius.co.za/CSharpCodingStandards.html Complete CSharp Coding Standards 1. Naming Conventions and Styles 2. Coding Practices 3. Project Settings and Project Structure 4....
1
by: gnrgattadi | last post by:
I have Created A ListBox Control Whose Handle is Desktop. My code for ListBox: #using using namespace System;
7
by: Ben Voigt [C++ MVP] | last post by:
As much as the CLR team assures us that it's ok to fire-and-forget Control.BeginInvoke, it seems it isn't. Maybe this is a bug. See for example: the comments in...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.