|
Actually I wrote the Mouse Hook inside a native Windwos DLL.But I want to route all these mouse messages through my C# application or DLL.Like
Hooked App->Native DLL->C# (App/DLL)
As these messages carry data and going to be very fast , .Net remoting will help better performance?
VikramS
|
|
|
|
|
No, .NET Remoting wouldn't be the answer. It's best for .NET<-(context)->.NET (that is, two .NET applications across different contexts).
What is loading and registering your hook now? The only two methods I know of is from the registry (although some hooks can't be loaded that way and I don't remember if systems hooks can) or some native app? You could, perhaps, you P/Invoke to load and register (or call a wrapper functions in your DLL that does that) from your .NET app. Then you could either use IMessageFilter and Application.AddMessageFilter to watch for the messages that your DLL would route to it's calling app (not sure about the feasibility of that one) or register a Delegate (function pointer, i.e. callback) via it's handle (as an IntPtr , by calling myDelegate.Method.MethodHandle.GetFunctionPointer() . I should warn you, though, that this is untested but seems like it should work.
Otherwise, if the apps need to be disjoint, you may have to use IPC.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi
How can I request a web page using POST while passing some variables? Like I want to access
http://www.localhost.com/info.aspx
with POST and with variables info=0 and set=1 ?
thanks in advance;
mE
---------------------
A gasp of breath,
A sudden death:
The tale begun.
A rustled page
Passes an age:
The tale is done.
|
|
|
|
|
The easy way is with the System.Net.WebClient class, which has an OpenWrite method that you can pass a URL and "POST" (as the second param). Then you just write your &-delimited name/values pairs to the stream.
This is just a wrapper for doing the same thing - in concept - using the WebRequest and WebResponse classes. All these things have good examples to show you (especially the WebClient.OpenWrite method overload list page).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Can you install CLR with Windows Installer? Including .NET as part of the installation package on a CD? Thanks.
|
|
|
|
|
Yes, but first you have to nullify the code for the render engine. After that it is a simple process of byte relay to byte relay. Astro Physics 101.
/\ |_ E X E GG
|
|
|
|
|
I have this hellish class, "logging.cs" with an equally hellish method deep inside it's bowels, "populate.cs".
public void populate()
{
logForm.Show();
}
Now I as it has came to pass, this method is running on a thread.
Now, as the method, and/or class ends, the thread apparently is killed by garbage collection.
So, as you can see the method would run and the form "logForm" will 'show' but for only as long as it takes for the computer to finish the method, and consecuently kill the thread, which closes my form.
This here, is my problem.
Now, here is my question.... How can I keep the thread running, or at least the form???
Is this annoying?
/\ |_ E X E GG
|
|
|
|
|
Run populate on another thread and then show the form as modal with ShowDialog() instead of Show(). The form will stay open even if your original thread ends and this new thread won't end until the form is closed.
|
|
|
|
|
Oh, my god.... oh my god. it's so simple...
So, now here's the question.
How much money do you want?
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote:
Oh, my god.... oh my god. it's so simple...
Simple, yes....but I'll admit it recently had me stumped for a while!
|
|
|
|
|
How do i use them and what i can use them for?
Thanks
Da Intern
|
|
|
|
|
Q: What is API?
A: Application Protocol Interface, it's a system of functions/methods usually provided by a 3rd party used in your code.
Q: What are they for?
A: Depends, too general of a question.
|
|
|
|
|
Daniel M. Edwards wrote:
Protocol
Programming
|
|
|
|
|
I wonder how long it would take to become a Senior Software Engineer asking this broad, general questions and hoping for an answer in a forum like this.
I think that if you are at the level where you don't even know what API stands for, buying entry level books would be so much helpful on the road to become a professional programmer.
Regards,
Carlos H. Perez.
|
|
|
|
|
Very good advice, and very nicely put, too.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
how do i add headers and add information into the headers.
I added the headers in the design view by using the properties menu but how do i add the header it is not displaying in the listview and bind information to it?
I know its a begineer question but i need some help please thanks!! ;)
Da Intern
|
|
|
|
|
Set the ListView.View property to View.Details , or simply Details in the designer.
To add information to columns, read the documentation for the ListViewItem class, which also includes some samples.
As far as data-binding support like in the DataGrid class, there is none. You have to add this yourself using the DataBindings property or manually (which really isn't data binding).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi, I just have a quick question on compiling. Why is it, that code that is the same length in c++ and c#, compile a lot quicker in c#?
I noticed how much quicker these things are. My question is, how do c++ programmers not commit suicide while waiting for a program to compile?
|
|
|
|
|
toticow wrote:
Why is it, that code that is the same length in c++ and c#, compile a lot quicker in c#?
Because it doesn't compile, it gets turned into IL that gets compiled by the VM the first time it is run.
toticow wrote:
My question is, how do c++ programmers not commit suicide while waiting for a program to compile?
Because our programs are faster at the end. Also, by being intelligent about how things are organised, compilation times can be made faster in C++.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
Because it doesn't compile
What does it do exactly then?
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
leppie wrote:
What does it do exactly then?
It does what I said it does. You can argue semantics on my original post, but it does NOT get compiled into anything your computer can use, it gets compiled into IL, an intermediate step before final compilation into actual, runnable code happens at run time.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
There are a number of reasons why C# compiles faster than C++. Here are the ones I thought of - there are likely more.
1) No preprocessor. In C++, you either need a separate preprocessor step or a fairly complex on-the-fly preprocessor (I don't remember offhand what VC++ does). In C#, you can easily do everything on the fly.
2) "All at once" compile model. In C#, all the compilands are compiled at once, and in C++, one file at a time, plus link time at the end.
3) Much easier metadata model. The #include model of C++ doesn't scale particularly well, and it requires reading the include files in textual format (including the preprocessor step) for every compilation. Compilers can get around this with "precompiled headers", which helps get rid of some of the overhead, but at the expense of more complexity when the set of includes changes. It also only applies to system headers, not ones from the current project. C# gets the ability to read in metadata in a binary format and more importantly, on a per-assembly basis. This is roughly the difference between looking for data in a database and looking through a text file to find the data.
4) Smaller set of libraries to consider. The Win32 Platform SDK is a huge beast, and typically has gotten bigger with each release. On the C++ team, it was not uncommon for us to work hard to get 10-20% increase in compile speed, only to see all of that eaten up by the increase in size of the windows headers.
4) Very limited compiler optimization. The C++ optimizer on release builds will normally take more time on a per-file basis than the parsing phase, though I will point out that even if you build a debug, non-optized build, C# is still quite a bit faster.
Eric Gunnerson
Current C# Compiler Program Manager
Past Visual C# Compiler QA Lead
Past Visual C++ Compiler QA Lead
|
|
|
|
|
Am I the only person who's noticed that enumerated values in C# suck? They hold integer values yet they can't be used as integers without casting.
Like in C++, I'd like to use an enumerated value to retrieve an array element by index, or as a bitmask value which may be ORed or ANDed. But no, I have to add the yucky (int) cast every time. What a load of crap!
Anyone else think they should have made the compiler work more like in C++ with regards to enumerated values? Why didn't they? Is this "feature" also prevalent in VB.NET?
Thanks,
Alvaro
Can I ask you a question?
|
|
|
|
|
First, you *can* do bitwise ops on Enum values without casting, but you might want to mark the enum with the FlagsAttribute if you do so (which VS.NET, at least, uses in some cases).
Since enums can be defined as various at various int sizes and signed or unsigned, that implicit cast would have to follow the enum's int type or risk a lossy cast (can't cast to Int32 from Int64 without a loss of data similar with unit to int). I prefer the type safety and un-ambiguity, and if you need it, the int value is there.
R.
|
|
|
|
|
Richard Lowe wrote:
First, you *can* do bitwise ops on Enum values without casting, but you might want to mark the enum with the FlagsAttribute if you do so (which VS.NET, at least, uses in some cases).
Um, no. It doesn't work. Tell me if this compiles for you:
[Flags]
enum e { e0, e1, e2 };
void foo()
{
int i = e.e1 | e.e2;
bool b = (i & e.e1) != 0;
}
Richard Lowe wrote:
Since enums can be defined as various at various int sizes and signed or unsigned, that implicit cast would have to follow the enum's int type or risk a lossy cast (can't cast to Int32 from Int64 without a loss of data similar with unit to int). I prefer the type safety and un-ambiguity, and if you need it, the int value is there.
Hmmm, it may be that I've gotten used to employing enums for more than what they're really designed for. I guess I'll have to revert back to the Java way: use const ints.
Regards,
Alvaro
Can I ask you a question?
|
|
|
|