|
AndrewPeters wrote: reliability problems
I wonder what would happen if the wrong process would get killed?
|
|
|
|
|
I am invoking multiple COM objects with a thread assigned to each COM object initiated.If i kill the out-of-proc server, wouldnt that stop all DLLs from executing not only the one instance i need killed?
But again i am trying trying to wrap the COM invocation in an exe application and assign the exe launch to a thread.Hence every COM instance is invoked by a thread through the exe application.When i need to abort the thread i kill the exe process assined to the thread.Do you think that will work i.e killing the exe will it stop the DLL execution?Lets say it works , is there performance issues related?How can i solve this?
|
|
|
|
|
Hi All,
Windows Explorer generally remembers the setting of each folder viewed.There is one entry in the HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\Bags for each folder.how I can know which entry corresponds to which folder, programmatically.Thanks in advance.
Rakesh
-- modified at 2:03 Saturday 31st December, 2005
|
|
|
|
|
There is no documented relationship between which bag under ShellNoRoam belongs to which folder. You actually have to go through the Shell's Namespace interface on the ShellFolder you want to get this information.
I hope you're familiar with the Win32 Shell API's. If not, Shell Basics[^].
From the MSDN Gospel:
Objects that support IShellFolder are usually created by other Shell folder objects. To retrieve a folder's IShellFolder interface, you normally start by calling SHGetDesktopFolder. This function returns a pointer to the desktop's IShellFolder interface. You can then use its methods to retrieve an IShellFolder interface for a particular namespace folder.
Note: IShellFolder methods only accept PIDLs that are relative to the folder. Some IShellFolder methods, such as IShellFolder::GetAttributesOf, only accept single-level PIDLs. In other words, the PIDL must contain only a single SHITEMID structure, plus the terminating NULL. When you enumerate the contents of a folder with IEnumIDList, you will receive PIDLs of this form. Other methods, such as IShellFolder::CompareIDs, accept multi-level PIDLs. These PIDLs can have multiple SHITEMID structures and identify objects one or more levels below the parent folder. Check the reference to be sure what type of PIDL can be accepted by a particular method.
You can make a quick check to see if what you want to do can be done using the desktop.ini file in each folder by checking out this[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Thanks for your reply.Actually using the IShellFolder and IShellFolder2 interface was the first thing which i had tried.but i didn't have any success with them then i tried to get it through registry.Basically i want to know the sort order for a particular folder view if there is any.Hopefully by using IShellView or IShellFolder2 i can get some useful information.This is the code which i had tried.
IntPtr newPidl = IntPtr.Zero ;
IShellFolder ishFolder = null;
IntPtr ppvOut = IntPtr.Zero;
string path = @"C:\Documents and Settings\Administrator\Desktop\A";
if(Interop.SHGetDesktopFolder(ref ishFolder)==0)
{
// we have it:
int cParsed = 0;
int afItem = 0;
ishFolder.ParseDisplayName(
IntPtr.Zero,
IntPtr.Zero,
path,
out cParsed,
out newPidl,
out afItem);
IntPtr handle = IntPtr.Zero;
WIN32_FIND_DATA data = new WIN32_FIND_DATA();
handle = Class2.FindFirstFile(path,out data);
//here i am getting the error
ishFolder.CreateViewObject(handle,ref IID_IShellFolder2,out ppvOut);
******************************************************
but i was not able to get any folder even IShellFolder interface itself from the CreateViewObject
function.This is The error i got::
System.InvalidCastException: No such interface supported
at TestApplication.IShellFolder.CreateViewObject(IntPtr hwndOwner, Guid& riid, IntPtr& ppvOut)
How can i get IshellFolder2 or IShellView interface for any folder.what i am doing wrong here?
Also thanks for the .ini link but i don't think it is going to solve my problem.Any ideas will be greatly appreciated.Thanks in Advance.
Rakesh
|
|
|
|
|
I planed to start learning C#. Which is the best book to learn C# as beginner and also programmable.
N.Rajakumar B.E.,
Application Developer,
|
|
|
|
|
Professional C# by Wrox Publishers
Akif
|
|
|
|
|
please ,send me the C#.NET step by step programming.
signature:
chandrasekhar
|
|
|
|
|
You may wish to consider purchasing it yourself. That way the author will be compensated for the considerable time and effort put in to writing the book in the first place.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
Hi.
There are a variety of good books to learn C# besides the one just mentioned to you. Programming C# by Jesse Liberty is good, the same goes for C# Unleashed by Joe Mayo and the same goes for C# The complete reference by Herbert Schildt.
If you look them up on amazon you might be able to see their content there.
Good luck,
FJ
|
|
|
|
|
|
Hi,
My add-in will debug for a distribute program, so I need to set different break points to diff "Node"s. I insert new ones and remove old break points at runtime when node switchs, this is done successfully, but my program still stop at the old break points, and the break point's BreakPointLastHit property is null (because I remove old ones already).
what shall I do to stop my program at the new ones.
|
|
|
|
|
Hi
I have a simple WinForm I've created. With the following code:
//////////////////////////////////////////////////////////////
public void DrawXYAxes(Graphics g)
{
g.DrawLine(axisPen, xIndent, yIndent + 200, xIndent + 400, yIndent + 200);
g.DrawLine(axisPen, xIndent + 200, yIndent, xIndent + 200, yIndent + 400);
}
This will then draw X Y Axes on the form.
Let's say the screen coordinates at the drawn origin are "200, 200".
What's the most efficient way to get "200, 200" to display "0, 0"?
So now when I move the cursor around the Form it will have both positive and
negative axis coortinates?
ps--I know how to display the screen coordinates as text on the screen, I just can't seem to get the system to be correct....
Thanks very much......
|
|
|
|
|
I think that you may want to investigate Graphics.TranslateTransform() . If you translate the Graphics object by 200 left and 200 down, you'll have what you need, methinks. To see this in action, you can check out my recently published article Y(et)A(nother)TabControl in which I perform these kinds of transformations to translate the origin all over my control.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Curtis,
Thanks a lot for your help. I'm now at least able to draw a 'translated coordinate' Rect on my form inside the Paint Handler.
Now I just need to figure out how to tie this in to OnMouseMove event.
|
|
|
|
|
i want to set my own images for the scrollbar object to the up and down arrow button, for the bar, and the base.
How?
|
|
|
|
|
Best to create this control from scratch. I've tried in the past to OwnerDraw with the .NET scrollbar, but you end up recreating the entire control. You can construct one quick easily with a few buttons and a little GDI+ magic.
|
|
|
|
|
Hallo,
I'm not sure if here is the right place to post this question...
I'm using D3D 9.0c with C# and I have a little problem with Texture. Can anyone help me?
The strange things happens is the follow:
When I use PositionNormalColored and lighting=true it is all ok, all lights and shadows,
When I use PositionNormalTextured and light=true I see all black. When I set lighting=false the objects are correctly rendered, clearly without lights and shadows. Does anyon know why I'm having this problem? Maybe I'm doing something wrong?
Thank you very much...
_Comet_Keeper_ (from Italy)
|
|
|
|
|
Have you applied an actual texture? PositionNormalTextured won't have colored vertices. If you've assigned a texture, you may need to set the texture mappings. I'm not an expert myself in Managed DirectX 9 (or DirectX for that matter), so you may have better luck in a MDX forum (such as the GameDev.net Managed game programming forum[^])
|
|
|
|
|
i wanted to create an program to show an image as a crosshair in the center of the screen for some games. ive created the crosshair with a transparent form, the image background is transparent also, it works when im running a normal program like a web browser, but when i run a game such as Wolfenstein or Counter Strikc Source (running some resolution as windows) the form loses its always-on-top property. it is moved to the background. is there a way i can make the form ALWAYS stay on top?
thanks in advance,
sam kline
|
|
|
|
|
Not in a DirectX game. The window IS "on top" of the all the other windows on the desktop. But the game isn't drawn in a window on the desktop. DirectX draws directly to the video cards frame buffer, overwriting what GDI draws in a window.
Your form is still on top, but is only drawn when the form is visible. Since the DirectX games completely hides the desktop, your form is no longer visible and will no longer get any WM_PAINT messages to tell it to repaint itself.
You'll have to re-write this as a mod to the games. There's no "generic" way to do this for all games.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Have a very simple form (form2) that checks for the credentials.
The following code works but it leaves the dialog (form2) open. I just want to display Form1 if credentials are good.
if(textBox1.Text=="username")
{
//MessageBox.Show("good user, check password","Info");
if(textBox2.Text=="password")
{
//credentials are good, display Form1
Form1 firstForm = new Form1();
firstForm.ShowDialog(this);
}
else
{
MessageBox.Show("Bad user or password","Info");
}
}
else
{
MessageBox.Show("Bad user or password","Info");
} }
|
|
|
|
|
This is very easy to do. I just need to understand a few things of what you are trying to do:
1. Does this check happen on start up? If yes, there is a better way to do this.
2. After the MessageBox tells you "Wrong password...etc. what do you want to happen - everything to close?
3. You seem to have only OK button n the MessageBox that displays wrong password... do you want the same thing to happen if a person presses OK or cancels the dialog?
This will close and release all the resources associated with the form (including memory) the main form after the dialog has opened that tells the password is incorrect and OK is pressed or that dialog has exited.
if (MessageBox.Show("Bad user or password", "Info") == DialogResult.OK)
{
this.Dispose();
}
Let me know if this helps.:->
|
|
|
|
|
Hi peshkunta
I started the main project then later I decided to add another form (form2)to check credentials.
So what I did is change the code to point to second form2
-Application.Run(new Form2());-
This causes the second form2 to be displayed first.
Then if credentials are OK, form2 dispaears and form1 is displayed
I tried this code
using (Form1 f = new Form1())
{
this.Hide();
f.ShowDialog();
}
this.Show();
but when I close the main form (Form1), the first form (Form2) is displayed again.
|
|
|
|
|
I think you are making this harder than it has to be - your approach.
The most straight forward and easier for you in the long run would be:
1. Leave Form1 to start in the Application.Run function
2. Go to the Form1 events and add an on Load event handler(function). In this function add your code to start and show your Form2 - the authentication form. This will make Form2 open first and get the focus (be in front). Although both forms will be open (not sure if this is a problem in your case) if you make it as modal with ShowDialog() - that way the person will have to work with Form2 and not be able to mess with Form1 until it's been authenticated.
OR
If you want when you close Form1, Form2 to not be displayed, go to the event handler for Closing in Form1 and tell it to close Form2 when form1 is closing and that should solve the problem. I would use Dispose().
|
|
|
|