-
- COM export
by Alexandre Eden
- 6 Replies
- Last post
by Alexandre Eden
- Hello,
I have a C# project with 2 classes. I want only one class to be visible for COM. Here is the code :
AssemblyInfo.cs :
Code Snippet
[assembly: ComVisible ( true )]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid ( "e28e7b2f-18b8-4abb-b65b-74fc5351e1ec" )]
ComClass.cs :
-
- How to monitor a method of instance without Event?
by Eagle Tsui
- 3 Replies
- Last post
by TaylorMichaelL
- Is .net have a function that it can monitor method of instance.
For example: public class Foo { public void Test() { } } public class Monitor { private object _source; public Monitor(ojbect source) { this._source=source; //Doing monitor routin. ..... } public void EnterBefore() { }
public void EnterAfter() { } } static class Program { [STAThrea
-
- Generic Multi-Dimensional Arrays Comparison
by Bluehunter
- 7 Replies
- Last post
by micvos
-
Hi,
I need to compare multi-dimensional arrays in a function which takes 2 multi-dim arrays which can be any type(int, double, bool...etc). Comparison is done by Object.Equals() of each value in each index of the arrays.
As a result, Generic and Multi-Dimensional is what I need to combine. Any idea I compare 1 Dimensional-arrays with
-
- Using .lib files in C#
by Participant
- 5 Replies
- Last post
by Martin Xie - MSFT
- Hi there, I am facing problems in using .lib files in C#. One of my friends made .lib files using C++.NET and I want to use these libraries in C#. Does anyone know how to do that Regards
-
- Passing an inherited class as 'T' to a generic container.
by Jim Tomasko
- 7 Replies
- Last post
by Jim Tomasko
- I'm having trouble finding out how to use a general purpose generic container I wrote as a member of another class which wants to hold any class type based on a common base class.
The first set of code below shows 4 seperate classes, RNode is a generic class, TreeControl has an RNode<TreeItemBase> member, and a "Root" property to access it, TreeItemBase is a control (not really
-
- Creating basic login system.
by Yorick85542165
- 3 Replies
- Last post
by Biche
- Hi
Does any one have any tips or tutorials for creating a basic login system in C# for a windows application. I am finding it difficult to retrieve information to give me a starting point. Most of the information is for websites. I am using C# express edition 2005.
Thanks.
-
- tabbed browsing in VS 2005
by Bosch cel rau
- 0 Replies
- Last post
by Bosch cel rau
- Hi all !
My problems with the current IDE tabbed editor (VS2k5 final and then with SP1 applied):
I use to group my classes and controls in a folder hierarchy and i have several levels of folders. When i have lots of files open, i can't tell which is which as they all start with the same string (name of the root folder and a few below it) and end with a few letters and ascx.cs . This is qu
-
- Abstract Class Vs Interface
by Syam Kumar Chepuri
- 3 Replies
- Last post
by Sung M Kim
- Hi, I have a little confusion about the exact difference between an Interface and an Abstract class . Can you please explain me a specific scenario where in we have to declare an Interface but not an Abstract class and vice-versa. I want to have a clear picture on this. Reply will be appreciable. Thanks in advance.
-
- 32 bit or 64 bit OS?
by Anzer
- 3 Replies
- Last post
by OmegaMan
- I want to know whether the win OS is 64 bit or 32 bit. How can I do it in C#
-
- Process.start() how to
by AndyPham
- 10 Replies
- Last post
by Prabu.
- Hi All,
I'm using process.start() to execute msbuild.exe. Is there any properties or method that I could set or call to wait until it completely finished before the next line of code get executed
Best Regards,
-
- storing values between two forms
by IMBack
- 2 Replies
- Last post
by Figo Fei - MSFT
- Hi,
IS there away to store values between forms, without using Viewstate, sessions, or cookies,
//A class:
public class BaseClass : System.Web.UI.Page
{
private string test = "";
public string A { get { return test;} set { test= value ;} }
}
my first webform1.aspx
private void bt_c_Click( object sender, System.EventArgs e)
-
- InvalidActiveXStateException was unhandled- MSChart control 6.0
by GunaChinna
- 1 Replies
- Last post
by GunaChinna
- My code is,
AxMSChart20Lib.AxMSChart chart = new AxMSChart20Lib.AxMSChart();
chart.Title.Text = "My first chart"; this.Controls.Add(chart);
When i use this code, i get this exception,
"InvalidActiveXSateException was unhandled"
Exception of type: 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown.
Can u tell, how can this be corrected
-
- numbering rows!!
by Umesh_karthy_41cdd8
- 12 Replies
- Last post
by Figo Fei - MSFT
- hi my application uses a datagrid. i generate rows dynamically as per my requirment and add values to them. is there any means by that i can name or number the row sequentially i.e., rows 0,1,2... and so on. this is the code snippet where i generate the rows and add it to the tables. for(int i = 0; i < x; i++) { newRow1 = table.NewRow(); rowCount++; // Add the row to the
-
- How to System.Net.Mail interfacing with MS Exchange?
by Ke Sun
- 3 Replies
- Last post
by Christopher John Anderson
- Hi there, I have searched the forums about this topic, but I have not read a very good answer... I want to use System.Net.Mail to interface with MS Exchange in a corporate LAN. Is this possible If so, how can I trigger it Thanks, Ke
-
- What's wrong with this code?
by Jamie Thomson
- 7 Replies
- Last post
by TilakGopi
- Hello,
Complete dotnet newbie here so please be gentle OK
Can someone give me the offical explanantion of why this is valid code:
Code Snippet
using System;
using Microsoft.SqlServer.Dts.Runtime; //Reference Microsoft.SQLServer.ManagedDTS.dll for access to this namespace
namespace Conchango.Ssis
{
public class BuildPackage
{
static
-
- Validation against xml schema
by bslim
- 1 Replies
- Last post
by Marcelo Guerra - MSFT
- Hi all,
I had an xml file as follow and I would like to validate it against an xml schema.
/*************** Book.xml ****************/
<Book> <DateTime>20061127192111</DateTime> <Information CustName="ABC" /> <BookList> <Title BookName="Program C" id="12345"/> <Title BookName="Program VB" id="6
-
- 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
-
- How do I calculate amount of hours using DateTime
by Jake H
- 9 Replies
- Last post
by Jake H
- Hi all.
As the title says... how do I calculate the amount of daily hours worked by an employee
I'm pretty sure this is probably basic but I'm a novice and I'm trying to write a basic app to act as a weekly timesheet, either with VC# or ASP.Net
I'm using DropDownLists to enable the user to select a starting hour and a finish hour.
The calculation I'm using is (12 - startTime) + finishT
-
- Around...
by Uri Kartoun
- 2 Replies
- Last post
by ~rabin
- Is there such a command
I mean, let's say I have a variable named "variable1":
Code Block
double variable1;
if (Around(variable1, 23, 0.3))
{
Do something...
}
I'm looking for a command that checks if variable1 is in the range of 22.7 and 23.3.
If such a command doesn't exist it would be nice if C# had this command feature.
-
- Overloading index operator
by Azurewrath
- 8 Replies
- Last post
by IsshouFuuraibou
- Hi, In the book I read, there is an example of an indexer like this:
public string this [ string index ]
{
get
{
if ( index.Length == 0 )
{
// Handle bad index
}
return this [ findString ( index ) ];
}
set
-
- Moving classes into folders and namespaces
by ZZajoman
- 2 Replies
- Last post
by ZZajoman
- Hi, guys.
I have declared a class CSomething in my root project folder. My project is named MyProject so my CSomething class is inside a namespace named MyProject . Now when I create a folder named Controllers and create another class ( CController ) in that folder, it is inside a namespace named MyProject.Controller , which is fine. But now, when I move the CSomething class to that folder,
-
- C#, method overloading
by recherche
- 6 Replies
- Last post
by Chad Moran
- Hi!
In the following method overloading, the method call, "mc.myMethod(0)" calls only the method with int parameter, why How to call the other methods using the same method call
using System;
class MyClass { public void myMethod(sbyte a) { Console.WriteLine("Parameter sbyte: a = {0}", a); }
public void myMethod(byte a) { Console.WriteLin
-
- accessing inner exceptions in embedded try catch
by rtaiss
- 9 Replies
- Last post
by ShellShock
- when we have a global try catch and a lot of small try catches inside the code. How do I get the embeded inner error that causes an error if this exception is located many levels inside the code
The thing is if I use throw exception , my code will not continue, right , but the whole point of using try catch is that I want my code to continue execution.
Thanks
-
- Can I intercept windows messages of other applications ...
by AngelosP
- 7 Replies
- Last post
by master5001
- Hi all,
I was wondering if it is possible to intercept windows messages (e.g. WM_PAINT, WM_ACTIVATE, etc.) of other applications using C#. If it is, I'd like to know what it involves.
My goal is to intercept and filter out certain windows messages before they reach a certain application.
Thank you in advance
Angelos
-
- Cannot Add References
by perryt
- 4 Replies
- Last post
by perryt
- Something on my machine seems f'd up. I can create new .net projects. I can edit existing projects. But I cannot add a reference to a (non-system) DLL. Everytime I get the message that it must not be a compatible DLL. Mostly I have been trying to add the Microsoft.Application.Blocks.data dll. Please please help me !!!