|
As
Far
As
I
Know
Free your mind...
|
|
|
|
|
as far as I know
scio me nihil scire
My OpenSource(zlib/libpng License) Engine:
http://sourceforge.net/projects/rendertech
Its incurable, its a Pentium division failure.
|
|
|
|
|
how do you default the focus to be on a certain control when a dialog comes up?
the following line in the constructor is not doing it.
this.m_OkButton.Focus();
Elena
|
|
|
|
|
Set the TabIndex of the control you want to have initial focus to 0, adjusting the other controls with TabStop enabled. You can do this easily in VS.NET by click the View->Tab Order when a form is open in the designer.
The Focus method only works when a control (including a form) is already open.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Can anyone tell me why Adj get assigned the value of -1 in this code ?
string Line ="$ID\\SITE\\\\\\AG";<br />
int Index =8;<br />
int Adj = Line.LastIndexOf("\\\\",Index);
It LastIndexOf method works fine if I do not specify as start position, but even if the start position is 1 Adj gets assigned -1.
|
|
|
|
|
Change the code for this and it'll be easier to understand:
string Line = @"$ID\SITE\\\AG";
int Index =8;
int Adj = Line.LastIndexOf(@"\\",Index);
What's happening is that each pair of '\' only really generates a single '\'.
Trying to make bits uncopyable is like trying to make water not wet.
-- Bruce Schneier
By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn
|
|
|
|
|
right but I'm search then searching for the last index of "\\\\" or \\, which should give me the value of 9 in adj right ?
string Line ="$ID\\SITE\\\\\\AG";
int Index =8;
int Adj = Line.LastIndexOf("\\\\",Index);
|
|
|
|
|
But you're starting your backward search at character position 8, so 9 and higher isn't even evaluated. See my other post (which I must've been typing while Daniel posted his) for more information.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
By setting Index equal to 8, you're starting your backward search at index 8 and working backward, so there is no instance of @"\\" . String.LastIndexOf - if provided a start index - will begin searching from there and search backward. See the documentation for String.LastIndexOf in the .NET Framework SDK for more details and pretty thorough example.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Crap...so obvious...thanks Heath
|
|
|
|
|
How can I convert a DateTime variable to double time representing time as a modified Julian date?
Information:
Modified Julian date
Time is represented as a modified Julian date. A modified Julian date is the Julian date minus 2400000.5. A modified Julian date represents the number of days since midnight November 17, 1858 Universal Time on the Julian Calendar. A modified Julian date is chosen instead of the (unmodified) Julian date because the numbers become smaller and also higher precision in representing time is possible. Julian dates are often used in hydrology.
|
|
|
|
|
JulianCalendar class.
MSDN has some sample code for it.
Mazy
No sig. available now.
|
|
|
|
|
I am trying to write a windows service to monitor activity on the serial port. I can write a simple service, but I am not sure how to monitor the serial port. I was wondering if anyone out there knows how to monitor the serial port in a service. Any help would be appreciated Thanks Tim
|
|
|
|
|
|
Right, i am having 1 of them shouldnt have got up days, so this is probably a real simple question.
i have created a base form that has an IE object and a few buttons on it, i then create a new form that inherits from this base form. The code compiles fine and when i run the app the inherited form shows ok and i can click the buttons etc. But when i view the inherited form in studio at design time the form does show and i get the error message "The path is not of a legal form".
Eh? Where have i gone wrong, what path is wrong?
Ta
Simon Wren
simon.wren@nesltd.co.uk
Senior Software Architect
National Energy Services Ltd
Visit Us: www.nesltd.co.uk or: www.nher.co.uk
|
|
|
|
|
The designer can be pretty finicky at times. In order to create an inheritted form that VS.NET likes, right-click on your project and click Add Inheritted Form. You're project will have to had been built at least once with the form from which you want to inherit. If you want the new form to be able to access controls on the inheritted form, click on the controls in the original form and change their access modifiers in the PropertiGrid to protected or public.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I am writing a MDI application where the child windows contain active x controls that request metering information every 100 ms.
When the child forms are deactivate the keep requesting metering information so that the user can tile the forms and see the meters updating.
I want to stop the control reuesting data when it is hidden by another window and not visible. Does anyone know how I can tell when a form or region is hidden by another window?
WM_PAINT events are only generated when a part of the window which was hidden is exposed again. I want to know when it was painted over so I can stop wasting processing and comms. band width for a control no one can see.
Any suggestions would be most welcome.
|
|
|
|
|
You can test the window against each other window of your MDI Application.
Calculate the boundary rectangle of the window and check, wether the boundary rectangle of the window to test is covered:
<br />
Rectangle testrect=new Rectangle(testwin.Left,testwin.Top,testwin.Width,testwin.Height);<br />
<br />
foreach(Form f in MDIChildren)<br />
{<br />
Rectangle winrect = new Rectangle(f.Left,f.Top,f.Width,f.Height);<br />
<br />
<br />
}<br />
|
|
|
|
|
no need for the composite if clause in:
occcy wrote:
// some code to check, wether the testrect intersects winrect or lies entirely within the winrect
// if((winrect.left<=testrect.left)&& ...
just stick this in there:
if( winrect.IntersectsWith( testrect ) == true ) {
}
|
|
|
|
|
I want to send email from my ASP.NET and Web service application,So I use SmtpMail and MailMessage class, In my developing computer I didn't do any setting(I mean Virtual Mail Server in IIS) but when I use my dial up connection and my mail server(both are from the same ISP),it works OK(if I use another dialup connection from another ISP it does not work). Now my question is if I upload my application and I use mail server in that domain, can I be sure that it will send emails?
Mazy
No sig. available now.
|
|
|
|
|
This all comes down to configuring your SMTP server. When you connect to one ISP, your SMTP Virtual Server routes messages to it and your ISP allows it either because they allowing relaying from anywhere (EXTREMELY stupid and the cause for a lot of SPAM being sent) or from connected clients. The other ISP probably doesn't allow you to relay either because they don't allow relaying from clients at all, or because your SMTP Virtual Server is configured to use a domain that it won't relay (like the domain for your other ISP).
When you put the application on a production server, make sure it has CDO installed, either from the SMTP Virtual Services or from Microsoft Exchange, either of which is a CDO server. These must be configured correctly to either relay mail for their own domain (which pretty much goes without saying) or to forward to anther SMTP server to relay the messages (which is what your SMTP Virtual Services on your workstation is doing).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
When you put the application on a production server, make sure it has CDO installed, either from the SMTP Virtual Services or from Microsoft Exchange, either of which is a CDO server.
I still do not register any domain, my customer have to do it, but I have to tell him the requirements. What does CDO stands for?(Abbreviate of what), does SMTP Virtual Service is an UI tools which is availabe for the admin of users and isn't it automaticlly set usually or always should be registered by hand? Sorry, maybe these are dumb questions but I don't have so much admining experience.
Mazy
No sig. available now.
|
|
|
|
|
CDO is Collaborative Data Objects, and your clients don't have to worry about that. It's a simple MAPI COM server (or extended MAPI, don't remember off-hand) for client applications to use. Both the SMTP Virutal Services and Microsoft Exchange provide CDO. All they need to worry about is that their SMTP server - no matter what it is - is configured properly, which most likely isn't a problem since - if it wasn't - no mail will be sent and received. Also note that the SmtpMail.SmtpServer doesn't have to be the localhost.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks Heath for the help.
Mazy
No sig. available now.
|
|
|
|
|
I personally use OpenSmpt. Works great and provides authentication and does not require anything setup on the server, just provide the account information in the call.
Rocky <><
www.HintsAndTips.com
|
|
|
|