|
You could pass form2 a reference to form1, and then form2 could simply call components() like it would for any other classes' method. Another approach(and possibly cleaner) would be for form2 to fire an event that form1 is registered to listen to, and then in form1's event handler it could call components().
|
|
|
|
|
i am new in the field of game programming , and i decided to use .NET as my platform and C# as my programming language and managed directx9 as my graphics library.
now i need help to find out many resources about this field and under previous considrations , if u can help me please answer me how to find a good resources.
secondly i am wondering is there any tool on earth that can generate the managed directx 9 code , so the devloper can concentrate in the bussnes logic.
thx all
|
|
|
|
|
|
|
Keep in mind that there are no commercial games written in C# for a reason. But by all means, it's as good a place to start as any.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
No comercial games?
try what about?: http://arenawars.krawall.de/eng/
And the only reasons not many comecial games are written in C# is:
1) the VAST majority of games dev tallent is in C++ ...any move over to C# is going to be a slow process as a games dev's time is strongly dictated by deadlines so time out to learn C# is not easy to come by.
2) The prodution cycle for most games is longer than Managaed DX has been a viable alternative for so no wounder they're arn't many commerical games in C# about :?
There is no reason commercial games can not be made in C# with managed DX9 unless you really need to hit up as much power as is possible (that 2% you loose from using managed code) and you are able to use unmanaged code to squeeze it out of a system.... but not every game (or even, every 10th game) needs that raw power and if im not mistaken there is a 3D engine written in C# that belts along faster than its C++ coded version (cant remember the name check out gamedev.net for info).
So to the OP dont abandon C# for games devving, you will get results much faster than a simular project in C++ and it will help keep motivation up ... and no one will be able to tell any difference between your games and games written C++... accept your games will be finished long before the same thing could be coded in C++.
As a non-pro, C#'s managed nature will help you avoid many a pitfall you could stumble in C++ that could cause slowdown or performance issues... so from an amatures point of view you will probably find your games run better if written in c# than they would if you wrote them in c++ as C# will be handling a lot of the stuff that may cause problems for you.
read around, get oppinions from games dev sites, C# is as viable as C++ right now and there is no reason to be struggling with C++ when C# is sutch a cake walk to code.... Ok you wont get a professional games dev' job right now with C# right now but i saw UbiSoft advertising for .Net coders to write games development tools earlier this year, so its only a matter of time before more games dev' houses take up C#.
|
|
|
|
|
hi all
i am looking for a tool that can help mt to convert solutions that written
in VB.NET to C#.NET , and from Visual C++ to C#.NET
is there any thing on earth that can do this ?
thx
|
|
|
|
|
It's called hard work.
VB.NET > C# might be possible to automate. If you are talking about unmanaged C++ > C#, then you've just got to pick through the code line by line doing a rewrite. Im currently porting a bunch of 2d physics stuff from C++ to C# and it isnt really all that hard.
|
|
|
|
|
If you are realy into Copy&Past you can use Lutz Röders Reflector.
This tool is able to read binary Assemblies and decompile them into IL.
This IL can then be converted to C#, VB or Delphi code.
But you can only convert method by method and all comments will be lost.
For small classes this should work. For bigger projects it might be not the right choice.
/cadi
24 hours is not enough
|
|
|
|
|
Instant C# converts VB.NET projects, snippets, and asp.net pages from VB.NET to C# (free demo at www.instantcsharp.com).
David Anton
Tangible Software Solutions
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# Converter and the Instant VB C# to VB.NET Converter
|
|
|
|
|
Hi,
I'm trying to get some text that I copy to the clipboard to stay there after my application has closed. At the moment I can paste from clipboard while my application is open, but after it closes the clipboard is empty.
Code:
**START APPLICATION**
Clipboard.SetDataObject("Sample Text");
**CLOSE APPLICATION**
|
|
|
|
|
Clipboard.SetDataObject("Sample Data", true);
// True maintains copy after appln exits.
|
|
|
|
|
Hello!
In C++ one could indent listview items very easily: lvi.iIndent = 1. Now, how can we do the same in C#?
I've read something about ListViewItem.IndentCount and ListViewItem.NumIndents properties, but my compiler (latest SharpDevelop IDE) doesn't know these members... All other things work quite nicely (lvi.ImageIndex, lvi.SubItems.etc.).
Maybe any workaround idea?
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hi!
The .NET ListView or ListViewItem doesn't have anything like this built-in.
But, because it's merely a wrapper around the Win32 ListView control, you can achieve these effects by using P/invoke to send the corresponding LVM_* messages to the ListView.
Regards,
mav
|
|
|
|
|
Hello I'm developing Guest book For web I'm using C#.net for this project but I have problem
I'm Storing data in a xml file My web path variable is : string webpath="../omur/Ziyaretciler.xml" but returned me this error message:
Could not find a part of the
path "C:\windows\Omur\Ziyaretciler.xml".
how do I develope for this problem?
Heeellppp..
Ahmed Erarslan
MCAD,MCDBA,MCP
MCSD.NET
|
|
|
|
|
Hi every body , from day i have a problem that i can't solve , how i can pass a STRING variable by using a matlab program dll .
The document 1,2,3 ways offer just a double variable
Plz i need it ,
thx
|
|
|
|
|
Type type = Type.GetType("System.Int32");
object result = null;
//****************
result = type.GetMethod("Parse").Invoke(null,BindingFlags.Static | BindingFlags.Public,null,new object[]{"7"},null); //where is wrong???
//****************
Console.WriteLine(result.ToString());
thank you!
|
|
|
|
|
System.Int32.Parse hase more than one overload.
So you have to define which of the overloads you need.
You do so by specifying the parameters in the GetMethod of the Type .
result = type.GetMethod("Parse", new Type[]{typeof(string)}).Invoke(null,BindingFlags.Static | BindingFlags.Public,null,new object[]{"7"},null); //this is correct
/cadi
24 hours is not enough
|
|
|
|
|
thank you very much!OK
|
|
|
|
|
Hi, I've a Windows form on which i've multiple rows & column having radio buttons....At the run time i want all the radio buttons in a column to be checked by default......If anyone got idea plz help me....
E.g
Brand RadioButton RadioButton RadioButton RadioButton
Type RadioButton RadioButton RadioButton RadioButton
Category RadioButton RadioButton RadioButton RadioButton
So here i want at the run timethat all the radiobuttons in one of the column is selected by default
|
|
|
|
|
Hello all,
I have typical problem as following.
I have user control (grid contorl)developed in vc++ and compiled version is in .lib file.
Same control i want to use in c#.
As we cant call .lib file or have reference of .lib in .net project, we have to write some intermediate code /wrapper class.
Do i need to convert first .lib file into dll in vc++?
If yes the control is a class not just a group of function.Is it possible?
so how to write it.I am not a vc guy.
Is there any approch hwo to go about it?Can you step by step information.
it will be great if i get reply soon..i m really stuck here...
thanks and regards,
Urvish
|
|
|
|
|
The only way i know is to create an ActiveX wrapper class in C++.
You could then use this control via COMInterop.
But since you said you are no C++ guy i would suggest you look for some GridControl implemented in .NET.
Search CodeProject for GridControl, there are some on this site.
/cadi
24 hours is not enough
|
|
|
|
|
I am using MCMS 2002 the problem i m facing is with cookies.
The cookies I am using losts its value after accessing it. THe code I am using is as
1) MCMS is installed on Windows XP.
2) Piece of code to set the cookie.
HttpCookie objCookie = new HttpCookie("LanguagePreference");
Response.Cookies.Clear();
Response.Cookies.Add(objCookie);
objCookie.Values.Add("LanguagePreference","En");
Response.Cookies["LanguagePreference"].Expires = DateTime.Now.AddDays(15);
3) Piece of code to get the cookie back.
a) cookieValue = Request.Cookies["LanguagePreference"].Value
or
b) cookieValue = Response.Cookies["LanguagePreference"].Value
Problem Statement ::
1) Cookie set Successfully using code in step 2.
2) Now if I try to get this cookie back using code at line 3(a) [in Request object] then I get it for first time & then that cookie is deleted automatically.
3) When I try to get this cookie back using code at line 3(b) [in Response object] then that cookie is deleted automatically immediately.
Any Solutions ?
Pushpesh Pandey
pinchu636595@yahoo.co.in
|
|
|
|
|
Hi,
Here is the program for displaying simple text in excel using late binding.
It checks at run time.This program works on all the version of Excel.
I want to modfify this program.
Can anybody help me to do that.
I want to display All the rows and coulmns of Emp table
This is very easy with early binding. I want to do that with late binding
here is code
Write this code inside button click event pls anybody modify I want to display table conntents Excel using late binding
----------------------------------------
object objApp_Late;
object objBook_Late;
object objBooks_Late;
object objSheets_Late;
object objSheet_Late;
object objRange_Late;
object[] Parameters;
int intExcelPID;
try
{
// Get the class type and instantiate Excel.
Type objClassType;
objClassType = Type.GetTypeFromProgID("Excel.Application");
objApp_Late = Activator.CreateInstance(objClassType);
Process[] aProcesses=Process.GetProcessesByName("Excel");
// please remove the string variable
string strProc="These are the processes running \n";
for (int i = 0; i <= aProcesses.GetUpperBound(0); i++)
{
intExcelPID = aProcesses[i].Id;
strProc+=intExcelPID.ToString()+ " ";
}
//Get the workbooks collection.
objBooks_Late = objApp_Late.GetType().InvokeMember( "Workbooks",
BindingFlags.GetProperty, null, objApp_Late, null );
//Add a new workbook.
objBook_Late = objBooks_Late.GetType().InvokeMember( "Add",
BindingFlags.InvokeMethod, null, objBooks_Late, null );
//Get the worksheets collection.
objSheets_Late = objBook_Late.GetType().InvokeMember( "Worksheets",
BindingFlags.GetProperty, null, objBook_Late, null );
//Get the first worksheet.
Parameters = new Object[1];
Parameters[0] = 1;
objSheet_Late = objSheets_Late.GetType().InvokeMember( "Item",
BindingFlags.GetProperty, null, objSheets_Late, Parameters );
//Get a range object that contains cell A1.
Parameters = new Object[2];
Parameters[0] = "A1";
Parameters[1] = Missing.Value;
objRange_Late = objSheet_Late.GetType().InvokeMember( "Range",
BindingFlags.GetProperty, null, objSheet_Late, Parameters );
//Write "Hello, World!" in cell A1.
Parameters = new Object[1];
Parameters[0] = "Hello, World!";
objRange_Late.GetType().InvokeMember( "Value", BindingFlags.SetProperty,
null, objRange_Late, Parameters );
//Return control of Excel to the user.
Parameters = new Object[1];
Parameters[0] = true;
objApp_Late.GetType().InvokeMember( "Visible", BindingFlags.SetProperty,
null, objApp_Late, Parameters );
objApp_Late.GetType().InvokeMember( "UserControl", BindingFlags.SetProperty,
null, objApp_Late, Parameters );
Parameters = new Object[1];
Parameters[0] = "Test2.xls";
objBook_Late.GetType().InvokeMember( "SaveAs", BindingFlags.InvokeMethod, null, objBook_Late, Parameters );
Parameters = new Object[1];
Parameters[0] = "Test2.xls";
objBook_Late.GetType().InvokeMember( "Close", BindingFlags.InvokeMethod, null, objBook_Late, Parameters );
// Check if the array of "EXCEL" processes exists
if (aProcesses.Length > 0)
{
// The last excel process is the orphaned process which is killed
aProcesses[aProcesses.Length-1].Kill();
}
}
catch( Exception theException )
{
String errorMessage;
errorMessage = "Error: ";
errorMessage = String.Concat( errorMessage, theException.Message );
errorMessage = String.Concat( errorMessage, " Line: " );
errorMessage = String.Concat( errorMessage, theException.Source );
MessageBox.Show( errorMessage, "Error" );
}
Any clue
regards
sanjeev
|
|
|
|
|
When I xml serialize a file, I want all the empty node should not appear. e.g.
The below mentioned xml serialized file has empty region node.
<Application>
<Name>abc</Name>
<Region/>
<Application>
I want empty node should not appear in xml serialized file.
<Application>
<Name>abc</Name>
<Application>
I appreciate, if anyone has any solutions or suggestions to this, please share their knowledge.
Regards,
Shiby
|
|
|
|
|