|
An application domain is a managed application boundary in .NET. You can only cause data to cross domain boundaries using some communication mechanism - you cannot directly call into another application domain (IIRC).
Many application domains can be hosted within a single process. They share the same user-mode address space, which reduces some of the load for the operating system. Different domains in the same process can have their own configurations. ASP.NET takes advantage of this, hosting every site within its own AppDomain, all within the same worker process (aspnet_wp.exe on Windows 2000 and Windows XP; w3wp.exe on Windows Server 2003).
|
|
|
|
|
Thank you for this reply
|
|
|
|
|
Hello,
I'm working on a project where we need to keep track of user's action. We're developing our project in .NET and Windows environment. User's action here means everything that user did. For example, user creates/saves/opens a document or a webpage, sends an email to a recipient, user changes the focus window (by clicking on another window), etc.
We're using automation to trap these events of MS Office and IE. We query for the top most window every second to see if user changed the focus window or not. Other than those applications, we haven't yet figured out a way to do them.
However, the events of MS Office and IE are not very sufficient. For example, Word/Excel/PP object does not provide SaveAs event. Detecting the change in focus is unstable.
I'm just wondering if there is generic way to capture events for all of Windows application. Is there anyway to screen out the underlying messages of the application and then figure out what happened?
Thanks,
|
|
|
|
|
This question is directed towards MSMQ in .NET (System.Messaging.MessageQueue, etc), but is relevant to messaging in general.
Suppose I have a lot of messages coming through some queue (~1000 msgs/sec),
and some function ProcessMessage(Message msg) that I want to invoke to process each message.
There are two ways to read these messages asynchronously (MSMQ/.NET):
1. Begin a thread (or Timer thread) that periodically polls the queue (MessageQueue.Receive()), retrieves a new message, calls ProcessMessage().
2. Call the asynchronous MessageQueue.BeginReceive() to which you pass your callback function (as delegate). Then when a new message comes, the MessageQueue will automatically call your callback function.
The difference in performance is unclear to me. In the second case, it seem you have to do less work, since you get notified automatically when a message arrives instead of having to write a thread that checks this; however, there is more flexibility in the first approach, because you control exactly how the check for new messages is performed, how often, etc. But I am really only interested in performance, and though I am going to write some simple examples to test this, I am not sure that they will be representative of what happens under a real load.
Does anybody have thoughts on this? Thanks!
-Vlad
|
|
|
|
|
I am building a .NET compiler so I want some info on MSIL.Can anyone help.
|
|
|
|
|
|
Yesterday I tried to pass a TransportObject to my web service. This object has two properties, Method and State. Both are string fields, and I serialize a business object using a SoapFormatter for the state field. When I use the following serialization code, the web services bombs:
Dim ms as New MemoryStream
Dim soap as New SoapFormatter
soap.Serialize(ms, object)
Dim state as String = Encoding.ASCII.GetString(ms.GetBuffer())
WebService.Process(New TransportObject(state, "Save")
But when I use the following code, it works:
Dim ms as New MemoryStream
Dim soap as New SoapFormatter
soap.Serialize(ms, object)
Dim state as String = Convert.ToBase64String(ms.ToArray())
WebService.Process(New TransportObject(state, "Save")
Memes don't exist = tell your friends
|
|
|
|
|
Hi,
I'm currently writing a Word-addin.
I Successfully added a Toolbar in my addin.
I also created a Form that displays the State of Command-Execution.
The Problem is: this Form does not stay in front of the word-application.
I tried to Show the Dialog modal, that means with the Form.ShowDialog()-Function.
This also didn't work.
I think the problem is, that my Form doesn't know its owner. Any suggestions?
Thanks,
Klaus
|
|
|
|
|
Got a problem guys,
I am writing a vector game with .net and gdi+. I've run into a bit of a brick wall and I need some advice. I am writing the game in vb.net but I have a general understanding of C# so if you reply to this message with C# code I will have no problem.
The game map consists of many randomly sized rectangular obsacles placed randomly around at random rotations.
In the game you pilot a ship around the map. When you apply forward force the ship starts accelerating in the direction it is pointing. If you rotate the ship it continues along it's original path until you apply force in a different direction.
The "Ship" has a circular shield that surrounds it.
Now, I am able to detect when the ship's shield collides with a rectangular obstacle by checking wheather or not the intersection of the ship's shield region and the rectangular obstacle's region has a size.
My problem is...
I want the ship to bounce off the rectangular obstacle at the appropriate angle.
Anyone have any ideas on how to acomplish this?
I wish I could tack on some screenshots to help explain.
Feel free to ask me any questions if you need more info.
Thanks
dB
dB
|
|
|
|
|
Hi David,
I don't pretend to understand collision detection/response well at all, but I was looking into this kind of thing a few months back and I ran across an article that might help. This may be more than you need since it seems like you're talking about a 2D problem as opposed to a 3D one but I think it will work out the same. In the formulas below, V is the velocity vector of your ship, N is the surface normal of the plane you are colliding with, Vn is the velocity in the normal direction, Vt is the velocity in the direction tangential to the surface normal, and V1 is the new velocity vector you're looking for.
Vn = (N . V) * N <-- supposed to mean "the dot product of N and V, multiplied by N"
Vt = V - Vn
V1 = Vt - Vn
I got this from the following gamasutra article (and there's a picture in there explaining what the different vectors represent):
http://www.gamasutra.com/features/20000208/lander_01.htm
Hope this helps!
Phil
|
|
|
|
|
Phil,
Well I don't remember much of the math I lerned in High School, which is really my problem. Perhaps you can enlighten me.
What exactly do you mean by "Velocity Vector"? I know the velocity and the bering, how do these relate to a "Velocity Vector"?
Also, what in the world is a "dot product"?
I actually figured out how to do it after staring at the screen for several hours last night, smoking cigarette after cigarette, but my method is quite a bit more complex than the one you describe seems to be.
Thanks
dB
|
|
|
|
|
I was afraid you'd ask that. You seem to be in a 2D world with a bearing (presumably in degrees) and a velocity, so my answer will be based off that assumption.
A 2D vector can be thought of as a line going from the origin of a cartesian coordinate system <0,0> to the point <x,y>, so the vector can be represented with 2 scalar values x and y.
To calculate the length of a vector we simply calculate the distance between the origin and the point at <x,y> :
length = sqrt( (x-0)*(x-0) + (y-0)*(y-0) )
= sqrt(x*x + y*y)
You can think of the "length" of the velocity vector as the actual velocity of the ship, and the coordinates as the bearing. So the velocity vector contains both the direction and the velocity. If, for example, the ship is traveling at a 45 degree angle, the velocity in vector notation might be <1, 1> or <2, 2>, or <3, 3>, etc., depending on how fast it's going. If the vector is <1, 1> it means the length (i.e., velocity) is sqrt(2), if the vector is <2, 2>, the velocity is sqrt(8), etc.
In your case you need to take the sine of the bearing as the X coordinate for the velocity vector, and the cosine of the bearing becomes the Y coordinate for the vector. Then you scale that vector by your velocity amount by multiplying the x and y component of the vector by that amount.
Rather than get into vector dot products and cross products and other scary stuff, I think it would be better if I just refer you to another document that I think does what you're looking for.
http://www.gamedev.net/reference/articles/article1019.asp
This shows an implementation of 2D vectors and also a function for computing the angle to adjust a ball striking a pool table edge, which sound like the kind of thing you're doing. Look for the function "CBall::HitBoundary".
If you want to read up on 2D vector math, etc. there's a million places you can go on the web. Here's a page that explains unit vectors and vector dot products: http://www.geocities.com/SiliconValley/2151/math2d.html
Good luck!
Phil
|
|
|
|
|
Oh Yea, well that aught to make things a bit easier.
Thanks!
|
|
|
|
|
Hey Phil,
I've got one more problem. I've been taken the data you gave me and assembled it into a 2DVector class. I am almost finished but I am stuck on one thing. Is there an equasion to determine the bering in degrees from the vector coords? I can't seem to find the answer to this question anywere on the internet. I've been through pages and pages of search results for hours today and I'm starting to get a little pissed off.
Thanks,
dB
|
|
|
|
|
I was wondering if there is a MFC ShellExecute(...) equivalant in the .NET Framework that would allow me to execute programs and web addresses (opening the default browser). Thanks.
BNEACETP
|
|
|
|
|
Process.Start()
You can specify if it should use the OS method (ShellExecute) or managed implementation (?)
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
Thanks for the help!
Happy Programming!
BNEACETP
|
|
|
|
|
hi,
i am developing installer using .net framework, package wizard.
And i use to make custom action, so i develop dll.
I would like to get install path in dll.
if you have some solutions, please tell me.
best regards,
yu-yu
|
|
|
|
|
If you developed a native DLL to use in your custom action, you can use MSIHANDLE passed to your stdcall function then use the MsiGetProperty . See the Windows Installer SDK on MSDN[^] for more information.
If you wrote a .NET Installer -derived class, you'll have to pass the SourceDir property from MSI as a command-line parameter, such as /SRC=[SourceDir] . To get the value of this command-line parameter, use Installer.Context to get an InstallContext , then InstallContext.Parameters["SRC"] (for example) to get the value of that property.
-----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-----
|
|
|
|
|
Dear Stewart,
thank you for your advice.
I got this.
best regards,
yu-yu
|
|
|
|
|
Hi, I have a subclass of System.Windows.Forms.Panel and I need to know when the panel is scrolled. But there doesn't seem to be a "scrolling" event for Panel. So I'm guessing I need to add a handler to the scroll event of the scrollbar itself. But how do you get access to the scrollbar?
Thanks!
Phil
|
|
|
|
|
Extend Panel and override WndProc . Handle the WM_HSCROLL (0x0114) and WM_VSCROLL (0x0115) messages accordingly. See the Scroll Bars[^] in the Platform SDK for more details. Some background in Windows programming will be very helpful.
-----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-----
|
|
|
|
|
Thanks Heath, I'll check into doing it that way. Sure seems strange to me that the framework doesn't just expose either the scrollbar handle or a scrolling event, though. Sigh...
Phil
|
|
|
|
|
Hi,
I'm writing a plugin system in VB.net, and each plugin Implements a base class. (Done).
Now I'm making the parent framework that will house and execute each plugin. What I am doing is I will be creating a Thread for each plugin. Then what I want to have is a safe way run the Threads so that if the parent application wants to close, it gracefully closes down the thread before close.
Has anyone got any examples of performing something like this?
|
|
|
|
|
I have a project where i have a tab layout containing 12 tabs now on one of these tabs there is section of code that requires a word document to open and retreive bookmarks and insert them in the corresponding text boxes. i got this to work fine but it takes a while to complete the whole process. what my problem is because of the ammount of controls this tab has on it and the amount of code it needs to go through during run time the tab seems to pause during the switching between the tabs until the code is completed.i tried to use a progress bar and suspend /resume the layout of the tab and the form but to my luck this didnt work if anyone has an idea how to make the switch viewable after the code is completed any help would be apreciated
|
|
|
|
|