Click here to Skip to main content
15,178,202 members

Comments by Addy Tas (Top 102 by date)

Addy Tas 11-Oct-12 17:43pm View
Try to find articles related to PhysicalAddress and NetworkInformation, that should do the trick.

Cheers, AT
Addy Tas 11-Oct-12 17:38pm View
I'm going to put my money on the missing .NET version.

Cheers, AT
Addy Tas 31-Aug-12 17:49pm View
If i get your question right you don't have a hotspot but have two wifi clients that want to have direct communication. I'm i right here?
Addy Tas 2-Apr-12 13:34pm View
Well it seems we're down to offering suggestions... When there is no data changed event all you are left with is indeed polling. What may be a good suggestion is to stop the timer on the start of ontick and start it again when the ontick is about to end, that way you'll never be running the ontick multiple times on the same resource.
Hope this suggestion is working for you.

Cheers, AT
Addy Tas 31-Mar-12 5:31am View
Hi, i think you have already figured out that i'm not going to give you the(as if there would be just one) answer. I would suggest that you post what you have tried and i'll give you hints on what you might want to review.

Sounds ok?

Cheers, AT
Addy Tas 30-Mar-12 18:52pm View
I'm wondering if you could be managment material.... trying to make other people work for you is in general not a bad idea. In general also means that sometimes it's a bad idea, homework is needed to learn something. Even if you do not reach the correct answer, you will learn from trying.
Good luck with your assignment and one small remark; don't think to hard, it's really not that complicated. Take it all one step at a time!
Addy Tas 25-Feb-12 17:21pm View
I think this really is a lot better than the previous attempt, showing this i'd give you a try. Naturally you could still extend the example using the factory pattern (know the GOF!!!) but that might take it over the top. As another suggestion that is not related to any OO but more to the coding styles I'd make const's of the magic numbers, taking the magic out, use CamelCase on all the method names (computeSalesTax). I really don't like classes in classes but that might be just me. You may like the internal class declaration here.
One thing that could still use a brush-up is that the shopping cart currently takes care of it's presentation, seperating the BL and it's presentation is always a step forward(unless you don't have to maintain the code :) )

My two cents for now,

Cheers, AT
Addy Tas 3-Feb-12 11:27am View

Yes You should cast the address of the double to a different size.
so pCh = (char*)&dblFreeBytes; should work
Addy Tas 1-Feb-12 16:13pm View
I would say that once you have moved the timer to the class and the start/stop from the connect/disconnect (as suggested below) you should at least get a timer tick (tried a breakpoint?) And if that's working you can move on to the next step; why won't it show up int the listbox...

by the way; you'd also help yourself if you move the event subscription to the class.
Addy Tas 31-Jan-12 11:22am View

Just to be sure; is the firewall turned off on both sides of the line?
Is a regular Ping working?
Addy Tas 31-Jan-12 11:09am View
Hi, I can see many issues in your code; among them are the continuously (re) subscribing to the OnNewData Event, the strange duplicate code of the TimerElapsed / ProcessBuffer. What's also rather odd is that you seem to have a member variable that is called buffer and you pass buffer as a parameter to the ProcessBuffer.
as the Connect button is disabled after the first click on Connect I also suspect that you've not posted all the code of the Disconnect.

By the way; be careful of using magic numbers.

Are you sure that the Connect is actually called on the second try?
Is the Port receiving any data?

Cheers, AT
Addy Tas 31-Jan-12 1:34am View
You have not posted the disconnect code, this may very well give a clue.
Addy Tas 30-Jan-12 6:18am View

If this is all working for you be so kind to accept / upvote the answer so the item will no longer appear on the open issues.
If you have more questions; all you need to do is ask :)

Cheers, AT
Addy Tas 30-Jan-12 3:48am View

You are entirely right; TCHAR is defined in the pre-compile stage which makes runtime changes a bit... well odd.
TCHAR can be really handy for having code that can work single and MBCS or Unicode but better make sure you know what you're doing or you might be accessing something that's not there.


Addy Tas 30-Jan-12 3:29am View

Now I knew you were going to mention and kind of wanted to put this in the previous comment but as it is always nice to have a constructive argument:

Check out line 168 in the tchar.h, just a couple of lines above the TCHAR definition, then the the #else is @ line 838 followed by the char definition on line 1246.

Your example seems fine at first but you have to remember also to undefine the _TCHAR_DEFINED to change the type of the TCHAR.


Addy Tas 30-Jan-12 2:27am View
To argument is always good (unless you need to catch a train) as it is an opportunity to lean something.
I took the following from winnt.h (VS 2005) so it seems that my TCHAR is still one byte.

#ifdef UNICODE // r_winnt

#endif /* !_TCHAR_DEFINED */

typedef LPWSTR LP;
#define __TEXT(quote) L##quote // r_winnt

#else /* UNICODE */ // r_winnt

typedef char TCHAR, *PTCHAR;
typedef unsigned char TBYTE , *PTBYTE ;
#endif /* !_TCHAR_DEFINED */

#define __TEXT(quote) quote // r_winnt

#endif /* UNICODE */ // r_winnt
Addy Tas 29-Jan-12 17:08pm View
Almost forgot; the TCHAR can be either one or two bytes of size, this depends on if you have _UNICODE defined. In the VS project settings you have a entry for use TCHAR as....
If you use TCHAR in one place, make sure that all the manipulation calls (strlen etc.) reflect the same.

Cheers, AT
Addy Tas 29-Jan-12 16:59pm View
Make sure to replace the sizeof(log) by a strlen(log); you're now writing the sizeof pointer to the file.
Addy Tas 29-Jan-12 10:22am View
most of the time the firewall is to blame for this and as there is not much to go on here i'll leave it at that; check the firewall settings.
Addy Tas 26-Jan-12 17:27pm View
As far as i can tell this will not compile, am i right or do you get a runtime error?
Addy Tas 26-Jan-12 17:00pm View
Have you tried Dependency checker from the sysinternals suite?
Addy Tas 17-Jan-12 16:40pm View
If i read the story correct, your biggest issue is that the components (or partsof them) are not transpartently drawn on screen. It might help if you specify what you use for drawing.
Addy Tas 13-Jan-12 17:49pm View

This is what you want to know:

Cheers, AT
Addy Tas 13-Jan-12 17:37pm View
Naturally i can't give you a 100% answer but I'll give it a try.
Option one: you have another copy of the dll next to the exe.
Option two: there is another copy of the dll on a location that is earlier in the Systems Path
Option three: you copy the output to the exe's location. Running this version is ok but without the symbols file the debugger can't really do with it.

I guess these are my two cents for now...

If you feel like it; don't forget to upvote :)

Cheers, AT
Addy Tas 13-Jan-12 17:07pm View
Seems a bit late but i figured; while I'm reading it, why not fix the link.
Cheers, AT
Addy Tas 12-Jan-12 14:28pm View
The question could be an interesting one; when i read the first few lines i start thinking about these nasty weather prediction issues but then... you loose me completely and i have no idea what way you are going. Please elaborate on your question.
Addy Tas 12-Jan-12 4:05am View
Naturally i could not resist that :)
Addy Tas 11-Jan-12 14:23pm View
The article probably has a reference to a license description, the license text will explain what you may do with the code.
Cheers, AT
Addy Tas 9-Jan-12 15:06pm View
I wonder if he could hear the bell ring :)
Addy Tas 1-Jan-12 16:43pm View
I wonder if a guy from the US is going to get monty python-type of humor..
On topic: Any useful exit code in the output window?
Have you tried running it while catching all exceptions when thrown?
Addy Tas 31-Dec-11 4:17am View
Hi, thanks; that saves me the time. I kind of get the feeling that this guy is making others work for him. It would seem that he does not use google and does not read these articles.
Addy Tas 30-Dec-11 7:03am View
I seriously hope for you that 99.99% of the xaml was auto generated.
Addy Tas 29-Dec-11 17:00pm View
Sounds nice but i don't really want to post my email in a forum, if you don't have any trouble with that; just post your email and i'll send you a message. If you post your email now, i can still respond for close to half an hour before i go to bed. Then, once you got my mail you can edit your reply to remove your email addres from the forum.
Addy Tas 29-Dec-11 14:19pm View
Have you tried an intermediate step by going from c++/cli -> native c++ -> native c? If so at which step did you not get what you expected?
Addy Tas 28-Dec-11 16:06pm View
As far as i know there is no way to send a personal email from within CP, you may google my name and see if you can use my linked-in account for this. Other than that... I'm open for suggestions.
Cheers, AT
Addy Tas 28-Dec-11 5:29am View
Hi, indeed it has been a little while but as you no doubt know, all slows down at the end of the year. I'd like to give you a hand but you gave me rather little to go on. I could think of a number of patterns(came to 6 alternatives) of what exactly you meant and could do. As i'm a bit to lazy to elaborate on all of them i'd like a bit more info :)
One thing i was wondering about is if you had written down a (normal) program flow. You no doubt have it in your head but in my experience writing it down really clarifies stuff.
Addy Tas 27-Dec-11 8:12am View
My 5.
Addy Tas 21-Dec-11 13:27pm View
Hi, I already figured out that it would come down to something like that. The nasty part of this is that I wanted to have a destructor that automatcally cleaned up the allocated mem when it goes out of scope or is deleted.
So once and a while i get so used to the comfort of C++ ( or better yet c#) that i can't figure out why we had to do everything manually in the (not so) distant past.

Thanks, AT
Addy Tas 21-Dec-11 9:29am View
maybe a stupid question but; why? If you need to store something as a service you can always use the HKLM. if you need the HKCU you'll kindly need to ask the user for a token so you can impersonate him (see ImpersonateLoggedOnUser) but when you are doing that you might as well have a process running in the users space that can access the HKCU....
Addy Tas 21-Dec-11 5:04am View
what; no upvote? You found it acceptable but iffy?
Addy Tas 21-Dec-11 2:26am View
It seems that your answer is the only answer and therefore must be the acceptable answer. Normally I don't add constructors to structs but in this case it seemed that as the struct is already used all over the place and the BSTR DeviceName is causing a mem leak I figured that init the value might already help, then on destruction free the mem. Guess I have to do this manually all over the place.

Anyway; thanks for the answer.Cheers, AT
Addy Tas 19-Dec-11 16:08pm View
I kind of wanted to leave you a little challenge and... Yes I'm kind of curious of what you really try to accomplish. I could also be a real nice guy and tell you a little about coding guidelines, why they exist and what you get from them... Maybe later :)
For now; a messagebox is incredibly easy in c#; all you have to do is: MessageBox.Show(theString).
Small note, if you can find me on linked-in you can send me a more direct mail, it would at least make it possible to be more elaborate on the why of things.

Cheers, AT
Addy Tas 19-Dec-11 2:41am View
You are correct though i pointed out many things that could be wrong, the following is wrong.

char test[20];
CString apple(test);

I updated my answer accordingly.
Cheers, AT
Addy Tas 18-Dec-11 15:00pm View

I could make a rather elaborate example here but... two min of googling (is that a verb) and i found something you which might be close to what you are trying to accomplish. see
for refrence
Addy Tas 18-Dec-11 14:44pm View

If you havn't figured it out by now this should really help you out; i've updated the answer again. Hope it'll make you happy.

Cheers, AT
Addy Tas 16-Dec-11 13:05pm View
Sorry, no facebook for me. You can find me on linked-in though
Addy Tas 16-Dec-11 6:43am View
Hi, I'll try to help you out but I'm currently a bit short in time so to get you a proper responce might take till Sunday...
I think that if you look at the examples in the MSDN you should be able to figure out how to get it done.
Cheers, AT
Addy Tas 15-Dec-11 14:28pm View
Really easy; the proper way to do it would be to make a seperate class with some static methods wrapping the imports but... I sugest that you just put this above the method that is going to use it, then you can call it normally.
You will need to add the using of System.Runtime.InteropServices
Cheers, AT
Addy Tas 15-Dec-11 12:38pm View
I did send you a mail a couple of days ago, did you get it or is there an spam filter working overtime?

Cheers, AT
Addy Tas 15-Dec-11 8:47am View

yes you may have my email address but... how to get it to you and not risk tons of spam... any suggestions?
If you can find me in any of the discussions you can send your email addess to me personally. That should work i guess.
Addy Tas 15-Dec-11 3:23am View

I've updated to add all the items in a CheckedListBox. From this contol you can use the CheckedItems to get a collection with the checked items.

Guess this should get you started :)
Don't forget to accept an answer if you think the answer is complete enough for the question.

Addy Tas 14-Dec-11 17:43pm View
Please cleanup the code dump and try to specify what does and what does not work
Cheers, AT
Addy Tas 14-Dec-11 1:29am View
Hi, i am well aware of that; i also like the explanations on:

Cheers, AT
Addy Tas 13-Dec-11 17:34pm View
My 5, the default example of OOP is shapes. Can't go wrong with that.
Cheers, AT
Addy Tas 12-Dec-11 17:11pm View
It would help if you'd specify what your expected output is, appart from differences in white spaces i don't see what you could skip and still have a sensible output. You can still discuss comments but i'm a bit inclined to say that if someone bothered to add a bit of comment, it might just be important enough to look at.
More info == better answer.
Addy Tas 11-Dec-11 16:48pm View
No idea why the hell i even sugested such a thing when i'm fully aware that you can remove the lines or even make them runaway from the ball. I guess it really is time to call it for today.
Sorry guys; sudden stroke of blondness.
Signing off for today, AT
Addy Tas 11-Dec-11 14:23pm View
Maybe a silly suggestion but what about overwriting the targeted line with the background?

Cheers, AT
Addy Tas 11-Dec-11 14:19pm View
You do know that sendmessage is a synchronous operation right? If you want to handle it async use the post message call. Next to that... Why P/Invoke?

Cheers, AT
Addy Tas 10-Dec-11 18:10pm View
Have you taken a look at Task<T>?
Addy Tas 10-Dec-11 10:20am View
Could these machines have different language settings?
Cheers, AT
Addy Tas 10-Dec-11 10:09am View
If this is the Siemens WinCC i'd suggest posting the question to them. I have played with it about five years ago(naturally not the 2008 version) but from the information you have provided here i don't think anyone can provide a substantial solution.
Cheers, AT
Addy Tas 10-Dec-11 10:02am View
Have you looked at XPath and XmlDocument?
Cheers, AT
Addy Tas 9-Dec-11 17:46pm View
Add another thread for reading and validating the read data, then if you got what you want set a event; the other side (writer) needs to wait for the event before it does something.

To avoid any other issues; please make your design to also wait for an exit event and use a timeout to verify the current state / resend the command.
Addy Tas 9-Dec-11 17:23pm View
I can only agree with your comment; data sources always need to have a McCloud attitude :). There shall be only one!

Having two ways of retrieving the same information can (and will) lead to ambiguity... ehhh errors in case you might misunderstand...
Addy Tas 9-Dec-11 17:17pm View
Hi, I have updated your solution a bit, where can i send the result to?
Send me a mail with the details and I'll zip it up for you.
It would be nice to compair your code and my changes and see if you know which way i'm pointing. Some small pieces of advice:
- get familiar with naming conventions, if everybody names his stuff the same you can easily read / understand the code.

- Install the VS extention manager tools:
1) spellchecker :)
2) Productivity power tools
3) Solution explorer tools
3) Code alignment (just easy to have :) )
Addy Tas 9-Dec-11 14:56pm View

I downloaded the App(s) which was, surprisingly enough, written in C#. Am I looking at the right thing here? all the items above were about VB.NET? Don't get me wrong, my experience in C# exceeds VB by a fair margin but... just a bit odd i guess.

Anyway; what should I be looking at?
btw; sorry about the late responce, got quite a nasty day today.
Addy Tas 9-Dec-11 14:44pm View
Next to the basics of inheritance; when building a ark of animals take a look at John's answer.
Be carefull that you only take one muskito though....

Cheers, AT
Addy Tas 9-Dec-11 14:41pm View
When Casting a non dog (e.g. Cat) to a dog you can expect a casting exception, using the as operator will make the result null if it's not a dog. However the as operator does not come cheap, as always safety comes at a price. Regular casting is really cheap but then again risking a exception might make you app unusable... I'd say only cast if the object really can't be anything but the expected type, if you happen to see an exception anyway something else is wrong in your app.

Cheers, AT
Addy Tas 9-Dec-11 3:44am View

I tested the changes I just made and this was working for me. as you might notice i put the data to the console instead of the txt box. You will need to do the invoking on that one yourself.

This should really make you happy. If this works for you; please upvote & accept the answer.

Cheers, AT
Addy Tas 8-Dec-11 18:17pm View
Is there a onload event or something like it being handled in the dlg? If so; when that does something nasty you may end up like this.
Addy Tas 8-Dec-11 16:43pm View

Added the example to the answer, I guess that'll cover it.

Cheers, AT
Addy Tas 7-Dec-11 8:59am View
mmm, as you might have noticed I had counted panels based on the id they were grouped by. Well it should be an easy change to do that now.
If you didn't get it done tomorrow I might take another look at it. Kind of busy tonigh :)
Addy Tas 7-Dec-11 6:23am View
Are you sure that the Selected index has changed? Are you using the code in the SelectedIndexChanged event handler?

Just tested the same and "it works on my PC" :)
Addy Tas 6-Dec-11 18:13pm View
5+ first think design, then think of fixing code
Addy Tas 6-Dec-11 9:28am View

Does the Testing form have a event that fires when / before it is shown? e.g. resize? If so; does it hang in that event?
Addy Tas 5-Dec-11 11:23am View
I was missing the #include "PMatrix.h" with the rest of the includes. Adding this will make sure that the declaration of the class is know before the definition can be compiled.

Cheers, AT
Addy Tas 5-Dec-11 11:15am View
You do not call the base when you don't receive a WM_WTSESSION_CHANGE. You will need to call it for anything that you don't handle.
Addy Tas 5-Dec-11 6:28am View

Did you make sure that you only omitted calling the base when receiving a WTS_SESSION_LOCK or WTS_SESSION_UNLOCK?

protected override void WndProc(ref Message m) {

bool foundLock = false; if (m.Msg == WM_WTSSESSION_CHANGE)

{ int value = m.WParam.ToInt32();

if (value == WTS_SESSION_LOCK) {

foundLock = true;

OnMachineLocked(EventArgs.Empty); }

else if (value == WTS_SESSION_UNLOCK) {

foundLock = true;

OnMachineUnlocked(EventArgs.Empty); }

} if(!foundLock) base.WndProc(ref m); }
Addy Tas 4-Dec-11 17:30pm View
Have you checked to see if your outup is at the correct / mentioned directory? Did you add in all the dots in the path or is this copied?

Cheers, AT
Addy Tas 4-Dec-11 17:27pm View
Tricky stuff, i guess that if you are thinking about using the magic dynamic keyword; you should reconsidder your design. If you still end up at the same conclusion, talk to some one else... If you still think you need it, well ok as long as you keep it all in the same assembly. There is no way to track compatibility if you cross the assembly boundry.

Cheers, AT
Addy Tas 3-Dec-11 17:00pm View
5+; clear and safe explanation
Addy Tas 3-Dec-11 16:58pm View
5+; and yes, TryParse is a lot safer.
Addy Tas 1-Dec-11 18:57pm View
Rather complete, my 5
Addy Tas 30-Nov-11 16:04pm View
Not much to go on but if you suspect a failing app, have you tried the application dependency walker (depends.exe) to see if something is just not in place?

Regards, AT
Addy Tas 30-Nov-11 15:53pm View
According to the documentation you should call base.WinProc(ref m) only if you do not handle the message. would it not work if you'd just ommit calling the base in the two cases you'd like not to happen?
Addy Tas 30-Nov-11 9:30am View
Short but complete answer. All you need to know is in there it seems.
Addy Tas 29-Nov-11 18:10pm View
I think I do understand what you want; all that you want is that the root of the result of "view files" is the managers own root, not the All data folder.
As i know little of ASP, I hope that my small clarification may help someone else help you.
Addy Tas 29-Nov-11 13:22pm View
You posted a serious amount of code, can't you narrow it down a bit? What exactly is happening?
Addy Tas 28-Nov-11 18:08pm View
Could you rephrase the question? Also make clear what exectly is not working. Does it not display correctly or do you get an exception of any kind?

Cheers, AT
Addy Tas 27-Nov-11 11:33am View
I've not taken a look at it in detail but i think that what you are looking for can be found under the term "MySQL Triggers"

A trigger is a named database object that is associated with a table, and that activates when a particular event occurs for the table. Some uses for triggers are to perform checks of values to be inserted into a table or to perform calculations on values involved in an update.
A trigger is defined to activate when an INSERT, DELETE, or UPDATE statement executes for the associated table. A trigger can be set to activate either before or after the triggering statement. For example, you can have a trigger activate before each row that is inserted into a table or after each row that is updated

And yes this beats polling any time, depending on the system your efficiency may be a lot more than 10x.


Addy Tas 27-Nov-11 11:12am View
From what i see all i can say is that it does not seem like you are using classes to organize your code and/or group intermediate results. But hey; you give little to go by.
Addy Tas 27-Nov-11 5:28am View
Is the exception thrown on the line:
bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;

If so the row does now have the checkbox control or the control does not have the name chkSelect.
Addy Tas 27-Nov-11 4:49am View
Damn, i thought that that part was also included in the free version. Sorry for wasting your time on that one.
Addy Tas 26-Nov-11 18:39pm View
Do you have a way of knowing if someone may have changed the contense of the db? If there is a service managing it, it may give you an event when touched. That would prevent even more nop's
Addy Tas 26-Nov-11 18:32pm View
If i'm reading it correctly you want to transform russian in english chars to russian chars to convert them back to english chars. Am i correct here? If so why don't you eliminate two transformations and be done with it?
Addy Tas 24-Nov-11 14:40pm View
Why would you do that? If you own the PC just take a bootable CD and take care of business, if you don't own it; don't touch it. Please make the world a better place.
Addy Tas 24-Nov-11 14:27pm View
Hi, looking at the code i was a bit suprised to see port 0 in the IPEndPoint as this means any available port. Make sure the data send from the client is send to a port on which the server is listening and visa versa.

Hope this helps, if not i'll take a closer look later.
Addy Tas 24-Nov-11 12:42pm View
With the abundance of missing information i can only guess that you are missing a ref to ws2_32.lib.
Addy Tas 22-Nov-11 18:02pm View
I thought this to be really interesting; especially as i'm builing a HTPC. As far as i can tell with the reading i've done so far the answer is: you can't... Or rather not directly. What you are looking for is getting access to the HDMI CEC bus. As far as i could tell the PC HDMI interface does not support direct access to the bus (maybe there are linux drivers that can). There are devices or DIY schemetics that split the HDMI to USB. Using the USB you can send or receive the CEC commands.

I hope someone has a way to directly access the bus from the PC's HDMI.

Regards Addy
Addy Tas 22-Nov-11 5:46am View
Have you looked into sending keyboard events with a MapVirtualKey(...)?
Addy Tas 21-Nov-11 2:20am View
the WinCE doesn't throw an exception; it just returns NULL on failure.
see: for more info.
Addy Tas 20-Nov-11 17:15pm View
Hi, what error code do you get from GetLastError when CreateFile... failed? The error code might lead to the real issue here.