|
Is there anyway to fire an event when the mouse moves over the notifyicon? and another when it moves out?
JGA
|
|
|
|
|
I would like to increase the height of the rows in the datagrid whenever data is binded to the grid.
So, How do I get the notification whenever the datagrid is binded to a Datasource.
The DataSourceChanged event occurs only when there is a change in the DataSources value. When I bind the same datasource to the datagrid, the DataSourceChanged event won't fire.
How can this be handled.
Thanks in advance.
Subrahmanyam K
|
|
|
|
|
hi Subrahmanyam K!
try to shadow the DataSource property, like this:
public new object DataSource
{
get {return base.DataSource;}
set
{
base.DataSource = value;
}
}
hope that helps!
microsoc
|
|
|
|
|
Hi
a simple question cause due to a C++ to C# migration.
Is there a User thread available (not a worker thread) like the CWinThread in VC++
codito ergo sum
|
|
|
|
|
Is System.Threading.Thread what you are looking for?
|
|
|
|
|
I dont thinks so,
It seems to me that this is a worker thread object, a function is called in a different
thread but when the function is done the thread will end. In my case the threads need to
be up the whole time. And I need to send system messages from/to the different threads in my application.
I don't find functions or objects to do this. Am I missing something??
codito ergo sum
|
|
|
|
|
When the function is done, the thread will always end. If you want the thread to keep running, you just have to keep the function from ending. Put a look in it that listens for messages. If there is no messages, let it sleep for a while.
---
b { font-weight: normal; }
|
|
|
|
|
You must be talking about User-interface threads which have a message pump. I think you will have to play with Application.Run and Windows Forms.
|
|
|
|
|
Something like that, but the threads have no GUI.
How can I achive a message pump ??
codito ergo sum
|
|
|
|
|
hi
i need to convert the poiners in c++ to C#
how can i do it ?
for example i have this code in c++
and the main problem is with the *Word
i need to use the same funtions (i have dll for the them)
but i have problems with the variables or parameters
void *StopMemory;
int ErrorCode;
int LanguageID = 1;
int CharCodeID = 1;
char *Word = "the";
ErrorCode = ExtrCreateStopMemory(&StopMemory);
ErrorCode = ExtrAddStopWord(StopMemory,LanguageID,CharCodeID,(void *) Word);
hope somebody will help me
thanks
eyalso
|
|
|
|
|
To use pointers in C# you have to put them within a class defined as "unsafe" through the unsafe keyword.
|
|
|
|
|
the unsafe keyword can also be used inside a function
unsafe
{
//code with unsafe pointers
}
be sure to use the -unsafe compile option when building!
|
|
|
|
|
Marshal, Marshal, Marshal
You can use Managed C++ or C++/CLI to wrap the native code or use P/Invoke from C#.
|
|
|
|
|
Hi, to make my code readable I'd like to write a reference to a variable that is embedded in a structure. For instance,
double Xmax = Xset.Xmax.X
double Xmin = Xset.Xmin.X
where Xset.X{}.X is a double itself. The code I just write above returns a copy. In c++ I'd just assign a pointer to .X and use Xmax or Xmin thruout the code. Changes to Xmax / Xmin in that case change Xset.Xmax.X etc.
Is there a way in C# to set Xmax / Xmin as a reference to the .X values?
Thx.
|
|
|
|
|
You're asking for reference semantics on value types. You can do this between methods using the ref keyword:
int i = 5;
MyFunc(ref i);
void MyFunc(ref int someInteger)
{
someInteger = 10;
}
But in order to get reference semantics throughout any piece of code, not just between methods, you have 2 options.
1. Use unsafe code. Just as it is in C, you can use pointers the same as you would in C. Only caveat is that you need to compile with the /unsafe switch, and also mark code that uses pointers with the unsafe keyword. For example, the following is perfectly legal C# code:
unsafe
{
double someVal = 200;
double *c = &someVal;
}
2. Use a wrapper class to wrap your value, thus automatically giving it reference semantics:
public class Wrapper<T>
where T : struct
{
public T Value;
}
Wrapper<double> Xman = Xset.Xmax.X;
Wrapper<double> Xmin = Xset.Xmin.X/
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
No, you can't reference a value type.
You can get a pointer to the values, but that would cause two nasty things:
1. You would have to use the fixed keyword to fix the object in memory. The garbage collector doesn't really like if you fix objects for a long time, as it wants to move stuff around sometimes.
2. You would have to use the unsafe keyword whenever you would access the values, or make the entire code unsafe (which is an extremely bad idea).
If it's only the simplicity in the code you are after, just declare properties to access the values:
private double Xmax { get { return Xset.Xmax.X; } set { Xset.Xmax.X = value; } }<br />
private double Xmin { get { return Xset.Xmin.X; } set { Xset.Xmin.X = value; } }
---
b { font-weight: normal; }
|
|
|
|
|
To both of you,
Thanks for your clear responses. I particularly like making Xmax and Xmin local properties... didn't think of that.
I think I'm good to go now.
|
|
|
|
|
How do I send Arguments to an executeable?
Any help is appreciated.
<marquee bgcolor="#000000" loop="-1" scrollamount="6" width="100%">
Wacky waving inflateable arm flailing tube man!
|
|
|
|
|
It depends, do you want to send an argument during debug, or for a 'released' exe?
If you are debugging you want to go to your projects properties (not the solutions) and under the 'debug' tab there's a textbox for 'Command Line Arguments'.
For use with an actual exe, create a shortcut to the exe, open the shortcuts properties. There will be a textbox titled target (in winxp). put the path that's in the in quotes ("path\to\exe") and then you can put any arguments behind that.
|
|
|
|
|
|
|
Hi All!
I have a problem on my PC, when i am trying to send email i get an error, a very large one, what the hell is the problem( i dont use outlook on my PC, is it relevant?)
use: System.Web.Mail.SmtpMail.Send("y@hotmial.com","y@hotmail.com","Test","Test");
error: System.Web.HttpException: Could not access 'CDO.Message' object.
Thanks
and another small thing, i wrote a function in my html page, i did:
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
now i got the page that i wanted, how can i use this object in my C# code page?with document?how?
Thanks again
|
|
|
|
|
Just guessing here, but did you set the SmtpMail.SmtpServer property correctly?
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
what do you mean?
i do not know what it this? and where i cahnge it?
|
|
|
|
|
yes i did!!
sorry, did not know that you mean about the function.
my Bad.
|
|
|
|