-
- Consequences of keyword "event" in C#
by Jabberwocky
- 13 Replies
- Last post
by Peter Ritchie
- Hi, is there an MSDN help page that clearly lists the consequences of the "event" keyword in contrast to omitting it Also, the "event" keyword is not listed as an access modifier (like public, private), but in my understanding it is nothing else:
Code Block public class MyTestClass { public event EventDelegate myEvent; public EventDelegate myCallback; ... A second cla
-
- How to get uptodate user information with WindowsIdentity object?
by jdang
- 3 Replies
- Last post
by jdang
- I have the folling codes in C#
WindowsIdentity user = WindowsIdentity .GetCurrent();
IdentityReferenceCollection groups = user.Groups.Translate( typeof ( NTAccount ));
Everything works fine. However, whenever I change something in ActiveDirectory for a user, the user must logoff and log back in to see the changes. Are there anywany for me to force WindowsIdentity
-
- Set detail information of a file
by onepieceking
- 2 Replies
- Last post
by Karthikeya Pavan Kumar .B
- Hi,
When you do a right-click on a file in the Window Explorer and clicks on "Properties" and click on "Summary", you will be able to see the detail information such as Title, Author, Comments, etc of the file.
I am trying to be able to write into these fields using a C# application. So far, I used shell32.dll and I am able to read from these fields.
Is the
-
- OTP Accessing data from a DataList
by Andrew Mercer
- 1 Replies
- Last post
by Brendan Grant
- Hi,
I have used a DataList to build part of a WebPage. The datalist creates rows of input fields each with a unique ID.
I need to extract data from these fields when the user Submits the page, however:
The number of rows is not always the same.
Each row is bounded by its own table, row and td.
When I make the call DataList.Items.Count I get a value of zero.
What am I doing wrong
-
- beginners programming
by Anonymous578181
- 3 Replies
- Last post
by Biche
- namespace scissorpaperrock
{
public partial class Form1 : Form
{
private int playscore, compscore, counter = 0, countercomp = 0;
public Form1()
{
InitializeComponent();
}
private void aboutToolStripMenuItem_Click( object sender, EventArgs e)
{
new AboutBox1 ().ShowDialog();
}
private void player1name_Click( object sende
-
- Getting junk characters in C# DLL when calling C# DLL in VC++
by Vishal Khanna
- 14 Replies
- Last post
by rahulsis
- Hi All
Been trying to figure out a solution to this problem since long. Would appreciate if someone can throw some light.
I am calling a managed C# dll in VC++ code. My problem is that I'm unable to pass the bstr data from VC++ to C#. In fact, the bstr data is coming to C#, but its all junk values that looks something like this...
c¡®¨Ec¡¯a oa ¡¥a 1a Ra a Ra ¡ãa Ra ¡ãa ¡¥a ¡¤c?¡ã
-
- (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)
by lyqfqy
- 11 Replies
- Last post
by lyqfqy
- I am testing a dll file(name: VsnPmsATLMath.dll) which is written by C code(it's not a com
type). This C code implements some basic functions like calculating average value of an
array.
What I have done is:
1. regsvr32 VsnPmsATLMath.dll (this step register the file successful)
2. Project -> Add References ->COM ->VsnPmsATLMath.dll 1.0 Type Library (I found it in the "C
-
- Event best practice
by dotnetluke
- 11 Replies
- Last post
by dotnetluke
- I need to create an event class that will:
The event will fire in one class...and a different class will consume the event.
public class Event
{
public delegate void MyHandler ();
public event MyHandler MyEvent;
public void FireEvent
{
MyEvent();
}
}
How to I subscribe to the event class
-
- Showing A Timestamp
by vjucas
- 7 Replies
- Last post
by vjucas
- I want to show a timestamp on the form that contains the date and time. Right now I am using the System.DateTime.Now method, but this shows the timestamp in this form: 7/24/07 11:30 AM. I want it to also include the seconds so that it shows up like: 7/24/07 11:30:12 AM. It also has to be a DateTime type so that I can save these to my database which is of DateTime type and so that I can sort the co
-
- Sending data between two applications.
by ToddGibbs
- 5 Replies
- Last post
by OmegaMan
- Hi Guys, Im trying to send data between two C# applications. The data is a 5mb lump of memory that I have a char* to (its actually an image loaded via a C++ DLL and the pointer handed over to the C# application). The second application is an image processing tool I've written that I want to receive the image and process it. Im guessing I need to use postMessage in the 'sending' application and so
-
- sending fax
by Hooman
- 4 Replies
- Last post
by Karthikeya Pavan Kumar .B
- hello friends i'm new in msdn forums.
sorry i'm not very good at english.
i want to know wich component or dll that i have to use for sending fax (setting com port).
can i use winfax.dll(i cant add this dll to my application "a refrence to 'path' couldnot be added. please makesure that the file is accessible, and that it is a valid assembly or com component").
tahnks for your
-
- Found some odd behaviour with IO SetLength() & Write() using unbuffered IO
by Michael J. Brown
- 8 Replies
- Last post
by Michael J. Brown
- So here I am, trying to create a 32GB file and write some data near the end of it, thinking this is fairly optimized underneath. Apparently, if you use SetLength(32 * 1024 * 1024 * 1024), and seek near the end, all is good... until you try to Write to it. Once you begin your write, the file has to be filled up with some data as it's all empty space, which is semi-obvious. But it does this in 1K bl
-
- Retrieving URL from IE
by Taffy11
- 9 Replies
- Last post
by Sheng Jiang (?êÉ)
- Hi All,
I am developing a windows application that will retrieve the url address from a internet explorer window, using c# within the .net environment (2.0). Is this possible and can you provide me with either examples or references. Thanks,
Kelvin
-
- best practice? using global VS local instance of object(?)
by Martin Ortiz
- 7 Replies
- Last post
by Martin Ortiz
- Which would be considered best practice
class MyClass1
{
MyObject Obj = new MyObject; // GLOBAL but NOT because it's used globally
void Foo() // this function is called potentially a lot
{
Obj.DoSomething();
}
}
class MyClass2
{
void Foo() // this function is called potentially a lot
{
MyObject Obj = new MyObject; // alloc
-
- How to write Registry key value for logged in user thru Windows services?
by Jagad
- 1 Replies
- Last post
by Gabriel Lozano-Moran
- Hi,
I am developing one windows service, which takes the file from network server, copied to the local folder and that file name and path should be updated in current user's registry. By doing this in windows services its giving file not found exception.
What Account to use for this and how to set the registry for the current user who logged in
Can we run windows service that run under t
-
- Run DLL
by C# Questionaire
- 7 Replies
- Last post
by C# Questionaire
- I'm making an application that saves files unknown to Windows. I want to make a DLL file or a file equivalent so that Windows will open these files with my application. Please specify code below, you will receive full credit in my application about box. Thank you.
-
- Developing C lib. wrapped in C#
by bucz
- 5 Replies
- Last post
by Peter Ritchie
- I want to develope a C library for some embedded device. It would be problematic to test a single library in a device, therefore I wanted to make some C# wrapped, to test it, provide and receive data, support settings, visualise, etc etc... How to make it most efficient The goal is to develope a file with C code, test it and include as is to a bigger project as is.
-
- Insufficient storage in immediate/command window
by hegden
- 2 Replies
- Last post
by hegden
- My VSTS IDE's immediate window no longer works - on typing a single character in the command/immediate window immediately pops up a message "The command cannot be executed. Insufficient storage is available to process this command". I have tried restarting with all add-ins/external tools uninstalled with no luck. I suspect this started happening after installing SQL 2005 dev studio (whic
-
- Removing items in a list while iterating through it
by J Andrews
- 14 Replies
- Last post
by jgalley
- In this code, I get a SystemInvalidOperation execution and I know why. List<int> list = new List<int>(); for (int i = 1; i < 10; i++) { list.Add(i); } foreach (int i in list) { list.Remove(i); } I replaced the foreach with for: List<int> list = new List<int>(); for (int i = 1; i < 10; i++) { list.Add(i); } for (int i = 0; i < list.Count; i++) { int remove = list ;
-
- VS2005 Installs, Compiles, Doesn't run simple C# programs
by Ralph Trickey
- 14 Replies
- Last post
by Rusty01
- I've installed VS2005. It installed fine, and if I do a new C# windows project, it will apparently compile it. If I try running that program, it does nothing.
I can do the same steps on another machine, and everything works fine. I can copy an executable built on the other machine to this machine, and it runs fine.
Here's a partial dump of the output
'WindowsApplication1.vshost.exe' (Man
-
- Finding if a method is called in the body of another method. (find all references) Can we use reflection perhaps?
by sashisme
- 5 Replies
- Last post
by Peter Ritchie
- I want to know if a particular method is called in some other piece of code (another method perhaps).
Say i have a method called samplemethod() in dll A.
Dll B has reference to Dll A and some code in Dll B is calling the SampleMethod(). I want to be able to reflect on the methods inside the Dll B and find out if one of them calls SampleMethod().
I'm doing this because i want to simulate
-
- Namespace visibility
by idos
- 2 Replies
- Last post
by MarkTheNuke
- Hi all, Can someone please help me, Is there any way to make a class with 'namespace-only' visibility. It will be like 'package' in Java. I tried to use 'internal' but then the class from different namespace in the same ddl can still have access to my class. For example namespace A {
internal class MyFirstClass { } } namespace B {
public class MySecondClass { } } Thank you,
-
- generic parameter overloading
by bilsa
- 3 Replies
- Last post
by Figo Fei - MSFT
- Hey guys! First I'm not entirely sure if this goes into this forum, never the less. I'm wondering why not allow code as the following: public I MyFunc<I>(I param) where I : Interface1 { } public I MyFunc<I>(I param) where I: Interface2 { } As far as I can see this would work exactly as function overloading with the arguments: public void MyFunc(Interface1 param)
{
}
public v
-
- WPF: Cider designer and windows forms visual styles
by Christopher Prest
- 1 Replies
- Last post
by Christopher Prest
- Ive been playing around with the CTP Cider designer in visual studio 2005. My new WPF forms have the proper visual themes (ie. buttons, combo boxes etc..) however when I call a windows forms based dialog it shows it in the flat win2k style theme. I changed each control to flat style of system (tried all of them) however I cant get the vista look and feel to show up ( except the window border ). I
-
- How to log the keyboard input in C#?
by Olavo Alexandrino
- 4 Replies
- Last post
by Olavo Alexandrino
- I wrote a Windows Service in C# that will log some user's activities such as website visited, internet time conection and "keyboard input".
the last one I don't know how to log. perhaps I will have to use some import for user32.dll
so, how could I do that
this feature log would be something so similar to a "Key logger" because will have some shorcut