|
After that, try Alt-\
And then, Shift-F12, and then Alt-`
That should be enough from the first month or so
Best,
John
-- Log Wizard - a Log Viewer that is easy and fun to use!
|
|
|
|
|
- Install
- Fiddle around
- Realize how it bogs down Visual Studio
- Uninstall
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Not to mention the endless list of underlined 'suggestions' that it gives you making it harder to spot the underlined 'syntax errors.' I have had colleagues that used it and, in my opinion, didn't really do much to improve the code besides pointing out where you could've saved lines using the ? and ?? operators and a million suggestions to use var.
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
Read trough the documentation of the options very carefully...Learn all the options it has and decide what to use and how...
By default R# use a sometime very dumb rule-set, and the suggestions suffer from it...So configure it for your need...
And even that, review all suggestions (and do not accept them as is) until you are feel, that you trust it...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Lucky you ! This is a great tool; it is deep, with a staggering variety of options.
imho, well worth the time to study how to use it, and to configure its options carefully.
cheers, Bill
«In art as in science there is no delight without the detail ... Let me repeat that unless these are thoroughly understood and remembered, all “general ideas” (so easily acquired, so profitably resold) must necessarily remain but worn passports allowing their bearers short cuts from one area of ignorance to another.» Vladimir Nabokov, commentary on translation of “Eugene Onegin.”
|
|
|
|
|
Ian Klek wrote: Any tips to get started? Yes. Get a really fast machine.
/ravi
|
|
|
|
|
Don't forget installing enough memory to keep Google running for the next 30 years.
This space for rent
|
|
|
|
|
I wrote 2 pairs of named pipe client/server programs: 1st pair in C# (.NET 4) 2nd pair in C++ (un-managed)
All 4 test programs use the same pipe name \\.\pipe\mypipe
The C# pair work fine with each other - I send a message from the client and it is received by the server. The C++ pair work also fine with each other.
But... when I try to run the C# client with the C++ server, or the C++ client with the C# server - then it doesn't work. The client is unable to connect to the server.
Is there something preventing the C++ client from working with the .NET server? Should it work?
Thank you.
modified 16-Feb-16 15:33pm.
|
|
|
|
|
Crazy Joe Devola wrote: The client is unable to connect to the server.
When running the C++ client and it doesn't connect, check the error code: GetLastError()
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
it returns error code 2 - ERROR_FILE_NOT_FOUND
|
|
|
|
|
You might want to try Sysinternals' Process Explorer. It can enumerate every kernel object (that includes pipes) that exists inside a process. This way you could be sure the pipe name is being created the way you intend.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
thank you.
I have Process Explorer but I don't know how to see list of objects for a process.
I used the search option to search for "mypipe". It shows that the server has a handle to \Device\NamedPipe\pipe\mypipe . I tried to check the client to open "\Device\NamedPipe\pipe\mypipe" but that didn't help (I didn't expect it to work anyway).
|
|
|
|
|
This is how the client opens the pipe:
hPipe=CreateFile("\\.\pipe\mypipe",
GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0,
NULL) ;
if ( hPipe!=INVALID_HANDLE_VALUE)
{
return 0;
}
err = GetLastError();
if(err!=ERROR_PIPE_BUSY)
{
printf("Could not open pipe, GetLastError=%u\n", err);
return -1 ;
}
Create file returns an invalid handle. GetLastError() returns 2.
|
|
|
|
|
You do know that backslashes need to be escaped in C++, right? It should be:
hPipe=CreateFile("\\\\.\\pipe\\mypipe",
GENERIC_WRITE, 0,
NULL,
OPEN_EXISTING,
0,
NULL) ;
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Yes i do for some reason the codeproject shows just 1 backslash. I do have it like this:
"\\\\.\\pipe\\mypipe"
|
|
|
|
|
Let's see the code that creates the pipes in both projects.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Server: C#
NamedPipeServerStream pipeServer = new NamedPipeServerStream("\\\\.\\pipe\\mypipe", PipeDirection.In, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
pipeServer.BeginWaitForConnection(new AsyncCallback(WaitForConnectionCallBack), pipeServer);
Client: C++
hPipe=CreateFile("\\\\.\\pipe\\mypipe",
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0,
NULL) ;
if ( hPipe!=INVALID_HANDLE_VALUE)
{
return 0;
}
err = GetLastError();
if(err!=ERROR_PIPE_BUSY)
{
printf("Could not open pipe, GetLastError=%u\n", err);
return -1 ;
}
printf("Could not open pipe, GetLastError=%u. WaitNamedPipe.\n", err);
if(! WaitNamedPipe(pipe_name,2000))
{
printf("Could not open pipe\n");
return -1 ;
}
again:
C++ client with C++ server - works.
C# client with C# server - works.
C++ client with C# server - does not works.
Thank you.
|
|
|
|
|
This is just a guess, but could it be that since you have specified both GENERIC_READ and GENERIC_WRITE for the client, then you need to open the server as "InOut"?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I thought of that. I tried changing the server side to InOut - it did not help.
i also tried changing the client to GENERIC_WRITE without GENERIC_READ - it didn't work either.
Thank you for all the advise, tips and time you spent trying to help - much appreciated.
|
|
|
|
|
I think the problem was found....
On stackoverflow, someone posted this answer:
C#'s NamedPipeClientStream, NamedPipeServerStream automatically append ".\pipe\" to the name
I changed the C# code to open the pipe just as "mypipe" and now the connection is successful.
|
|
|
|
|
Glad you got it sorted.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hello,
How to read and print *.plt file by C#?
Thank you!
|
|
|
|
|
There are several interesting articles on how to do this here[^]. The assumption is that you are automating AutoCAD from .NET. If you are attempting to do this without AutoCAD, you're going to have to find a component that reads and understands AutoCAD files.
This space for rent
|
|
|
|
|
Overview
I'm working on this class to asynchronously copy files to/from the server. I want to run it in tasks so that I can copy many files at one time without blocking.
I've pieced this class together from Google results and trial and error. It does two things for me:
1) Reports the progress of the copy
2) Reports when it's done.
The FileEx class I got from here[^].
Questions
1) How can I include the name of the file in the progress?
2) How can I include the name of the file when done?
Here's the class:
using System;
using System.Threading.Tasks;
using MyApp.FileTransfer;
using MyApp.Client.Classes;
namespace MyApp.Client.FileTransfer
{
public class LANFileTransfer : IFileTransfer
{
#region Public Methods
public async void DownloadFile(string sourceFile, string destFile)
{
await Task.Run(async () =>
{
await TransferFile(sourceFile, destFile);
}).ContinueWith((t) => FileTransferComplete(t));
}
#endregion
#region Private Methods
private void FileTransferComplete(Task task)
{
}
private void FileTransferProgress(double percentage)
{
}
private async Task TransferFile(string sourceFile, string destFile)
{
IProgress<double> progress = new Progress<double>(FileTransferProgress);
await FileEx.CopyAsync(sourceFile, destFile, progress);
}
#endregion
}
}
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
1st thought ... the CopyFileEx routine has a lpData input that is passed to the callback function(s?) - could you pass a pointer to the string filename here ?
(there's also a nice article on wrapping CreateFileEx here .NET Reference Guide | .NET Book Recommendations | InformIT[^] that you may get some mileage out of - I note Jim calls this pointer 'UserData')
2nd thought .. not sure Im going to use the correct terminology .. 'daisy chain the callbacks' - the first CreateFileEx (or whatever) callback calls an Internal to your class callback-handler - you then from this handler call your 'external' handler from here adding any other information you want
3rd thought - Im certifiable
|
|
|
|