-
- Using a #define statement
by shades921
- 3 Replies
- Last post
by IsshouFuuraibou
- Is there a way to store multiple variables in a #definestatement I'd like to have a defined "backcolor" for my background color. The color is set with the (R,G,B) setting. is there a way to have a #define statement such as #define backcolor (r,g,b) where r,g,b are ints within the range of accecptable values if not, what would be a good alternative insteadad of having to give the specif
-
- Methods/WebService called with regular intervals
by vsa
- 6 Replies
- Last post
by frederikm
- Hi guys, I have a website that needs cirtain jobs do be done with regular intervals like once a day or every 10th day or so. This is easilly done with cron jobs in *nix environment, but my question is, is there any ways of doing this in .Net environment
-
- how do you apply a class
by twilightown
- 9 Replies
- Last post
by bklare
- hello all, I am new with C# and stuck on some coursework I have created a class: public class student { //start of class declaration public string name="Jane Doe"; public string course="Multimedia and Internet Systems"; public string email="test@test.com"; } how do I apply the class to a textbox so that when the user selects one of the details say name then the name will appe
-
- Factory pattern problem
by KirkAtCenterstance
- 4 Replies
- Last post
by Vivek Ragunathan
- I'm using a standard factory pattern implemention in my solution. I'm having a problem accessing the members of my concrete class that are not members of my interface.
Everything seems to work fine, but my publicly exposed members are not visible in my client when a create a new reference to the class. Funny thing is, if I look in the Locals of my instance, I can see these members in the i
-
- Boxing information required
by Chryso
- 14 Replies
- Last post
by Chryso
- Hello For the purpose of the question I ll use stuff that may look stupid. Lets say you have the following structure: struct myStruct{
public object myObj; } Now lets declare a list like this: List<myStruct> myListOfStruct = new List<myStruct>(); and a temporary holder myStruct tmpMyStruct = new myStruct(); Now lets iterate through the list for (int i=0;i< myListOfStruct.Count;i+
-
- Best storage practices
by R. Alex
- 6 Replies
- Last post
by O.Miller aka phoboss
- I have a few ideas for several software packages that I'd like to take a stab at creating with C# but I'm stuck with how and where I'd like to store the data generated. I don't expect there would be a tremendous amount of records involved but there are things like schedules, tasks, logs, etc... I'd like to start out creating a shareware or maybe attach a small fee so that means keeping my tools re
-
- Get the running instance of the program!!
by TheMaj0r
- 2 Replies
- Last post
by TheMaj0r
- Hello,
How to get the the current running instance of my application when i execute the application
Like MSN Messenger, if i run one instance of it, then any trial to execute the program will activate the current instance!!
I know some techniques to ristrict programs to run only 1 instance but how to get to this instance
My program is used to watch created file, so it runs invisibl
-
- InvalidOperationException
by Sniper167
- 14 Replies
- Last post
by sirjis
- I got an Exception on this line: " whois.Lookup(listBox1.SelectedItem.ToString());" and I don't know what to do...
System.InvalidOperationException was unhandled Message="Cross-thread operation not valid: Control 'listBox1' accessed from a thread other than the thread it was created on."
So I tried this:
private void setListBoxSelectedItem( Strin
-
- Algorithm for getting a value from a dynamic logarithmic scale?
by Sire
- 4 Replies
- Last post
by Sire404
- Hi all,
Perhaps someone can help me with this. I just got the payback for skipping too many math classes, so bear with me and my misuse of math terms...
I want a function that converts a linear value to a logarithmic counterpart, with the ability to adjust the "curve" of the logarithmic scale.
The function can look something like this:
Code Snippet
double Sca
-
- How to invoke a method defined by a derived class from the base class reference?
by YouMiss
- 8 Replies
- Last post
by eradicator
- Code Block
public class Information
{
public virtual void ToLog();
}
public class InformationA : Information
{
public override void ToLog()
{
// Override details.
}
}
public class InformationB : Information
{
public override void ToLog()
{
// Override details.
}
}
// Somewhere else in the program
...
-
- Modifying an exception by ref?
by AaronLST
- 4 Replies
- Last post
by AaronLST
- I'd appreciate opinions on how to handle this. I created a generic Retry function that implements some logic for retrying an operation until it is successful or a user cancels operation. One essential part of this Retry functionality is allowing the caller to specify a delegate that handles an exception and returns a bool indicating whether retrying should continue or not. This allows the delegate
-
- Order of properties, methods
by Azurewrath
- 9 Replies
- Last post
by Azurewrath
- Hi,
Is it better to write properties before methods in an interface Is there a optimal or preferred order for this and classes Like:
class def
{
properties
constructors
public property methods
methods
etc
}
Thanks,
aw
-
- Importing virtual functions from a Dll
by Ventsislav Velev
- 1 Replies
- Last post
by Peter Ritchie
- I'm using VS2005 and I'm trying to import a bunch of unmanaged classes from a dll. The DllImport attribute, requires you to declare you methods as static extern, however that does not mix well with virtual functions. I'm getting the following error: "Error 1 A static member CreateSignatureForSinglePackage(out byte[], int, out byte[])' cannot be marked as override, virtual, or abstract"
-
- Can't See the Toolbox
by CyBri2000
- 2 Replies
- Last post
by CyBri2000
- I had something happen while programming C# in Visual Studio where all my windows (Solution Explorer, Class View, Output, etc.) undocked from the edges of the window, and many of them were turned off. I went on the View menu and got most of them back, but when I hit the button the View menu to show the Toolbox, nothing seems to happen. I've tried turning it on and off several times, and I tried re
-
- I am such a beginner
by Gary Mitchell
- 12 Replies
- Last post
by Gary Mitchell
- I would like to understand these parameters better ( object sender, EventArgs e) and would like to know what Debugging Symbols are. If anyone could take the time to answer a beginners questions, I would truly appreciate it.
-
- Which One is faster????
by Saurabh Surana
- 8 Replies
- Last post
by Matthew Watson
- I have heard that in C# .Net the notation if (flag) should be prefered over if(flag == true) or if(true == flag) Is there a difference in above statements Which one gives better performance and why Many Thanks,
-
- Clearing class instance
by Navaneeth
- 5 Replies
- Last post
by Navaneeth
- Hi, Please check the following code,
Code Block
class MyClass
{
public static int Count = 0;
public MyClass()
{
if(count == 5)
//I need to destroy this instance
else
count++
}
} I tried to distroy like this = null. But it throws error like this is readonly. How can I do this. I want to restrict the class instances to 5. If count goes more than
-
- Datetime problems...
by Paul Allen
- 2 Replies
- Last post
by Paul Allen
- Hi, I am trying to set up a scheduling type of function in a web application using c#. Basically, the user picks a date on a calendar and then selects an option in a dropdownlist. The dropdownlist is populated like:
00:30
01:30
02:00
and so on....
I then take that data and insert it into a sql database as 1 column. I first tried parsing to strings etc but ran into a whole
-
- use of Debug folder's Database ?????
by Deep_p_patel
- 5 Replies
- Last post
by Peter Ritchie
- what to do with copy of debug folder for the database file
is it important for Database point of view
Dabase copy...
1. in local folder. (path)
2. debug folder's copy
3. main project's folder.
what is the different use of this copyies
-
- what is the difference between component and control
by omp4u
- 5 Replies
- Last post
by Christian Liensberger - MSP
- hi all!
can anybody tell me what is the difference bw component and control.
-
- where are WM_ messages
by 4B7
- 3 Replies
- Last post
by sirjis
- I am coming over to C# from C++ and am overriding WndProc but get an error that says "the name WM_CHAR does not exist in the current context" is there a namespace that I need to include to have access to use this, or is it done entirely differently in C#
-
- Performing 2-way encryption using the RijndaelManaged Class
by jayduffus
- 1 Replies
- Last post
by Citizen on the earth
- I have been tasked with creating a single-signon (SSO) functionality using a 2-way encryption hash. I found examples using RSA encryption, but is there a way of implementing a 2-way encryption hash using the RijndaelManaged Class Can someone point me to a good article or email me an example Thanks in advance.
-
- Resources for Class Libraries
by h1
- 4 Replies
- Last post
by boban.s
- Hello,
I have a class library (dll) that will be used by multiple applications. I've put the error messages in that class library in the Dll's Resources.resx file (as embeded resource).
Mostly because I thought once the application is localized the Dll's resources.resx would help with localization.
However, I'm not sure how I can take advantage of this resx now to allow for l
-
- Converting from unsigned char* to Bitmap
by Annyms
- 3 Replies
- Last post
by Peter Ritchie
- Hello all,
I'm having trouble converting an unsigned char* into a Bitmap image. I have an unsigned char* in managed c++ code, which points to a 1280x1024 image with 8bppIndexed as the pixel format. When I display the image using the raw unsigned char* I'm getting the right image.
In order to display the image on a C# console window, I need to convert the image from my C++ code in a Syste
-
- I have a problem using class Directory
by claudiu.glogovetan
- 2 Replies
- Last post
by James Curran
- My Directory.CreateDirectory(destinationDirectory) method do not create my directory on the disc ! has anioane any ideea why is it doing this