|
surfman19 wrote:
look for my solution:
Excuse you... Is that an order?
I don't get paid enough to fix other peoples code on command. You look for your solution - We help. Besides, I already gave it to you, if you would have bothered to read it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm wondering how I can go about making a property list sorta like the one found in Visual Studio .NET. The way VS handles properties for Windows Forms is exactly what I need for a project I'm working on. Can anyone point me in the right direction to find out some more information on how to make this sort of thing?
Bungo!
|
|
|
|
|
|
I have a program that creates graphs which you can save and load.
I have successfully associated my icon to my program so that when I click on a graph file it opens the program ( in registry ie. "c:\...\...\program.exe "%1"") however it does not load my graph I use the open file dialog do I need to write specific open file code?? Any thoughts would be great.
Cheers*
Debs*
|
|
|
|
|
If you already associated your file type to your program
So did you handle the file path passed in main function?
ie the file you opened passed as command line argument to your program so you need to handle this issue
If you not associated your file type to your program by
using window explore or when you create setup project
use File Types Editor to do it
MCAD
-- modified at 15:30 Wednesday 31st August, 2005
|
|
|
|
|
hmm ok thanks for some direction, I don't think I handle command line arguments from windows ... I'll have to read up on this any suggestions?
Debs
|
|
|
|
|
How do I do to play a raw data?
Like the data that's in the data chunk in a wav file.
The other values could I fix later.
Niklas Ulvinge aka IDK
|
|
|
|
|
Please tell me how to implement a method that will look to its own class and return (eg. an array) of all members of this class (its suppose to use reflection, this kind of reflection is called 'self' if I remember good...)
I tried something like that:
<br />
ble b = new ble();<br />
<br />
Type t;<br />
FieldInfo[] mi;<br />
t = typeof(ble);<br />
mi = t.GetMembers();<br />
<br />
foreach(MemberInfo mem in mi)<br />
this.listBox.Items.Add(mem.Name);<br />
<br />
and it wrote some strange stuff... I just want to have all the members of 'ble' class (eg. string s, int i, etc)
|
|
|
|
|
Hello
Suppose we have the next class:
class A
{
public int memberVariable;
public void Method1() {}
public void Method2() {}
}
And the next code somewhere:
Type type = typeof(A);
MemberInfo[] mis = type.GetMembers();
foreach (MemberInfo mi in mis)
{
System.Diagnostics.Debug.WriteLine(mi.Name);
}
So, we'll get something like this in output window:
memberVariable<br />
GetHashCode<br />
Equals<br />
ToString<br />
Method1<br />
Method2<br />
GetType<br />
.ctor
What is wrong? You have all your own members and inherited members.
Andrew
|
|
|
|
|
My variables were private... there is no way ti display them?
|
|
|
|
|
try
type.GetMembers(
BindingFlags.NonPublic|
BindingFlags.Instance|
BindingFlags.Static
);
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
thank you very much, this was exactly what I was looking 4
|
|
|
|
|
how to retrieve the type of each field? I mean, I would like to know that, for example, 's' is a string
further questions - is it possible to retrieve also information about arguments that funcion takes and the return type?
|
|
|
|
|
Type type = typeof(A);<br />
MemberInfo[] mis = type.GetMembers();<br />
foreach (MemberInfo mi in mis)<br />
{ <br />
System.Diagnostics.Debug.WriteLine(mi.Name + ": " + mi.MemberType.ToString());<br />
}
|
|
|
|
|
it doesnt work - I tried and MemberType gives exactly the same as MemberType.ToString() - it gives only general info (method, field, etc) and I want detailed information (string, int, char, etc)
|
|
|
|
|
You want ReflectedType. All your questions can be answered by MSDN[^] though.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Hi all,
I've built a Windows Service wich accepts arguments in the main function so I can execute the exe like <code>MyWindowsServ.exe –install</code>.
I can install the service, I can run it, and everything runs ok.
Now, what I wanted to do was to install the service so when it starts it can take some arguments as well.
If you look at the COM+ Event System service properties (for instance) in your control panel, you can see that the path to executable is something like this <code>C:\WINDOWS\system32\svchost.exe -k netsvcs</code>
Is there a way I can add these arguments to my ProcessInstaller or ServiceInstaller or something like that?
Thanks,
<i>vSoares</i>
|
|
|
|
|
You can pass startup parameter to windows service but however rather than acceptin arguments in Main Method Windows service accept arguments and handle them in OnStart MethodTo setup startup parameter
Open the windows Services MMC snap-in
Select your Service->Properties-->General
You will find Start Parameters you can write your start parameters in it To add this information when you install windows service you have to write start parameters in registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
start up parameter stored in ImagePath
There are some articles at codeproject about custom installation of Windows service like
Install Service Using Script[^]
ServiceInstaller Extension That Enables Recovery and Autostart Configuration
[^]
Install a Windows service the way YOU want to[^]
MCAD
-- modified at 14:58 Wednesday 31st August, 2005
|
|
|
|
|
I would like to be able to use some old ANSI C functions but have access to them using a new GUI built in C#. Basically I'm trying to take a comsole app and make it windows based. Is there anyway to do this? I have tried adding the reference but, even though the code is compiled under .NET, it doesnt seem to like it. ANy suggestions? Or am I SOL?
Thanks in advance
Mark
|
|
|
|
|
put your c code in dll and use this dll in your c# code
P/Invoke will help you to do this
look at question titled using c++ dll in this forum page
i provide link to P/invoke article
MCAD
|
|
|
|
|
hi all i´m a little new in c# and i am having problem doing some programming
the question is: implement a method that returns an average of set variavel of arguments in integer type
can anyone help
it is quite simple but not for me
|
|
|
|
|
1. What do you mean by 'set' of arguments?
2. What kind of average? There is several differend kinds of average value...
|
|
|
|
|
So, let's say you have a set of an unknown number of arguments
void Test(params int[] arguments)
{
}
You could compute the average by using something like
int sum = 0;
foreach(int i in arguments)
{
sum += i;
}
int average = sum / arguments.Length;
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
To pass Variable Parameters to method use params keyword For example
public int GetAverage (params int[] nums)
{
}
MCAD
|
|
|
|
|
That looks very much like a school asignment. Are you trying to trick other people to do your homework?
---
b { font-weight: normal; }
|
|
|
|