|
I think you asked a similar question previously, which i answered for you earlier today. Please drop me an e-mail if you can't find it / need clarification
|
|
|
|
|
Is there a way to create a “COM - Out Of Process” style object in C# (.NET)without using .NET remoting?
Any ideas out there? Am I stuck with remoting no matter what?
Thanks!
|
|
|
|
|
Hi,
Is there an activex control for importing flash(swf)? or How can i import a swf into my app???
|
|
|
|
|
In a C# Windows Form, I have a treeview/listview pair that behaves like Windows Explorer, displaying drives, folders and files... I want to display certain treeview nodes as disabled or greyed...
Can someone tell me how this can be done?
thanks very much.
|
|
|
|
|
A simple solution that may do what you want is to simply set the ForeColor of the node you want greyed to Color.Gray or Color.LightGray . You can then handle the BeforeSelect event of the treeview and check for the fore color, if it is Color.Gray or Color.LightGray , depending on which you choose, set the Cancel property of the TreeViewCancelEventArgs to true:
private void treeView1_BeforeSelect(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
{
if(e.Node.ForeColor == Color.Gray)
{
e.Cancel = true;
}
}
Hope this is useful
|
|
|
|
|
Yo Don,
thanks for the tip, that will do nicely...
|
|
|
|
|
Hello all,
I have just created my first C# exe. The exe uses the System.Process namespace to launch another exe (say c:\\X.exe - that is the X.exe is on the c: drive) . I compile my exe and it works fine on my machine. But when I put my exe on the network (on a mapped drive) - I get the following error message when I try to click on the button that launches the X.exe, I get the dialog box with the error message -
"The application attempted to perform an operation not allowed by the security policy. The operation required the SecurityException. To grant this application the required permission please contact the system administrator, or use the Microsoft .Net security policy administration tool."
I tried building my application on the same mapped network drive and running it through .Net and I get the dialog box with the following message -
"The project location is not fully trusted by the .Net runtime. This is usually because it is either a network share or mapped to a network share not on the local machine. If the output path is under the project location, your code will not execute as fully trusted and you may receive unexpected security exceptions."
Which is pretty much what happens.
Has anyone run into this problem before. Any ideas how I can fix this?
Thanks in advance.
|
|
|
|
|
This is the intended behavior, and was done to account for situations where you can't trust computers on your LAN (college dorms for example).
To change this, run the "Microsoft .NET Configuration Wizards" applet, on 2K/XP this is in the Administrative Tools portion of the Control Panel. Not sure where this is on Win98.
If you can't trust your LAN, then use the "Trust an Assembly" wizard to give your application full trust. If you CAN trust your LAN then you can use the "Adjust .net Security" wizard to adjust the LAN to Full Trust.
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
I was wondering If anyone had an experience with retrieving path of the Windows directory C#
Unfortunately, Directory namespace has no class/member function to retrieve this information,
And when I try to use
this piece of code to import SDK function:
[DllImport("kernel32")]<br />
private static extern uint GetWindowsDirectory(string lpBuffer,
uint uSize
);
But apperantly I couldnt make this work.
Basically lpBuffer should be ref parameter in C#, but in decleration of this function is LPSTR in SDK,
Any help will be appreciated,
Thanks,
~Mithat
|
|
|
|
|
System.Enviroment
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
I already checked the System.Environment
And it does not have a memeber variable to rerieve the path for Windows directory .
I want to retrieve c:\winNT
not C:\winNT\system32 (which you can retrieve with Environment.SystemDirectory() )
or any of those: Program Files, Programs, System, or Startup directory (which you can retrieve with Environment.GetFolderPath() )
is there any method in System.Environment that rerieves Windows Directory path ?
Thanks
~Mithat
|
|
|
|
|
Mmithat wrote:
not C:\winNT\system32
just remove the \system32 bit or \system in win9x....
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
this is how i retrieve it right now,
csTempDirectory = Environment.SystemDirectory;<br />
m_csWindowsDirectory = Directory.GetParent(csTempDirectory).ToString();
But I dont want to rely on those kinda stuff
sometimes system does not let u get those paths.
and it may vary .
in my orginal message, there should be a way to import this function (getwindowsdirectory()) from SDK
But i am just not comfortable with the variables in import-declaration-functions.
~Mithat
|
|
|
|
|
Or you can try:
Environment.GetEnvironmentVariable("windir");
I havent tried it, but it should work
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
I like that better.
Thanks =)
~Mithat
|
|
|
|
|
[DllImport("kernel32.dll", CharSet=CharSet.Auto)]
private static extern uint GetWindowsDirectory(
[MarshalAs(UnmanagedType.LPTStr)]
System.Text.StringBuilder lpBuffer,
uint uSize
);
System.Text.StringBuilder buffer = new System.Text.StringBuilder(255);
GetWindowsDirectory( buffer, (uint) buffer.MaxCapacity ); Works here.
I think as a general rule, when you need to pass in a buffer to receive text you use a StringBuilder object.
[edit]Looking at MSDN for the GetWindowsDirectory function it is supposed to accept a TCHAR, so the MarshalAs and DllImport attributes should be changed accordingly as above.[/edit]
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
[DllImport("kernel32.dll", CharSet=CharSet.Auto)]private static extern uint GetWindowsDirectory( [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpBuffer, // buffer for Windows directory uint uSize // size of directory buffer);
Really great language C#. Fast, simple and very comfortable...
|
|
|
|
|
Better get used to it.
|
|
|
|
|
i'm curently writing an application that use winamp , but i can't find any way that i can get informaions about the song it's curently playng(i'm especialy interest in geting the path of the file)
sorry for my english
|
|
|
|
|
I'd like to create an array of references to variables--for example:
void Foo()
{
int a;
string s;
Point p;
Item[] items=new Item[] {new Item(out a), new Item(out s), new Item(out p)};
then pass the array to a function and have the function iterate through the array and populate the data, so that the local vars in the caller get populated--for example:
...
PopulateItems(items);
...
}
void PopulateItems(Item[] items)
{
items[0]=1;
items[1]="abc";
items[2]=new Point(0, 0);
}
Keep in mind this is a simplified example, as ultimately the thing needs to extract the type. The point is I'm looking for something that does this given a dynamic list of items.
Is this possible in C# (and how), the equivalent in C++ being int*, string*, and Point* ?
Thanks!
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
Marc, how does your poor girlfriend/wife keep up with this?
I'm not really grasping what you are trying to do, but I have a suggestion or 2. Have you tried this in an unsafe context, that would appear to be the easiest. Secondly, boxing those variables mite do the trick, but I'm not really sure about that.
Hope you win
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Marc, how does your poor girlfriend/wife keep up with this?
She often has lesson plans to do in the evening, and a thesis paper that she works off&on on.
Basically, I want an array of pointers. You're right, an unsafe context would work, because I can get at the pointer. I'll have to try that.
I'll look at boxing too.
Thanks for the tips!
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
Hi all,
I am working on an application that has several file associations. I am wondering how to embed a 2nd icon to be displayed by the shell for the files that are associated with my application. I am able to associate them with the main application icon, but I don't know how to embed a 2nd icon that the shell can access from my exe.
Thanks for your help,
Scott
|
|
|
|
|
How to manipulate the bgcolor of the box within the CheckBox or the RadioButton?
(by System.Windows.Forms)
Can anybody help?
Thanks
|
|
|
|
|
Another question, can anyone tell me how to run an external application from C#! Acctually I want to run cmd.exe from my application and do some thing there!
Thanx...
|
|
|
|