|
Have a look into the csproj file. Entries depending on another have an entry like that:
DependentUpon = "ColoredComboBox.cs"
You can manually add this to correct your problem.
|
|
|
|
|
|
Error "Object not set to instance of object"
|
|
|
|
|
The service System.Windows Form.Design.IEventHandleService already exists in the service Container
|
|
|
|
|
Hi.
How do you force an event to execute from a private void method????
I've tried object.event..... but the event is not accessible like that.
Thanx in advance.
He who laughs last is a bit on the slow side
|
|
|
|
|
For example, if you have a button :
this.button1.Clicked += new EventHandler(button1_Clicked);
private void button1_Clicked(object sender, EventArgs e)
{
MessageBox.Show("Hello World");
}
then you can call your event with :
button1_Clicked(this, EventArgs.Empty);
or
button1.PerformClick();
|
|
|
|
|
Thanx a mil, worked perfectly
He who laughs last is a bit on the slow side
|
|
|
|
|
Good day everyone,
I need to do memory allocation program with 2 functions
1. Allocate the size of memory on the heap
2. Return memory block
Is there anyone know algorithms or sample code?
Pls help, thanks so much.
eric
|
|
|
|
|
The .NET heap doesn't work that way.
You create an object, for instance an array of byte, and the space for the object is allocated on the heap. If you want to treat the data area of the object as a memory area, you have to use the fixed keyword to pin the object at the same address, otherwise the garbage collector may move the object at any time.
Example:
byte[] b = new byte[1000];
unsafe {
fixed (byte* p = b) {
byte* pp = p;
for (int i=0; i<1000; i++) {
*pp++ = 42;
}
}
}
---
b { font-weight: normal; }
-- modified at 9:37 Monday 29th May, 2006
|
|
|
|
|
Thanks so much Guffa
But how to allocate the size of memory on the heap and return the address of memory cell(memalloc(size)) and return memory block (memfree(addr))?
I'm not good at these stuff
Pls help me to solve out.
Thanks
eric
|
|
|
|
|
As I said, the .NET heap doesn't work that way. There are no methods to allocate memory on the heap.
You can create an object that contains the amount of data you need, but you can't safely access it using pointers without using the fixed keywork to pin the object in memory.
Freeing objects in the heap is handled by the garbage collector. When you don't have any references to the object any more, it's up for garbage collection, and will eventually be collected.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks so much
I'll try now
eric
|
|
|
|
|
|
AllocHGlobal allocates unmanaged memory, not memory from the heap as the OP requested.
But then again, not all posters know what they are asking for...
---
b { font-weight: normal; }
|
|
|
|
|
Nitpicking, but the OP did not mention anywhere that he wanted memory from the managed heap
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
its me again.
im still trying to send two commands to command prompt from c#. no luck yet.
the first command needs to change the current directory path to: c:\Program files\progressive projects\progress\reporttemplates
the second command needs to run a batch file inside this directory called fop.bat
my most recent attempt is....
string command=@"\\fop.bat -xml " + "\\ClientReportCard.xml " + "-xsl " + "\\" + Convert.ToString(TempName) + ".xsl " + "-pdf " + Convert.ToString(Salon.Library.GlobalVariables.Reports_Path) + "\\ClientRecordCard.pdf";
ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
// /c switch sends a command
startInfo.Arguments = "/C " + @"cd" + Convert.ToString(TempPath);
// redirect messages to this program
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
//don't execute using shellexecute API
startInfo.UseShellExecute = false;
//Don't open command prompt window
startInfo.CreateNoWindow = false;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(startInfo);
startInfo.Arguments = "/C " + command;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = false;
System.Diagnostics.Process pp = System.Diagnostics.Process.Start(startInfo);
string output = p.StandardOutput.ReadToEnd();
string error = p.StandardError.ReadToEnd();
string output2 = pp.StandardOutput.ReadToEnd();
string error2 = pp.StandardError.ReadToEnd();
p.WaitForExit();
if (output.Length != 0)
shellControl1.WriteText(output);
else if (error.Length != 0)
shellControl1.WriteText(error);
BUT with this it executes the one command and forgets the directory path and then executes the second command. In this way it can't find the batch file. please help. iv been stugling with this on for days now.
He who laughs last...
-- modified at 7:23 Monday 29th May, 2006
|
|
|
|
|
O ja,
Do any of you know how to execute a batch file directly from that file path.
I type (in command prompt)
c:\program files\progressive projects\progress\reporttemplates\fop.bat
I get an error saying:
'c:\program' is not recognized as an internal or external command, operable program or batch file.
if i can find a way to run that command with one shot i'll be fine
Please help.
He who laughs last...
|
|
|
|
|
Put it in double quotes. To see how, simply drag the bat file from Windows Explorer into a command prompt.
|
|
|
|
|
Thank you thank you thank you.
I can't believe i've been strugling with this one for little less than a week.
THANK YOU.......
He who laughs last...
|
|
|
|
|
this code:
Convert.ToDateTime(DateTime.Now.Date.ToString()).ToString("MM/dd/yyyy"+" "+Convert.ToDateTime(DateTime.Now.TimeOfDay.ToString()).ToLongTimeString());
gives this : 05/29/2006 1:39:04 P5 (what is this p5 ???)
i want PM (or AM) at the end not P5 (A5)
how should i edit my code to get PM (or AM) at the end ?
help please.
thanks.
|
|
|
|
|
try following code
Convert.ToDateTime(DateTime.Now.Date.ToString()).ToString("MM/dd/yyyy")+" "+Convert.ToDateTime(DateTime.Now.TimeOfDay.ToString()).ToLongTimeString();
rahul
-- modified at 6:53 Monday 29th May, 2006
|
|
|
|
|
Hi,
i have working with the DirectX live video capturing,
I got DirectX.Capture class from code project its working fine and it give good preview(after when i add legacyAM filter to the graph) but in the Full screen display it will get very poor how can i solve this, if any filters to be add with existing graph to get a good preview.Is here any one faced like this plz help me.
thanks & regards
ranandbe
|
|
|
|
|
hi
I want to be able to do the following:
Type mytype = MethodInfoArray[i].GetParameters()[0].GetType();<br />
mytype[] p = new mytype[5];
Is that possible?
cheers
|
|
|
|
|
You are looking for Array.CreateInstance[^]. You can use it like
Type mytype = MethodInfoArray[i].GetParameters()[0].GetType();
Array a = Array.CreateInstance(myType, 5);
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thank you ... that worked great ... but I should hae explained
The bacis problem I have is this:
Type requiredtype = getType();<br />
Object[] datafrominputs = getData();<br />
MethodInfoArray.Invoke(new Object(),new Object[]{datafrominputs});
Basically the method will take a single array as its parameter, but I need to be able to convert may Object array to the right type. What should I do?
cheers
-- modified at 7:30 Monday 29th May, 2006
|
|
|
|