Click here to Skip to main content

Comments by John Simmons / outlaw programmer (Top 200 by date)

   
Not in this case, no.
 
   
I suppose that kinda makes sense...
I took out the code I thought might be the culprit, and no change...
   
I also tried it, and it almost matches. I have an intranet site up, and the innermost child window in the client area (it's a Internet Explorer_Server class) isn't being enumerated, but I think getting the parent TabWindowClass window will be sufficient.
   
I tried putting a Thread.Sleep(5000) after the process was started and went into InputIdle, and BEFORE calling EnumChildWindows. It didn't change the behavior.
   
EnumChildWindows is *supposed* to enumerate all child windows and their children - if you recurse, you'll get all the windows more than once. My problem is that it's not even getting all of the main IE window's child windows. I don't know if this has anything to do with it, but it only found child windows that don't have their own child windows. These child windows are also the first two I see with Spy++.
 
If you open IE and then inspect the window with Spy++, you'll see what I mean.
   
If you're not going to answer the question, STFU.
   
Nope, spent the last couple of days putting together screen shot code. Gonna try it on Monday. :/
   
I can't install any new software (I'm on a DoD system), so even if it worked, I can't use it.
   
I'm on Win7 running IE9 on a DoD system. I can't upgrade, and my end user(s) are in the same boat.
 

 
It's starting to look like I have to take screen shots and compare them for differences... Not happy about that...
 

Have I mentioned yet that I hate flash?
   
Fiddler doesn't show *any* traffic once I get to the site. I hate flash...
 
I just checked DevTools and all it shows on the page is a clsid...
   
0) I have a project originally started in VS2012
 
1) I added a User Control to the app project
 
2) I compiled the solution
 
3) I added the new user control to the mainwindow xaml
 
4) I added the namespace definition ( xmlns:local="clr-namespace:myproject" )
 
5) I get the "error" stating the name can't be found in the namespace
 
6) App compiles and runs despite that "error" (WTF #1)
 
7) I changed the namespace declaration to include the assembly name
 
8) The "name doesn't exist" error went away, only to be replaced by "the tag "controlname" doesn't exist in the XML namespace" (WTF #2)
 
9) The app will now not compile.
 
10) I'm pissed off.
 
   
WTF are you talking about? Why would you think even for a second that I didn't "make a selection"? Intellisense sees it - I select it - code doesn't f*ckin compile (or I get an error and it compiles any way). Where's the logic in that?
   
No, I don't get it - not at all. If intellisense can find it when I actually add it to the XAML, why doesn't it compile? We're talking about controls here that are nothing more than the template code provided by VS, and I'm not getting errors regarding those controls. Further, they are in the same assembly AND namespace as the main window whch is actually hosting the control. The entire soution is essentially a flat hierarchy with no additional projects or folders (yet).
 
I had to remove the xaml that uses the controls so I could code other parts of the app.
   
Well, that solved the initial problem, but now it won't compile at all.
 
The tag 'CtrlTabGallery' does not exist in XML namespace 'clr-namespace:ContentManager;assembly=ContentManager'.
 
I hate WPF...
   
If only it were that simple - that's the first thing I tried. I fixed it though, and posted my solution.
   
Reason for my vote of 1 \n Not an article.
   
You replied to a four-year old comment. I no longer really care.
   
No, I simply want to retrieve the data in the selected table.
   
I have no idea what WebAPI or ServiceStack is or why I should consider either. I'm REAL new to MVC.
   
Nop.web has to be calling nop admin somehow. I just want to make my app the startup app and call nop.web from it via a menu item click (or something similar).
   
It's not on a docked panel. Setting the X/Y properties on the transform in XML puts the control in the desired location, so animating those properties should work fine.
   
I am of the lightly considered opinion that the 3D stuff in WPF is buggy as hell. I was showing a coworker some of the weirdness associated with this effort. One of the weird things was that if I specified a transparent background for the text, the text would simply disappear in the designer. That was before I enclosed the textbox in its own border. So I had alreadty commented out the border, and changed the background to transparent, and the text angle became "correct". On the off chance this would generate a proper image, I ran the code, and waddayaknow? It came out the way the designer was showing it. I closed the ticket and told the customer that's as good as it gets. :)
   
I updated the code in the origianl question to give you an idea of what I'm after (you can get the specified font (Roboto Thin) from DaFont.com, but that shouldn't really matter.
   
I want the angle to be such that the numbers are at less of an angle. Here's a new wrinkle. After posting the original question, I tried putting the textblock into another border so that the 3d stuff was being applied to the border instead of the text in it. The image in the designer changed, but the rendered image did not.
 
I'm afraid I don't know what the "look-at target" is or where to set it, but my next stop is google (again). When I change the position of the camera, it merely moves closer/further, or moves the image within the bounding container.
   
We create what we call middleware that performs a task. In this case, the task is to get the current time, and position it so that it looks like the output of a flat time display being viewed at an angle.
   
Go for it.
   
I'm back at this again, and I still can't figure out the problem. You suggested showing some code, but that's A LOT of code (at least 525 lines of C#, and then there's the associated xaml).
   
Reason for my vote of 5
Because I'm awesome.
   
The "condition" is regarded as the entire phrase, but nice try. :)
   
I'm not sure I can provide anything meaningful. I was more hoping for someone to ask me questions that I could research and answer that might lead to a solution.
   
Check my updated answer.
   
It's probably best to start from scratch with a new WinForms app, and move the code from the console app to the WinForms app by hand.
   
I've NEVER heard of anyone doing that. I think you're worrying about a non-issue.
 
If you want another way to do it, you're free to use google...
   
If you can't analyze existing code, your career as a programmer will be quite brief. That goes for your other question asking us to analyze code for you.
   
In VS 1.51, an int was 16-bits. In a later version (I don't know which version this happened), it was made equivalent to an Int32 (but you could still use int as your type definition). At some point, int will be an Int64, probably when/if we ever see 128-bit operating systems.
   
You add it in the project (in the IDE), and the property setting automatically extracts it when the app is executed.
   
Why not, that's EXACTLY what Session is for - retaining data between page refreshes. You're wasting time fighting accepted practice. Use Session, and get on with your tasking.
   
You have to create new directories one at a time. There's no magic solution for you. I know this might traumatize you, but you're going to have to actually have to write code.
   
DAMMIT! That was a secret, locked away in the vast hidden information vaults at google!
   
VB syntax is (generally) case insensitive, but we're not talking about code, we're talking about the name of an index key ("firstName"). Those are always case-sensitive.
   
Being clearer wasn't the goal. Being FASTER was the goal. Besides, if you used enums to represent the numeric values, wouldn't it still be as clear?
   
But it will still be faster than using reflection, and it won't be tied to the database. You could also setup an in-memory map that allows you to index into an array to get the delegate method name.
   
Deleted
But it will still be faster than using reflection, and it won't be tied to the database. You could also setup an in-memory map that allows you to index into an array to get the delegate method name.
   
Your setvalue method prototype doesn't have an argument defined for it.
   
Why aren't you using the stream classes?
   
We don't do people's homework for them because they won't learn anything if we do. If I'm going to be competing against these people for employment, I at least want them to know what they're doing when they accept the position for a fraction of a fraction of a fraction of my salary requirements.
   
So which item is null? da or comboBox1?
   
Impractical is in the eye of the beholder. The minimal sample matches the minimal question. :)
   
I'm a little dyslexic today. :)
   
Google is your friend. I don't post code that I can't presonally test.
   
What kind of application? Is the server on the LAN?
   
We need more info than what you've initially provided.
   
5 - proposed as answer
   
It's been seven years since I did any unmanaged code. Google is your friend.
   
Where EXACTLY are you seeing this exception? We're not inclined to wade through code trying to find the problem on our own. Further, the HTML portion appears to have absolutely NO BEARING on the question.
   
Why would you think it would be any different than what you did in VC6?
   
5 - proposed as answer
   
It doesn't matter - you cannot operate the control menu buttons inside the designer. You MUST compile the app and run it to see what's going to happen. If you know for a fact that the app is going to be used only on one computer, you can set the size of the form accordingly, but that's bad practice, even on a limited use application.
   
Seriously? You couldn't figure that out on your own? Answer updated.
   
Nope. You're pretty much screwed.
   
Windows probably still thinks the file handle is open. Try rebooting your system and run your program again.
   
Ummmm, what? What does your app do?
   
WHAT is the exact error, and WHERE is it happening.
Show us the code for the object you're trying to serialize to/from.
   
Well, you add it to your project.
   
That's generally frowned upon because the data object shouldn't care about the control that presents it. However, if you insist on doing this (and you really should avoid it), you can just create a property in the class of the appropriate type, and set that property to the instance of the control in question.
   
I've already tried that - still the same error message.
   
I don't understand why it doesn't "just work".
   
Didn't know I had to There's a crap load of CAs on our machines. Crapload = 89.
   
The web service is on a server, the app is on my local box, on the same domain.
   
I'm not "back", I'm just asking a question at the best place I know of to ask a question.
 
To answer your question, no, there's no reason I chose a non-wcf solution, and I was actually contemplating trying it just to see if it would work any better. What I don't understand is why it lets me see the web methods (meaning it found the service I was after), yet can't create a SSL channel.
   
Deleted
WHERE do you see a nested if statement? Use "goto"? That's insane.
   
AND it's a repost. Deleted.
   
Holy crap! You have a WPF component that has more than 200 MEGABYTES of XAML?
   
But he wants to prompt the user to select an option (according to his question).
   
MDI is perfectly viable. Just because Microsoft isn't behind it anymore doesn't mean squat. Look at all the other stuff they've abandoned - Silverlight - WinForms - C++ - unmanaged development...
   
Then your app needs to be refactored. Do you even know how MDI is supposed to work?
   
Check my answer again.
   
I think this is a job for Liquid Nitrogen (or CListCtrl).
   
5 - Proposed as answer
   
These kinds of questions make my skin crawl.
   
This is a duplicate of a question asked earlier today by someone else (or by you with a different user ID). Why don't you monitor that question instead?
   
Deleted
This is NOT an alternative to the originally posted tip.
   
When you get it to the point that if you flip it the bird, it automatically causes IE to block the current url, call me.
   
Do not post your email address - when someone responsds to this question, you'll be notified by CodeProject.
   
Only YOU can make taht decision. What *we* think of a given Java IDE won't really be applicable.
   
Deleted
In what plane of existance does your comment have anything at all to do with the original tip/trick?
   
You STILL have to cast it to the correct type before you can use it.
   
That was my suggestion - draw to a bitmap and display the bitmap in the PictureBox. I also suggest that you refrain from voting 1 on people that are helping you. It doesn't promoite the desire to continue helping.
   
I've started reporting you for abuse.
   
Dude, stop answering questions that are more than a few days old.
   
You do realize that this question is almost two years old, right?
 
Pay attention to what you're doing.
   
How is that even remotely useful? What if you the resulting date was the 19th? How do you determine what is a "work day"?
   
Your question makes no sense at all.
   
Do ou mean that you want this control do perform this task while you're in the designer?
   
Do you mean parsing the string *in* a sql server stored proc?
   
The various .Net classes don't do ANYTHING to improve the database itself. If you don't have the skills necessary to make the database perform at an acceptable level, hire a qualified DBA. I used to work in an Oracle database that contained several hundred tables with several million records, and our queries for ANYTHING took less than 3 seconds to perform. We had an Oracle DBA on staff.
   
Deleted
Simple solution - ignore the warning.
   
You want to capture the Logon/Logoff WMI Win32_LogonSession events.
   
The method is recursive and accepts any control. When it encounters a container control (like a GroupBox, or a Panel), the method calls itself and the child controls within the container control are enumerated. This allows you to enumerate ALL controls on the form with a single method. Google "recursion" for more complete descriptions of the paradigm). By the way, if I provided the correct answer, make sure you "accept" the solution (and you can accept more than one if it's appropriate).
   
Yeah, but we're *paid* for our ideas.
   
For the last time - if the client does not have cookies enabled, there is NOTHING you can do about it.
   
Nope. I'm what the Department of Homeland Security refers to as a "lone wolf". :)
   
You apparently have no idea how software installers work. I recommend that you do some research.
   
Buh-bye retard.
   
But you can't do that *UNTIL* you're logged on.
   
It's now obvious that you know the url for bing. So go use it.
   
The clients don't have to poll constantly (every N milliseconds), and they would only pull down data that's been updated, and maybe even only data for other clients that are "visible" to them (or within a pre-defined visibility/audible interaction zone).
   
I already made a suggestion in the first version of this question that you asked. If you can't take EVERYTHING you've been told to date and come up with a workable design, maybe you shoudl consider hiring someone to write the code for you.
   
So open it and close it. What's so hard about that?
 
using (StreamWriter writer = new StreamWriter(filename))
{
// write your data
}
 
This will open the file, write the data, and close it for you.
   
You REALLY need to take a class and LEARN about what you're trying to do.
   
I was just bein' a smart-ass.
   
If you rectified it, and it's not running, then you didn't rectify it.
   
Clearly, you haven't sufficiently described your problem in such a way that enables us to give you anything resembling an answer.
   
What do you mean by "block the drive"? Do you want to prevent your app from reading from it, writing to it, or what?
   
A hashed password cannot be un-hashed, so password recovery becomes problematic, forcing the user to use a new password instead of using his old (forgotten) one.
   
If that's the case, see if the column chart has a property for setting the bar colors based on whether they're positive or negative. If you can;'t do that, then see if you can set individual bar colors in a given series (but I doubt you can). Failing all of that, create separate series that contains the negative values.
   
Are you just bragging, or is something wrong?
   
Nothing - obviously...
   
If it "isn't that hard", why did you feel compelled to ask how to do it? For what it's worth, you don't have to accept my advice. I've only been doing this stuff for 30 years, so it's entirely possible that I'm just blowin' smoke up your ass.
   
He completely changed his original question.
   
What EXACTLY do you expect to see, and what browser are you seeing the problem with?
   
What version control software are you using?
   
Your only recourse is with the Windows Task Scheduler. Google is your friend, but be aware that we tried this approach at work (running a batch file with the Task Scheduler), and it was WAY too problematic. If you want to fight that fight, be my guest.
   
He probably only has three days to finish it (that's an average time span based on years of handling questions like this).
   
Deleted
No, I wasn't inspecting the file first. I think this is the first time I've ever used FileInfo this way (usually, I'm scanning a folder for files and if the FileInfo array isn't empty, then all of the files exist, so there's no need. Doesn't the SqlConnection constructor throw an exception if it doesn't get created (I don't recall). In any case, the tip is still valid.
   
All questions are "active" unless the've been deleted. It's up to you to pay attention.
   
The code you've posted makes no sense at all.
   
That's what I did in CamoPicker (custom control inherited from Control).
   
Whenever I use a background worker, that's the way I do it. It's standard C# (nothing fancy or obscure). I don't use the telerik converter, but if it can't handle standard .Net constructs, many everyone else should avoid it, too.
   
I would have just given him a link to the search results page and left him to do with it as he pleases. But then, I'm more of an anarchist than Griff. :)
   
Ohhhh, the most recent comment in that article really pissed me off...
   
Didn't you read my answer to to you?
   
Any library you use is going to be different from every other one. Pick a library, and start using it.
   
He wants an alternative to the original solution, so in other words, he wants a minimum of two solutions from each person that responds.
   
Show us the code and precisely what's wrong.
   
If he doesn't pose a question by lunch time, I'm gonna delete this "question".
   
Be a programmer and learn what you need to accomplish the specified task. I've been programming for over 30 years, and I have to learn something new pretty much every day. WPF has a steep learning curve if you're used to WinForms, but it's certainly not insurmountable.
   
A rrrrrrrrrrrrrrrrubber biscuit?
   
Deleted because it's a) a repost, and b) the original question has at least one answer.
   
Deleted
Reason for my vote of 1
This is not an alternative to the original tip.
   
It's STILL a repost. Go back to your FIRST question, and modify it.
   
Deleted because a) it's a repost, b) you pasted WAY too much code into the question, and c) the code you posted isn't properly formatted.
   
You're a programmer, do it yourself. I pointed you in the right direction for god's sake.
   
You can't build your own notebook, that I know of. My suggestion was just regarding the processing capabilities of the computer - everyone knows they need the attaching and rotating bits. The import performance stuff are the cpu, memory, and video card.
   
We don't know what his ultimate goal is. I'm assuming it's a math thing. If it turns out to be a string thing, he can still use Math.Round and use string.Format to display it. In other words, po-tay-toe, po-tah-toe, and all that.
   
I think using Math.Round is probably much more efficient than performing string manipulation.
   
We want to help, but you've provided nothing to help us help you. If you know you're getting an index out of range error, then you should be able to determine how to fix it. It's probably caused by your "horse being at the edge of the board,a dn when you try to index beyond the edge, it;'s throwing the exception. Work the problem.
   
No. If you can't debug a simple application, how do you expect to succeed as a programmer?
   
The element names are case-sensitive. That's probably why it's not working for you.
   
You asked for possible ways to do what you want, and have been provided with two possible ways. And THEN, you down-voted both of the answers. I'm sure there are a couple of other ways youcan accomplish what you want, but the method I described is the way *I* would do it. I'm certainly not the end-all/be-all of programming talent, but I *have* been programming for over 30 years, and based on that experience, I recommended the best course of action as I see it. That's all I have for you.
   
We don't care how old people are. Everyone that posts a question is considered a programmer. Period. We laugh at everybody's code - even our own.
   
You gotta choose your battles. :)
   
Why is it cruel? "Cruel" would be telling the guy he's a dipshit...
   
so, which variable is null? FullName or File?
   
I was just trying to help him get as much benefit from using google as possible.
   
Your ADD (Attention Deficit Disorder) affliction is of no concern to us.
   
I think excpetions should be reserved for conditions that reflect errant coding, not user input.
   
I think a new college semester has just started. This is the 2nd or 3rd request for this in as many weeks
   
Why are you splitting on "|" when the original string doesn't contain that character? :)
   
Ummmmm.... what?
   
Deleted
Posting a vb.net version of the same code is NOT an alternative to the code in the original tip.
   
We can't possibly help you without seeing the code in question.
   
I'm not real fond of people editing my stuff. Try to resist the urge in the future.
   
This is not a permission or privilege issue. He obviously has some bizarre reason for writing this kind of code. Since he's not sharing it with us, I don't see how you can suggest this.
   
He wanted a solution in C#. I'm assuming his query is properly formed and that he's done everything else he needs to do to make it work. I don't have the time to speculate as to whether he should do it this way or not, and I certainly wouldn't do it this way myself. That's no reason to vote my answer down.
   
What you're seeing is the article submission wizard. At the bottom of each page, there's a button that allows you to go to the next page in the process.
 
You're right, you may not have editing privileges, but if you do (and I thought everyone was allowed to edit their own articles), my answer is the right answer.
   
I've posted 50+ articles here. I know what I'm talking about. In point of fact, I just went and edited the article, and changed it to be PRECISELY what you said it should be, and that was by clicking on the icon I told you to click. I suggest you change your 1-vote to a five, and mark this solution as accepted. It's the only right thing to do.
   
Deleted
You're going to have to tell us which line is throwing the exception.
   
I would think that if this were the case, he'd get a completely different exception.
   
You must have cognitive issues - you selected C++ for your tag when it's CLEAR that you want C# info. Pay attention to what you're doing.
   
I fixed your tag (was "C++").
   
If you're not a programmer, why are you working on a programming homework assignment? Beyond that, a lot of people here (that think they're programmers, or are soon going to be) are not in fact programmers, or will make even mediocre ones when it comes down to getting that first programming job.
   
you didn't reply to the OP - you submitted a comment to me.
   
Your comments aren't in English, so we don't know what the hell you're doing.
   
Your question is puzzling. Apps don't "provide" security - they "enforce" it. Are we talking about a desktop app, a windows service, a web app?
   
We need to see how you're configuring the Process object to run Debug.exe.
   
No, he wants the apps controls to change size/position according to the size of the form.
   
DO NOT REPOST
   
I think this guy would. Oh, wait - you said *right* mind... :)
   
I think he means in intellisense.
   
WTF makes you think we want to wade through all that code?
   
I don't think any free 3rd party .Net charting library is available without a watermark of some kind. You're either going to have to pay for one, or write your own. Believe me when I say it will be MUCH cheaper in the long run to just buy one.
   
It's right there in my answer. READ IT.
   
Was it really necessary to post ALL of that code? No, it certainly wasn't.
   
Why does it matter to you? He's asking how to do it, not if you approve.
   
Deleted
This is not an alternative to the toriginal tip. If you have a question use the message forum space at the bottom of the page, or use the "Have a Question or Comment button UNDER the original tip.
   
Deleted
No, only one instance of the application is running.
   
You said you had a program that worked, and that you wanted to make it faster. That's ALL you said. My solution is totally appropriate. If you want to make it faster, you have to write better code. I can't go into details because we don't have your code, and even if we did, it would probably take us longer thatn it's worth *to us* to make it faster. You could always try running it on a faster computer (I hear there's some available time on the most recent Cray box you could lease). Finally, your "=.=" symbol means nothing to me...
   
But you don't need to. I suspect this is a one-off method in a single form. there's no point in not making it form-specific, which means you can safely use the names of the combo boxes in a switch statement. Even if you couldn't, you could just as easily create a list external of the method in question, and search that list from the recursive method.
   
You still need to setup the appropriate shares.
   
At least I admitted it, and even if I don't know anything about jquery, it should at least start him thinking about stuff.
   
Geeze Mark, who pissed in your Wheaties today?
   
You can say that with a straight face with all of the links you posted for the OP? A concerted google search would have revealed ALL of those if he had just put in a little effort. Besides that, without performing at least a cursory code review and requirements evaluation, there's NO WAY we could give him a definitive best practice recommendation.
   
So, would YOU want to open your firewalls? Would the remote site? I doubt it. Named pipes are intended for intranets and shouldn't be used across the internet.
   
It might help if you show us the query you're using...
   
Deleted
I've worked in very few team environments, and I've written a great many apps on my own time at home using my own resources. My favorite project of all time is the one I did when I was just starting out, and earned me the user ID I use here. I wanted to change the colors used in the Turbo Pascal 2.0 IDE. Someone told me that it was impossible, so I went ahead and did it anyway, just to prove that it could be done. That was almost 30 years ago.
 
BTW, I've been using C# for more than four years. Before that was 16 years of C/C++, and before that was 6 years of Pascal and about 4 years of assorted other languages. As far as subject matter knowledge, I've done radar tracking, asset tracking, estate planning, charitable giving, troop readiness tracking, real-time image acquisition/transmission, embedded programming, real-time video encryption/streaming, telecommunicaions billing, ACH transaction management, and currently, financial management.
 
I've written commandline and UI apps for both DOS and Windows, TSR's (remeber those?), Windows services, web services, asp.net apps, legacy asp web sites, a couple of Silverlight modules, and a couple of WPF apps. I don't believe in specializing because each job has always required a different skill set, and usually meant I had to learn something I didn't already know. I guess I fall solidly into your "athlete" classification, but that only makes sense since I've been doing this for over 30 years (and no, I have no desire to be a manager - yet).
 
I'm completely self-taught (ragarding everything I've done since 1981), and my least favorite part of an interview involves test questions. I hate 'em. I long ago stopped trying to remember everything I ever did or saw. Google is my reference and I use it - a lot. My fading memory has forced me to become a copious commentor in my code.
   
Well, tell us what the solution was.
   
My point is that to make your code "flexibility", you suggest modifying the code, which could possibly introduce errors into code that used to work before being made more flexible to suit a new use case.
   
I formatted your code and fixed the html tags. Beyond that (and like the other two solutions), your code is only flexuible regarding the length of the input string itself, allowing for no other character to be inserted, nor the number of characters between insertions.
   
What happens when the string gets longer (unintended results) or shorter (throws an exception)? Your solution only covers the sample input, and does not consider all of the use cases.

Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid