16,016,527 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 C++ questions
View Javascript questions
View Visual Basic questions
View .NET 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 Alan N (Top 134 by date)
Alan N
31-May-23 10:56am
View
Really for something as simple as this! OK but if you don't bother to do any research yourself I may not reply again.
This statement executed within your custom DataGridView will give the form on which it is located.
Form containingForm = this.FindForm();
Alan N
30-Jun-22 10:25am
View
What is the string assigned to CompilerOptions that is causing the error?
Alan N
10-May-21 9:15am
View
To get any kind of answer you will have to provide code that makes sense. Just glancing at the current version of your question I wonder
1) What is the loop doing given that it does not use 'm' and we don't know what 's' contains.
2) Why when an exception occurs do you just try the same thing again.
3) Why dispose of the WebClient object when an async operation is still in progress.
4) Why is there no DownloadFileCompleted event handler
Alan N
19-Jan-21 18:30pm
View
What is the resource 'test'? I would expect it to be the contents of a zip file stored as byte[] in which case the correct way to get it back would be to cast 'resourcedata', e.g. byte[] zipcontent = resourcedata as byte[].
Your use of a BinaryFormatter to serialise the 'resourcedata' cannot be correct and will only transform it into something which is definitely not a zipfile.
Alan N
30-Oct-20 16:35pm
View
Shouldn't you reverse the order of steps 3 and 4 so that the saved bitmap is displayed by the PictureBox and the Photo Viewer?
Alan N
26-Apr-20 11:14am
View
What control are you using? The title says listview but the text mentions a listbox containing child controls. I'm confused - please give full type names.
Alan N
4-Jul-18 6:22am
View
Before any one can attempt to answer they will need to know what you mean by "when running through a task in other tool"
Alan N
18-Jan-18 15:17pm
View
Ignore my last comment. We must have been editing at about the same time.
Alan N
18-Jan-18 15:16pm
View
A ComboBox is a combination of a TextBox and a ListBox and that default menu comes from the win32 EditControl (TextBox) part. I've always thought it was a shame that Microsoft did not remove that menu from the .NET textbox and combobox as it looks really out of place and cannot be customised, except by replacement.
I see you are certain that you have assigned the menu correctly. Could you post the designer code where that is done?
Alan N
4-Sep-17 5:30am
View
The solution to this problem requires a knowledge of the type of the progressBar variable. I don't know what it is but I know it is not System.Windows.Forms.ProgressBar. Based on the error message I would guess that is it a 'Metro' ProgressBar. I have never used this but I would always start by reading the relevant documentation.
Alan N
11-Aug-17 8:46am
View
Why are you creating a new form? You need a reference to the existing FormVer.
Alan N
18-Jul-17 16:39pm
View
Are you a malware author by any chance?
It seems to me that you want to write a downloader which will modify the downloaded application in a random manner and then hide it somewhere on the poor unfortunate user's computer. Is your next question going to be, "How do I make the hidden application run automatically when the computer starts?"
Alan N
15-Jun-17 14:42pm
View
Is an exception thrown by CheckPendingiMacros(true)? The Microsoft code that calls the event handler delegate swallows exceptions and your own exception trapping WITHIN the event handler will reveal any problems.
Alan N
25-Apr-17 9:54am
View
Other have given you good ideas for sorting numeric strings.
Something that has not been mentioned is that BinaryWriter writes length prefixed strings to the file. Such files may not read properly with File.ReadAllLines and probably won't display correctly in Notepad. To create a pure text file you should use System.IO.StreamWriter.
Alan N
21-Aug-16 18:37pm
View
The effect may be something to do with double click detection which is enabled for Labels and disabled for Buttons.
Alan N
12-Jun-16 18:13pm
View
If would be great if there was a Sort method that allowed a list subrange to be specified. If such a method was to exist, it would be in the documentation for the generic list class. HINT - go and look.
Alan N
26-May-16 13:40pm
View
Have you read the documentation for Math.Sqrt? It may help you.
Alan N
25-May-16 14:20pm
View
"I don't want to handle an event for RowIndex = -1"
You have no choice in the matter as the CellValueChanged event is raised for a change in ANY cell, including the header cells. The code in the handler must be written to exclude the header cells. I've added an example.
Alan N
20-May-16 13:10pm
View
In the example posted the first character of the string literal is null. I copied and pasted into a hex editor to see it.
Alan N
12-May-16 10:31am
View
You probably need to rethink your stragegy here. The MouseLeave event is fired when the mouse cursor moves outside the bounds of the control. Therefore a check to determine if the cursor is still within the bounds can never succeed.
Alan N
26-Mar-16 6:19am
View
Just write your own operating system. Try it!
Alan N
4-Dec-15 13:04pm
View
What would you enter at a command prompt to execute your backup?
"C:\Users\Documents\Backup\*.*" will not copy files.
Alan N
4-Dec-15 11:26am
View
Are you able to post a concise code fragment which demonstrates the problem?
In a test with a listbox populated with 1 million integers I can set TopIndex to make the listbox scroll to any of those 1 million items. You say you are setting the TopIndex on the "scrolling" event. What do you mean by that?
Alan N
25-Nov-15 6:30am
View
That's ok. CreateNoWindow is commented out so a console window is shown while the iperf process is running. As StandardOutput is redirected the window remains empty. Refer to the example at the end of my answer and insert the code to read and display the standard output.
Alan N
25-Nov-15 5:28am
View
"/c Start iperf" were arguments to CMD.exe as I explained in my original answer. If the filename is "C:\Users\nirf\Downloads\iperf\iperf.exe" then the only arguments needed are those required by iperf, i.e. "-s -D". Try that and it should be good.
Alan N
24-Nov-15 10:28am
View
CMD.exe is the program that manages the prompt in a console window and allows a user to enter instructions such as dir to view the contents of a directory. It does not create a console window, the operating system does that when a console based program is started. CMD.exe is one such program and it is highly unlikely that iperf must be started by CMD.exe. You can try both "CMD /c iperf args" and "iperf args" in your code and decide for yourself.
I think the primary reason for the redirection failure in your code was the use of the start command which meant that the CMD.exe process referenced by the Process object was not the CMD.exe that was hosting iperf.
Alan N
21-Nov-15 10:30am
View
It often catches people out as Microsoft examples often use the console which doesn't care much about threads. The Process class, System.Timers.Timer and the EventLog also have SynchronizingObject and so it the first thing I look for when I see questions about them.
Alan N
27-Oct-15 6:44am
View
... and that implies that the SerialDataEventArgs class definition cannot be correct. Please review all of the code posted.
Alan N
27-Oct-15 6:15am
View
Is that code correct? The byte array 'data' read from the port is assigned to a string in SerialDataEventArgs.
Alan N
13-Sep-15 15:17pm
View
HINT: 1) In the question what does the ^ operator do? 2) In C++ what does the ^ operator do?
Alan N
31-Jul-15 7:24am
View
Don't forget that C# is a case sensitive language. Main() and main() are not the same.
Alan N
31-Jul-15 7:21am
View
It's good that you have the system working again but I hope that you can see that what you did should have been regarded as diagnosis of the problem and not the solution.
It's likely that the callee is making assumptions about the current directory. If the WorkingDirectory property of ProcessStartInfo is not set then the caller's current directory is used. I've always thought that this was stupid and a more sensible default would be the callee executable's directory.
Alan N
1-May-15 8:11am
View
Have you declared WorkFlowEngine.Interfaces.IActivity in more than one assembly? Although if you have, there should be a compiler warning on the line where the cast occurs.
Alan N
24-Apr-15 9:49am
View
My comment was just to make the point that the displayed and actual values can be different and settings DecimalPlaces to zero does not enforce any validation of the actual value. Visually it appears to restrict to integral values but that is just an illusion. For NumericUpDowns where integral values should be enforced I add a ValueChanged event handler and truncate the Value.
Alan N
24-Apr-15 8:34am
View
The DecimalPlaces property doesn't do quite what we expect. It only controls the display format. Try setting DecimalPlaces = 0 and Increment = 1 and then type 1.5 into the control and press enter. The display will show 2 but the Value is 1.5. The arrows now increment by 1 on the actual value, i.e. 2.5, 3.5, 4.5 and the display shows 3, 4, 5. I spent a long time trying to figure out why the decimal value 3 cast to an int was 2!
Alan N
2-Mar-15 6:22am
View
Well it is a strange interface. I can't help thinking that the freezing should have been implemented in the DataGridView class with the Row and Column.Frozen properties read only.
Alan N
28-Jan-15 8:06am
View
There's one fairly common situation not covered in your tests which may be the reason for the OP's question. When a throw and rethrow are within the same method the stack trace is always changed by the rethrow to indicate the line where the flow of execution left the method. In the example method a bare 'throw' and a qualified 'throw exc' behave identically and show an exception apparently thrown at location 2.
public void WTFMethod() {
try {
throw new Exception(); // location 1
} catch (Exception exc) {
Console.WriteLine(exc);
throw; // location 2
}
}
Alan N
12-Nov-14 6:30am
View
It should be straightforward to find out which object is null using the debugger. My suspicion is that it will be something in the SelectionChanged event handler. When all items are removed from the list box the SelectionChanged event will be raised to indicate that the selection has changed from something to nothing and listbox.SelectedItem will be null.
Alan N
4-Nov-14 7:41am
View
I bet that gives a compiler warning about "possible unintended reference comparison" and I'm sure you meant to cast SelectedItem to string. Literal string pooling by the compiler or string interning by the CLR will usually ensure that the references are equal but it isn't something that should be relied upon.
Alan N
29-Oct-14 8:43am
View
But have you understood that if your algorithm is designed to work with a single string then it's limit will be the maximum allowed size of a string. MSDN says this is approximately 1,000,0000,0000 characters.
Alan N
29-Oct-14 8:36am
View
The time taken is proportional to the number of characters. As each character must be read and compared, the only way to go faster is to divide the task between several threads. Of course this will only get a real speed increase if sufficient processor cores are available to run the threads.
Alan N
29-Oct-14 8:19am
View
In common with other respondents I can't understand your claim to be able to work with 10,000,000,000 character strings. Think about it, even if it were possible it would require a single memory allocation of at least twice that many bytes.
Alan N
28-Oct-14 10:55am
View
Well, that's going to be tricky! If you could explain what value you mean by 0xgh someone may be able to answer.
Alan N
21-Aug-14 9:10am
View
That's a shame. My rather ancient version of Word (2002) can be hosted by setting the parent and if there are multiple documents open then the MainWindowHandle refers to the one at the top of the Z-Order. Perhaps with yours the MainWindowHandle is not one of the document windows. It's difficult to come up with any intelligent guesses and I think you will have to investigate further using a handle spy tool such as Spy++. I have been using Winspector which works well if a little slowly.
Alan N
21-Aug-14 6:49am
View
I missed out a crucial detail, sorry. Insert a call to the Refresh() method to update the process properties each time around the loop.
while (IntPtr.Equals(proce.MainWindowHandle,IntPtr.Zero))
{
System.Threading.Thread.Sleep(100);
proce.Refresh();
}
Alan N
8-Aug-14 13:06pm
View
It's like getting water out of a stone! I suspect the dll has been added to the exe's resources but I don't think I'm ever going to find out.
Alan N
8-Aug-14 9:43am
View
If your program requires the dll to run then it MUST be deployed. Using ILMERGE is the only reasonable option to produce a single assembly.
Alan N
7-Aug-14 15:01pm
View
Not really, you just changed the word embed to include. Your responses to other questions suggest that you want to use the executable without the libraries that it requires. That doesn't make much sense! Please explain what you did to 'include' or 'embed' the WeifenLuo assembly.
The default settings for a project in Visual Studio would copy the assembly into the output directory where it should be. So what did you do?
Alan N
7-Aug-14 9:03am
View
Please edit the question to include what you mean by "embed".
Alan N
19-Jul-14 10:49am
View
Well I'd read the documentation for the UnicodeEncoding class.
Alan N
30-Jun-14 15:19pm
View
What is the purpose of the two lines
PictureBox1.ImageLocation = A
PictureBox1.Image = A
Alan N
24-Jun-14 11:42am
View
Oh good. If you have anymore questions then just post again.
Alan.
Alan N
24-Jun-14 11:41am
View
Sorry I don't understand.
You know how to get the output from ReturnFileName.exe into a variable. What do you want to do with the variable?
It may help if you give an example of the command line you would like to use.
Alan N
24-Jun-14 6:19am
View
What does happen? The command processor usually outputs an error message if it can't interpret a line in a batch file.
Why not start with something simple using a built in console command, e.g.
FOR /F "usebackq delims=" %%a IN (`Date /t`) DO SET DATEVAR3000=%%a
ECHO DATEVAR3000 is %DATEVAR3000%
That should echo today's date.
Once you that working correctly insert your own application and test again making note of any error messages.
Alan N
1-May-14 9:20am
View
Ah, so we agree. I knew we would eventually. I wonder if my answer fixed the OP's problem.
Who uses MDI anyway!
Cheers, Alan.
Alan N
29-Apr-14 12:18pm
View
From the indentation of these comments it looks as if I may have replied to myself. Take a look at what I said in response to your latest.
Alan N
29-Apr-14 11:23am
View
It's good to be challenged but I still disagree as I tested with correct code, although you did have me worried!
It's essential to assign the MdiParent property of formChild so that it becomes a proper mdi child form. Setting formMDI as the parent will try to put formChild into the control collection of formMDI rather than that of it's MdiClient container.
By the way, won't the line
Parent = formMDI
in the child form .ctor fail as formChild is TopLevel and therefore cannot be added to a control collection.
Alan N
29-Apr-14 9:34am
View
I tested before posting so I am going to disagree. The main form's control collection (MFCC) initially has one member, the fully docked MdiClient control which is the container for the mdi children. If more controls are added to the MFCC, then they must also be docked otherwise the MdiClient will continue to occupy all of the client area of the main form and maximised mdi children will be appear to be "too big".
Alan N
27-Apr-14 9:07am
View
I'm glad that helped. I figured this out a few years ago and can now understand what the Microsoft documentation means.
By the way keep the properties in the helper class public otherwise the names will not be recognised.
Alan N
24-Apr-13 14:08pm
View
I've added some more information to the answer.
Alan N
8-Apr-13 18:50pm
View
As no one else has asked I will. Why do you
1) Read the file into a memorystream 100 times and then do nothing with it
2) Copy the RichTextBox.Text to a variable 100 times
3) Load the RichTextBox directly from the file 100 times
Alan N
10-Mar-13 15:53pm
View
I can't agree with that at all and would say that independent confirmation of the caret position is very good evidence of correct operation. What you haven't given is your code for calculating the required caret position. You could avoid your own calculation and the use of SetCaretPos by using Select(charIndex, 0) to do the actual setting. I think Select(TextLength, 0) would position the caret at the end of the text.
It doesn't seem to make any sense to set a caret position in a hidden textbox which cannot have input focus. Like Piebald said, what is it is that you are trying to do?
Oh, yes and check the returns from all of the window API calls that you use as all the caret method return a boolean value for success/failure.
Alan N
10-Mar-13 15:52pm
View
Deleted
I can't agree with that at all and would say that independent confirmation of the caret position is very good evidence of correct operation. What you haven't given is your code for calculating the required caret position. You could avoid your own calculation and the use of SetCaretPos by using Select(charIndex, 0) to do the actual setting. I think Select(TextLength, 0) would position the caret at the end of the text.
It doesn't seem to make any sense to set a caret position in a hidden textbox which cannot have input focus. Like Piebald said, what is it is that you are trying to do?
Oh, yes and check the returns from all of the window API calls that you use as all the caret method return a boolean value for success/failure.
Alan N
7-Mar-13 7:31am
View
Thats much neater than my way.
Alan N
14-Feb-13 19:13pm
View
During which compilation does the error occur.
Is during compilation of the code shown in your question
OR
When that code executes the dynamic compilation CompileAssemblyFromSource?
Alan N
13-Feb-13 11:15am
View
My code didn't work, rats! Over here it does and I've just checked and can confirm that it a exact copy of my test code. Did you copy and paste it into a new solution or do a modified version?
The apparent event subscription in the original link is not required as the compiler does an implicit 'new' when assigning a method to a delegate type parameter.
SetConsoleCtrlHandler(Handler, true);
is equivalent to
SetConsoleCtrlHandler(new HandlerRoutine(Handler), true);
I'm on Windows XP and MSDN says nothing about problems in later versions.
Alan N
12-Feb-13 21:08pm
View
Would it be possible to rewrite the Job Manager as a GUI app. You would then have more control over it's shutdown.
Alan N
11-Feb-13 11:01am
View
Just thinking. Have you tried doing a synchronous read, just a few bytes, to find out if you can read from the device?
Alan N
10-Feb-13 8:35am
View
What I was trying to get you to say was something like
I am getting a System.OverflowException with the message "Value was either too large or too small for an Int32." on the line
int Endcount = Convert.ToInt32(TextBox2.Text);
That error happened at run time and OriginalGriff has explained why.
Now you have a compile time error as you have written something like
int Endcount = Convert.ToInt64(TextBox2.Text);
and the compiler knows that an Int64 will not fit into an int (Int32). The correct line would be
long Endcount = Convert.ToInt64(TextBox2.Text);
Always, always post your code along with the exact error message and the line where it occurs. Otherwise the people who want to help you are guessing.
Alan N
10-Feb-13 6:02am
View
When asking a question it is important that you include all relevant information.
In this case we need to know what exception you see and on which line on which it occurs.
Alan N
9-Feb-13 12:00pm
View
And the "specified module" is the assembly containing the entry point or a different one? If it's not the entry assembly is it present in the output directory.
Alan N
9-Feb-13 11:04am
View
Is "my form" located in the startup assembly, or somewhere else. I was hoping that you would post the exception text.
Alan N
9-Feb-13 10:33am
View
OK, but which file is not found!
Alan N
7-Feb-13 4:52am
View
In winforms the equivalent is ShowDialog(IWin32Window owner).
Alan N
5-Feb-13 6:04am
View
integer division!
Alan N
24-Jan-13 14:52pm
View
I'm not responsible for the downvote but on reading this answer I immediately thought "You must be joking" as you have suggested blocking the UI thread as a timing mechanism. Given your points count I would guess you know that's not a good idea.
Alan N
23-Jan-13 11:44am
View
That code copies creates a file called splashimage.jpg in the application's base directory. Is that where the file is supposed to be?
Alan N
14-Jan-13 9:10am
View
What is displayed where the status strip should be when the problem occurs?
Alan N
14-Jan-13 9:04am
View
Do you have an example of what you mean by "junk" and the input string that produced it. It would also be helpful to see the intermediate character array.
Alan N
2-Jan-13 12:25pm
View
First step is accepting that the error message is correct. Second is finding out what the actual value is by viewing it with the debugger. If you don't understand why the string has that value then ask by editing your questionto include the new information.
Alan N
2-Jan-13 12:23pm
View
Deleted
If the message is "input string was not in the correct format" you will need to know what the string actually is. By that I mean find out using the debugger and don't make assumptions.
Alan N
1-Jan-13 11:01am
View
It seems highly unlikely that the code presented would affect the ability to open a file. Why do you think it does and where is the code to open the file?
Alan N
31-Dec-12 10:48am
View
Good, now I understand what confused you. Although VS refers to the file within the resources, it actually only imports it's contents and you don't have to open and read the file.
Alan N
31-Dec-12 9:47am
View
You mentioned several options in your original post for accessing the resource. What is the actual code you are using to put the resource text into the RichTextBox?
Edit the original post to make this clear.
Alan N
31-Dec-12 9:21am
View
Difficult to say. I had a look in the source from your article but you don't include the .nfo file. For me that would be the start of any debugging effort. Are the file contents what it should be?
As a quick test I've changed the extension of a text file to .nfo, imported the file as a resource using the technique outlined in my answer and can subsequently read the text correctly via the resource accessor.
Alan N
31-Dec-12 8:23am
View
See update
Alan N
30-Dec-12 10:19am
View
There is a hard coded reference to textbox1 in the event handler method which will need modifying to use the specific control passed in via the sender parameter.
i.e. TextBox tb = (TextBox)sender;
and then errorProvider1.SetError(tb, ""); etc...
Alan N
10-Dec-12 9:01am
View
Sorry mate you're too late. It's already 1400 here! On a more serious note, why not test your code and see if it performs as expected.
Alan N
4-Dec-12 14:18pm
View
Why not start with the example of a simple triangle given in the reference for drawpoly. Once you have that working, modify the code so that it draws a hexagon. Then modify again to colour the hexagon.
It's important to go one step at a time when you are learning. That way you will know that any error is due to the last bit of code you changed.
Alan N
4-Dec-12 4:53am
View
When you get the NullReferenceException it means the object is not initialised. Don't go looking for other explanations! If you read the setting as soon as your app starts you will see that the value is null. It will be this way unless you have used the designer collection editor to add a few strings.
Alan N
2-Dec-12 6:29am
View
The export format of reg.exe and regedit.exe are the same but reg.exe has the advantage of having a comprehensive and fully documented command line.
Although I haven't tested RegSaveKeyEx I would expect the standard format to be the same too.
Any of these techniques could be coded in C#. What is the problem?
Alan N
2-Dec-12 6:29am
View
Deleted
The export format of reg.exe and regedit.exe are the same but reg.exe has the advantage of having a comprehensive and fully documented command line.
Although I haven't tested RegSaveKeyEx I would expect the standard format to be the same too.
Any of these techniques could be coded in C#. What is the problem?
Alan N
1-Dec-12 11:24am
View
When must this homework be submitted? Just asking as it will help us to prioritise this project and estimate how many people to assign.
Alan N
14-Nov-12 13:15pm
View
I'm not clear about what you want your program to do. My answer assumes that you have shown the main form and then you want to show another form as a modeless dialog. The user will be prevented from interacting with the main form until a button is clicked on the dialog. Is that what you want?
Alan N
13-Nov-12 7:20am
View
Are you trying to rearrange listbox items OR drag items out of the listbox and drop them on a different control.
Edit your question using the "Improve Question" button to clarify what you want to do.
Alan N
11-Nov-12 13:25pm
View
Read my answer. It does exactly what you want. If you don't understand how to apply the idea your problem post a comment under my answer.
Alan N
20-Sep-12 6:35am
View
Assign a new value would be the obvious answer. What problem do you have?
Alan N
17-Sep-12 12:20pm
View
The volume label is associated with a disk. Is there one in the drive?
Alan N
16-Aug-12 13:15pm
View
Is the form's AutoSize property intentionally set to true?
Alan N
10-Jul-12 6:11am
View
What you mean by "a notepad" is unclear.
Do you want to
1) copy data from the window of an instance of notepad.exe
or
2) read a text file
Alan N
10-Jul-12 6:03am
View
I don't know anything about DoScan, but clearly if the program will not execute from a command prompt then trying to do the same via Process.Start will be a waste of time.
Alan N
10-Jul-12 4:57am
View
Have you opened a command window manually and typed in the command line to verify that it is correct?
Alan N
29-Jun-12 5:23am
View
This still makes no sense at all. How did you manage to compile c# source code using a Basic compiler?
Alan N
24-Jun-12 13:16pm
View
I hope that you haven't been waiting 5 hours for an answer! I recommend browsing the online help for the DateTime structure. You'll find loads of good stuff like the Compare method, the operators >, >=, <, <=, ==, !=, + and -. I'm sure there must be something in that lot that would help you answer your original question.
Alan N
7-Jun-12 4:50am
View
No you know a lot more than this!
1) the signature of the method in C/C++ and example C/C++ code for calling the method
2) The DLLImport statement and C# code used to call the method
Alan N
7-Jun-12 4:38am
View
Have a think about the information someone would need from you before they could answer your question. At the moment I only see "I have this dll and it doesn't work", and that is not enough.
Alan N
22-May-12 12:42pm
View
Yes, it does by default, but if the SynchronizingObject property is set to a form reference then it will raise the Elapsed event on the form's thread.
Alan N
20-May-12 5:38am
View
So you haven't created a copy. Compare the original with the rewritten version and find out what you did wrong.
Alan N
30-Apr-12 4:25am
View
Did you check the FileName? The documentation for FileUpload.FileName says it just a filename and not the full path. It is highly likely that the GetCreationTime method does not find the file unless it has the full path.
Alan N
23-Apr-12 17:34pm
View
Try posting a complete sample with the code that you say 'dont work' and then someone will be able to tell you what you are doing wrong. It is almost certain that you have just made a simple mistake bacause the Remove and TrimEnd methods do work.
Alan N
1-Mar-12 8:42am
View
When a captured stream closes an event is raised with DataReceivedEventArgs.Data set to null. In your case the timer will not be needed if you know when both event handlers have received null data.
The examples on MSDN which treat a null string and an empty string in the same way have not helped and must have confused a great number of programmers, me included!
To clarify: an empty string is received when the process outputs a blank line and a null string is received when the stream closes and capture is complete.
Alan N
31-Jan-12 10:30am
View
I don't understand what you are trying to say and I would need to see how you are updating your text box before I could offer any further advice. If you are using the checked item collection bear in mind that the ItemCheck event fires before the check state of an item changes.
Alan N
31-Jan-12 9:57am
View
I've added a code fragment.
Alan N
30-Jan-12 16:16pm
View
A DateTime tick is 100 nanoseconds. So losing 7 zeros converts ticks to seconds.
Alan N
3-Dec-11 8:26am
View
I've fixed the code formatting and now you need to edit the question and tell us what "not working" means. What were the expected and actual outputs of the program?
Alan N
2-Oct-11 11:04am
View
The output order 10,15,23,8 must have been obtained by sorting strings instead of integers. If you had posted your code as requested by Bala I think you would have had an answer very quickly.
Alan N
3-Jul-11 20:52pm
View
Well as you haven't shown your code and I can't be sure that I'd imagine what you'd imagine but the most likely reason for six extra columns is that the AutoGenerateColumns property of the grid is set to true. Don't go looking for it in the VS designer properties window as it's one of the specials that doesn't show up there!
Alan.
Alan N
8-Jun-11 14:13pm
View
OK, so does Client implement a custom Equals method?
Alan N
25-May-11 12:25pm
View
I don't think anyone is going to able to answer this as you appear to have mixed up many concepts. Can I suggest you rewrite the question in relation to a specific problem. As a starter we'll need to know about "another program" and "this thread".
Alan N
24-May-11 10:42am
View
See updated answer
Alan N
20-May-11 5:30am
View
Can you be more specific about the file format? At the moment it's a guess but I assume you are referring to IBM Image Object Content Architecture (IOCA) and not the Citrix configuration file format
Alan N
30-Apr-11 18:16pm
View
Try searching for Arbitrary precision maths library. I've never used one so can't make a recommendation but this was one of the results http://www.fractal-landscapes.co.uk/bigint.html
Alan N
30-Apr-11 17:20pm
View
FYI, double has a precision of only 15-16 digits.
Alan N
3-Apr-11 11:43am
View
I give up. I see that you have just changed the original question completely!
Alan N
3-Apr-11 11:38am
View
OK that's better but still not good enough.
You want 10 non-space characters per line.
How do you decide what the actual length of the line will be?
In the example you have 12 characters per line including the spaces.
In the second line how did you choose which spaces to remove?
In the third line how did you decide where to add spaces?
Alan N
3-Apr-11 10:50am
View
Sorry that is not clearer. Your input was "hello How are you I am so happy" and in the output sometimes you keep the spaces between words and sometimes you remove them. Look at your second line "hello iamha". You have also converted to lower case which you never mentioned before.
If you are able to state your requirements PRECISELY then designing the programme will be easy.
Alan N
3-Apr-11 10:31am
View
This is question is impossible to answer as no one will be able to tell what your requirements are. From the example I would guess that you want to randomly insert or delete spaces and output between 7 and 12 characters per line!
Alan N
6-Mar-11 8:40am
View
Rather than asking if we think you might have a problem, why not tell us if you do and what that problem actually is.
Alan N
28-Feb-11 10:06am
View
The original question is tagged as C#1.0 which doesn't have the FormClosing event.
Alan N
12-Oct-10 7:42am
View
Please clarify the type of DefaultValue and also what "not working" means.
Alan N
25-Aug-10 9:00am
View
The directory information does occupy space although precisely where and how much is dependent on the disk format. On FAT systems space is allocated for each individual directory whereas NTFS uses one index called the Master File Table (MFT). This is preallocated and expanded when it becomes full. Some light reading on file system internals can be found at http://www.ntfs.com.
"Or at least it isnt included in the 'size on disk' in the folder properties" TRUE
As for MSDN, who can say? It may be the link to GetFileSize in the directory management reference is a mistake as that topic refers to file handles only. Clearly GetFileSize will accept a directory handle but why it does appears to be a secret!
Alan N
6-Aug-10 4:29am
View
Could you let us know which line is line 56 as you only show 48 lines.
Alan N
5-Aug-10 20:34pm
View
What do you mean, the code does not define smth!
Alan N
16-Jul-10 15:17pm
View
Is that really an empty catch block within the loop?
Show More