15,744,665 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Javascript questions
View C++ questions
View Python questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by wvd_vegt (Top 9 by date)
wvd_vegt
4-Mar-13 3:47am
View
Reason for my vote of 1 \n Why advertise what seems your own (commercial) product here on codeproject?
wvd_vegt
22-Nov-12 9:02am
View
Reason for my vote of 4
Simple but not enough to debug all services. If a service runs under for instance a service account, temporary directories are located elsewhere. Same for a current (or other) directory, they might not be writable (which can cause nasty problems with features logging).
wvd_vegt
25-Mar-12 14:23pm
View
Reason for my vote of 1
Just trying comport numbers is not the correct way. The SerialPort class has an enum containing the available ports. Furthermore may ports above 9 need a special name prefix of \\?\.
Better is to retrieve the friendly device names and make a correct choice rigth away (especially for usb serial ports that tend to switch places the friendly name is a good choice most of the time).
wvd_vegt
8-Feb-12 6:04am
View
Deleted
Hi
You can (early in your program) implement a ConsoleTraceListener so you can divert the Console output to your own routines (like a winform+textbox). The same is available for Debug.WriteLine if i'm correct. In such handler you could buffer the messages until a form particular winform is shown.
As for the Console API can be found at http://msdn.microsoft.com/en-us/library/ms682087(VS.85).aspx. In a ConsoleTraceListener you should use methods like WriteConsole to really access the Console. The Api also allows for coloring text ect. Removing the close button is very tricky
My console code is around 56kb including pinvoke signatures so yes the api is complex.
Some handy snippets:
1) Find the console window:
while (fHandle == IntPtr.Zero)
{
if (fHandle == IntPtr.Zero)
{
//win32 aka winnt4/w2k/winxp/vista/win7
fHandle = FindWindow("ConsoleWindowClass", Caption);
}
if (fHandle == IntPtr.Zero)
{
//win98 window class
//win98 is also much slower
fHandle = FindWindow("tty", Caption);
}
//and shows CONSOLE as caption first.
if (fHandle == IntPtr.Zero)
{
fHandle = FindWindow("tty", "CONSOLE"); //win98 window class
}
};
2) Remove the Close button:
ShowWindow(fHandle, (Int32)SW.Hide); //winnt4
RemoveMenu(GetSystemMenu(fHandle, false),
(uint)SC.CLOSE,
(uint)MF.BYCOMMAND);
ShowWindow(fHandle, (Int32)SW.Show); //winnt4
wvd_vegt
8-Feb-12 4:20am
View
Deleted
Hi
You're clearly doing something wrong (like using Console.Writeline). I have since ages a console window under a menuitem and it works like charm if you use the win32 api to write and take precautions on the close box & system menu items + ctrl-c/break handling.
wvd_vegt
26-Jan-12 7:39am
View
Deleted
Hi
If you use this do not forget to remove the close button/menu option from the console window and handle ctrl-break/ctrl-c inside your app. Closing the console will kill the WinForms app hard.
Full code to use it safely is (unfortunatly) much more complex than this sample that only shows the console window!
wvd_vegt
wvd_vegt
19-Jul-11 5:01am
View
Deleted
The reason is that years agoo in Borland Delphi I created a totally virtual dataset that added things like columns, recordcount and data the moment it was requested by the code using the dataset.
Therefore when the original data changed so did it in the dataset. I tried this in DotNet but it proved to be very hard.
This code however is already very usefull to me (for some purposes, like generating a report a copy is perfectly fine).
wvd_vegt
19-Jul-11 4:38am
View
Deleted
Reason for my vote of 5
Very usefull (and compact) code.
A pity it copies data into the dataset (so it can only be used for relativly small amounts of data).
wvd_vegt
19-Jul-11 4:37am
View
Deleted
Very usefull (and compact) code.
A pity it copies data into the dataset (so it can only be used for relativly small amounts of data).
Show More