|
Actually i forgot to mention one more thing , The component class is only a sketch to understand , in real i m using these static function form a dll named Component. for which i dont have acess to implementation code of these Static function.i m just using the functionality.
So if there is any other possibility plz let me know.
Thnx
|
|
|
|
|
You can create a static object in the event handler class instead.
Something like
class XYZ
{
static object syncObject = new object();
void SomeMethod()
{
abc.SomeEvent += new SomeEvent(SomeEventHandler);
}
void SomeEventHandler(...)
{
lock(syncObject)
{
Component.Method1();
...
}
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Well!
First of all thnx for Reply. Ok i m already calling these functions in the delegate MyDlg that is called whenevr Capture event occurs then how can i add an other event handler and call these functions. may i do this as below
myobj.Capture+=new CaptureEventHandler(MyDlg);
static object syncObject = new object();
private void MyDlg(---,--,---)
{
lock(syncobject);
Componet.St_F4(--);
lock(syncobject);
Componet.St_F1(--,--,---);
if(myobj.id==1)
lock(syncobject);
Componet.St_F3(---,--);
if(myobj.id==2)
lock(syncobject)
Componet.St_F2(--,--);
}
|
|
|
|
|
If you lock each function call, then at any point in time, only one thread could be executing a function. Which is what you want, so yes, it works. But there is a difference between the behavior of
private void MyDlg(---,--,---)
{
lock(syncObject)
{
Componet.St_F4(--);
Componet.St_F1(--,--,---);
Componet.St_F3(---,--);
}
}
and your code. The code above makes sure that at one point, only one thread can execute the whole sequence of functions (F4, F1, F3...). So if you have two threads, they will run like
Thread1
-------
Component.ST_F4
Component.ST_F3
Component.ST_F1
Thread2
-------
Component.ST_F4
Component.ST_F3
Component.ST_F1
With your code, the behaviour *could* be
Thread1
-------
Component.ST_F4
Thread2
-------
Component.ST_F4
Thread1
-------
Component.ST_F3
Component.ST_F1
Thread2
--------
Component.ST_F3
Component.ST_F1
Or in any order. If you're fine with that, go ahead.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thnx for reply!
I m almost very near to my solution. Ok What i want is that two threads could have acess to static functions at one time but these function should be different. that means let thread t1,t2 may have acess to static function Componet.St_F4(--);
Componet.St_F1(--,--,---); respectively. that is
t1---->Componet.St_F4(--);
t2--->Componet.St_F1(--,--,---);
is it so as i did b4. or how to achieve this
|
|
|
|
|
My DataGrid has DataSource with 2 related data tables:
A --> B. When I expand A's row, DataGrid display relation name, then I click on Relation name, Data Grid display ralated B's rows.
But I don't want to display relation name before display related child table's rows.
How can I do?
dhtuan
|
|
|
|
|
I'm writing an app in C# .net 2.0. I want to have a TreeView where the first
level of nodes would have check boxes, but their subsequent children would
not have check boxes.
Is this achievable using the .net controls? If not, how can I make this
possible?
Thanks,
Andy
|
|
|
|
|
Simple question really, I am fairly certain the answer is no.
Are there any cryptography systems out there that support skeleton keys?
i.e. A group of users all have there own "private key" which is used to encrypted data, but an administrator has a skeleton key that is capable of decrypting anything encrypted by the users regardless of the private key they use.
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
Have you google'd around on this? I am not sure if it is possible...
PC
|
|
|
|
|
Does anyone have a method for retrieving the 'real' hardware serial number of a hd without requiring administrator rights?
There is an article on this site which uses win32_physicalmedia to obtain the serial, but this doesn't work without admin rights.
I have heard that its possible through a windows api? but how?
Any help much appreciated.
|
|
|
|
|
Hi, Im developing a localizable aplication, so I add language support to my forms a and dialog messages whit resx files.
all is good but if I change something in my forms i miss some messages and control language definations in resx files.
So, what can i do?
Ho do you implement localizable languanges in your applications.
I use VS.c# 2005 express.
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
For serious use buy a localization tool. It will track deltas, carry over resize, protect against changes on data that is not localizable (as Microsoft pretty much managed to make one of the worst beginner misktakes when designing the resx format - they did not separate translatable strings from strings that should be changed by engineers/programmers).
If it is a small home project you probably have to do it the hard way - manually. VS really isn't meant as a localization environment for anything but small hobby use.
|
|
|
|
|
Thank you!
Is sad to hear that but I think is true too.
My project is a framework for business aplications, so I will study the tools that are n market or I will make somethig for my needs (read, write, import, export resx files for control.text properties,tooltips,helpstrings and custom messages strings)
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
TRY using StringDB at www.swbox.com
- supports ALL languages in the world (ASCII, UNICODE, UTF-8)
- uses MS Excel files for translation
- You can change language and strings without recompiling the software
- Non-technical people can prepare new language releases
- Is being used by embedded devices and also PC software
coldstone
|
|
|
|
|
Hi,
I am creating a project using typed dataset for the first time.
The DataTier returns a dataset of the .xsd type to the webservice
//dsEmps is the .xsd
public dsEmps GetData()
{
string strSQL = "SELECT EmployeeID, LastName, FirstName, Title, TitleOfCourtesy, BirthDate, HireDate, Address, City, Region, PostalCode, Country, HomePhone, Extension, Photo, Notes, ReportsTo, PhotoPath FROM Employees";
string strConn = "Server=localhost;" + "DataBase=Northwind;" + "Integrated Security=SSPI;Connect Timeout=5";
dsEmps dsData = new dsEmps();
using(SqlDataAdapter oDA = new SqlDataAdapter(strSQL, strConn))
{
oDA.Fill(dsData, "Employees");
return dsData;
}
}
here if I use the dataset as below:
placing a dot after the dataset (i.e. dsData) shows the Employees table and then placing another dot shows the field names...
This is good so far. But the problem is that in the webservice where I get the returned dataset as below, I can not get the column names after daData.Employees.
//EmpData is the datatier...
public EmpData.dsEmps GetData()
{
try
{
EmpData.Employees dc = new EmpData.Employees();
return dc.GetData();
}
catch
{
throw;
}
}
Can you see why this is the case?
Thanks
|
|
|
|
|
I need to create a site using sharepoint, and to be honest I have no idea about sharepoint. I am willing to learn though. Can anyone give me suggestions or URL for an article with an example on how to work with sharepoint?
Any help is very much appreciated.
Thanks!!
Winning is not Important. Wanting to win is!!!
|
|
|
|
|
Download the Windows SharePoint Services with Service Pack 2, install it, and read the SPS Online Help. It has a whole lot of information on SharePoint initialization, administration, and customization.
I just finished customizing a SharePoint installation for Ernst & Young for Sarbanes-Oxley compliance. At the beginning of the project, I knew nothing of SharePoint. I found the online help indispensable.
To supplement the books, I read the blogs by the SharePoint developers. Google for SharePoint blogs and you can read those, too.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Does anyone know of any API for Visual Studio that has functions for sending Short Message Service (SMS) Text Messages to Cell Phones??
I know there are a few services out there you can connect to and send messages using SOAP/XML messaging but these services are NOT free.
MSN Messenger has a feature that allows you to send a Text Message to any mobile device. If this is possible through MSN, then there must be an API available for developers to include this feature in their apps??
Any info is much appreciated.
mheese@inebraska.com
|
|
|
|
|
Can someone point me in the right direction? I’m trying to write a MDI application that has an invisible parent window. (I’m assuming that’s kind of how it would work) Like MS Word. Each instance of a document is in its own form but all forms are children of winword.exe
I like the idea of the hierarchy that is made with and MDI but I don’t like having everything inside one container form.
Also can someone point me in the direction of how to make dock-able forms. Something like Dream weaver where you have the option of having all the windows under one container or you can have each window as a separate window.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
I'm working on a C# application that uses the Windows Media Player to play my mp3s.
I'd like to catch the EndOfStream event to move to the next mp3, but I don't have a clue how to build this.
Can anyone help with some code?
Thanks
|
|
|
|
|
|
|
hi all
I was making a non rectangular form in C# using a bitmap with a white background and set the transparency key property of the form to white and it works but when I color quality from the system properties to 32bit it didn't work
is there any way to overcome this
or is there a different method for drawing a non rectangular form using images
thx for your interest
|
|
|
|
|
The problem is that you may be using a 24bit image and it has some problems (I don't know why?) with 32bit color quality. Anyway there is a solution for this problem:
1) Load the image manually in the Load event(or wherever you want):
Bitmap bg;<br />
bg=(Bitmap)Bitmap.FromFile(@"Your image.bmp");<br />
bg.MakeTransparent(Color.White);
Instead of this you can use an ImageList and don't forget to set the TransparentColor property
2) Draw the image in the Paint event:
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)<br />
{<br />
e.Graphics.DrawImage(bg,0,0,this.Width,this.Height);<br />
<br />
}
Another approach to this could be using regions, but it is more complicated, if you want to learn more about this please let me know and I'll try to show you an example
Pablo Hernandez Valdes
|
|
|
|
|
Hi Pablo Hernandez
Many thx for your efforts to help me and others, i had used the code that u send to me and it didnt work see the code
Bitmap bg;<br />
private void Form1_Load(object sender, System.EventArgs e)<br />
{<br />
bg=(Bitmap)Bitmap.FromFile(@"C:\Documents and Settings\sabry\Desktop\tt.bmp");<br />
bg.MakeTransparent(Color.White);<br />
}<br />
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)<br />
{<br />
e.Graphics.DrawImage(bg,0,0,this.Width,this.Height);<br />
}
and also i changed the transparency color to white
i want to know why it didn't work in all color qualities
and i want to know about the other methods
again many thx
|
|
|
|