|
Ok, but how must I initialize those variables?
Regards.
modified on Thursday, November 19, 2009 3:34 AM
|
|
|
|
|
grefu wrote: Ok, but how must I initialize those variables?
You need to set them to instances of their classes. I have no idea what this entails as I know nothing of Tapi3lib; you need to read the documentation.
|
|
|
|
|
Hi.
I suppose that I must use this code:
<br />
private ITCallNotificationEvent cne;<br />
...<br />
string callerid = cne.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLEDIDNAME);
But error occurs:
(sorry for translate)
'Referencia a objeto no establecida como instancia de un objeto'
'Object reference no stablish as an object instance'
Sorry. I don't know much about C# and I'm not be able to continue with this.
Your help is much apreciated.
Regards.
|
|
|
|
|
grefu wrote: I suppose that I must use this code:
private ITCallNotificationEvent cne;
...
string callerid = cne.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLEDIDNAME);
No, it's still wrong, cne still has no value.
grefu wrote: Sorry. I don't know much about C# and I'm not be able to continue with this.
There is much material to learn from if you need it.
|
|
|
|
|
hi guys,
i need some help on graphs for my windows mobile 6.5 application.
I wanna do a finance graph with the stock prices. (x axis = time, y axis =stock price)
On top of that, i would like to add icons to certain point of the graph based on the time.
How can i acheive that? thanks in advance
|
|
|
|
|
|
Hello,
I have a minor problem. I have a Mouse Enter event declared for a Panel Control in c#.
The Event is detected correctly when I enter the panel, but if I have other controls in that panel it does not work.
So if I drag the mouse over a control from that panel, the mouse enter event is not activated. I hope I am explaining correctly.
The ideea would be to get Activate the mouse enter event even if the mouse is entering a control from tha panel.
Hope someone can help.
Thanks
|
|
|
|
|
Two choices:
1. Make all the subcontrol mouseOver events point to the same event handler as the Panel MouseOver Event.
2. Do the same thing, dynamically.
That is, handle the ControlAdded and ControlRemoved events of the panel and add/remove the handler on the fly e.g.
void Panel1ControlAdded(object sender, System.Windows.Forms.ControlEventArgs e)
{
e.Control.MouseEnter += this.Panel1MouseEnter;
}
void Panel1ControlRemoved(object sender, ControlEventArgs e)
{
e.Control.MouseEnter -= this.Panel1MouseEnter;
}
However this second options relies on adding the handlers to the ControlAdded and ControlRemoved events before the sub controls are added.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Hello guys
Can you please help me with this one?
I want to make a mehtod that when you pass it a particular month and year it will return you the ammount of Mondays that are found in that Month of that particular day.
Anyone has any ideas?
Thank you in adavance
Regards,
Christian Pace
|
|
|
|
|
A possibility:
Use DateTime() to discover what day of the week is 1st of the month.
From there you can calculate when the first Monday is.
Then, from the number of days in the month you can calculate how many more there will be.
|
|
|
|
|
|
Code is for VBA but you can figure out from it to write equivalent code in C# or Vb.Net
|
|
|
|
|
That's not what the OP asked for...
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
|
NSS
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Not everyone picks up on these things.
|
|
|
|
|
Do like this :
int year = 2009;
int month = 2;
int nos = 0;
DateTime startDate = new DateTime(year, month, 1);
DateTime endDate = startDate.AddMonths(1);
while (startDate.DayOfWeek != DayOfWeek.Monday)
startDate = startDate.AddDays(1);
for (DateTime result = startDate; result < endDate; result = result.AddDays(7))
nos+=1;
Hope this help.
Cheers.
|
|
|
|
|
Here's a method you could use...
int CountDaysInMonth(int month, int year, DayOfWeek dayToCount)
{
DateTime dt = new DateTime(year, month, 1);
int result = 0;
for(int i = 0; i < DateTime.DaysInMonth(year, month); i++)
{
if(dt.DayOfWeek == dayToCount)
result++;
dt.AddDays(1);
}
return result;
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Improved...
int CountDaysInMonth(int month, int year, DayOfWeek dayToCount)
{
DateTime dt = new DateTime(year, month, 1);
int firstInstance = 1;
if((int)dt.DayOfWeek > (int)dayToCount)
firstInstance += (7 - (int)dt.DayOfWeek) + (int)dayToCount;
else if((int)dt.DayOfWeek < (int)dayToCount)
firstInstance += (int)dayToCount - (int)dt.DayOfWeek;
return firstInstance <= (DateTime.DaysInMonth(month, year) - 28) ? 5 : 4;
}
...I think the logic is right.
[EDIT] That was way off, I fixed now... I think!
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I'm not too sure about the various constants, but it looks like The Right Way to do it
|
|
|
|
|
On second thoughts, it does not look much improved
The constants are OK, they will never need to change
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
harold aptroot wrote: it looks like The Right Way to do it
really?
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
*reconsiders*
Yes?
No seriously, no matter how wrong it was, not having a loop made it much closer than all those other entries..
|
|
|
|
|
What I came up with is similar to that:
public static int
F
(
int Year
,
int Month
,
System.DayOfWeek DayOfWeek
)
{
int d = (int) DayOfWeek - (int) (new System.DateTime ( Year , Month , 1 )).DayOfWeek ;
if ( d < 0 )
{
d += 7 ;
}
int n = System.DateTime.DaysInMonth ( Year , Month ) - 28 ;
return ( d < n ? 5 : 4 ) ;
}
|
|
|
|
|
What??? It does not work?
What's with the 'Bad Answer' again?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|