HOME

Share

Some tips in C#

Are you working with ASP.Net? Then...your companion is here....
Ask anything...you will get a solution...

Some tips in C#

Postby David on Thu Jun 10, 2010 12:19 am

Creating DLL for windows application:
--------------------------------------

1. Create new project. select the Class Library Templates.

2. Create Required Classes, Release the library, .dll file will be in Bin folder.

3. We can add Project->Add reference -> projects tab to refer a dll to other projects.

4. we can Release a project and the exe file will create in Bin folder.

5. We can call a function from DLL to a project by using code in Program.CS
[DllImport("DllName.dll")]
public extern static bool GetNextItemFromQueue(ref aStruct theStruct);
We should need to include namespace
using System.Runtime.InteropServices;
6. System.Collections
hashTable, SortedList, dictionary,
hashtable Hstbl = new hashTable()
SortedList Slist <float, DateTime>= new SortedList<float,DateTime>();
Dictionary<int, List<PointF>> Dict = new Dictionary<int, List<PointF>>();


7.We canuse thread pooling in C# like this.

System.Threading.ThreadPool

if (!ThreadPool.QueueUserWorkItem(new WaitCallback(TheMethodNameToPutinThread)))
{
throw new Exception("Cant queue the work on the Threadpool");
}

8. To refresh GUI in C# Windows Form call this.Invalidate();

9.
David
 
Posts: 114
Joined: Mon Jul 14, 2008 12:07 pm

Return to ASP.Net

Who is online

Users browsing this forum: No registered users and 1 guest

cron