|
Sorry... WPF is only for powering presentation layer of biz apps... not "motogp" type games
You should rather choose an existing game engine... that in turn depends on the type of games you wanna write... for instance, for FPS games you might wanna use Unreal engine or Quake3 engine.
Read this article to know more!
http://en.wikipedia.org/wiki/Game_engine[^]
Usually these engines take care of rendering the texture and adding effects and to some extent, the AI coding also. But for defining your own texture, you might either use a software (like Maya) but for most scenarios, you can search for textures online and use them in your game.
|
|
|
|
|
Hi
I am using Visual Studion 2005 and C# to create a Windows application.
I used the designer to bind a DataGridView to a MS Access database using a BindingSource. In the designer the correct column headers are displayed now on the DataGridView. When I run the application the correct column headers are still displayed, but there is no data displayed. When I preview the data on the smart tag of the DataGridView within the designer it shows me that there is data in the relevant table inthe database.
When I have the DataGridView directly on the Windows Form then it displays the data, but I would like the DataGridView on a UserControl that I then add to the Form at runtime. On the UserControl the DataGridView does not display the data.
Any ideas?
Thanks.
Kobus
modified on Thursday, October 16, 2008 3:30 AM
|
|
|
|
|
Why don't you post the runtime code that you used?
Anyway, did you call the DataBind() method on the grid view
this.[gridViewName].DataSource = [dataSourceName];
this.[gridViewName].DataBind();
|
|
|
|
|
what do you got there? meaning code!!!
DataGridView is a gentleman, accepts allmost everthing, doesn´t need a 100% fit dataset.
Try to put DGV inside the form (not inside usercontrol) just to check if is about delegates, if doesn´t works either your code is wrong
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
"Allow Service to interact with Desktop" in Services property.
How can i set this property programmatically.
Thanks ........
|
|
|
|
|
Setting this property at all is not generally advisable. Services aren't meant to provide UI or allow any other type of user interaction.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
You should ask yourself if you should be doing this. The reason I used this code was I had a windows service that logged into a DB2 database via an ODBC driver. They routinely changed their passwords and sometimes would forget to tell us. When we tried to login in after a password had been changed the ODBC driver would pop up (attempt to pop up) a dialog allowing you to enter the new password which of course never showed up as it didn't have permissions. We didn't realize any problem until the client called telling us that they hadn't received any new data.
Anyways the following code worked for me.
Reference System.Management
protected override void OnStart(string[] args)
{
ServiceDesktopPermission();
}
static public void ServiceDesktopPermission()
{
try
{
ConnectionOptions coOptions = new ConnectionOptions();
coOptions.Impersonation = ImpersonationLevel.Impersonate;
ManagementScope mgmtScope = new ManagementScope(@"root\CIMV2", coOptions);
mgmtScope.Connect();
ManagementObject wmiService;
wmiService = new ManagementObject("Win32_Service.Name='" + "My Service Name" + "'");
ManagementBaseObject InParam = wmiService.GetMethodParameters("Change");
InParam["DesktopInteract"] = true;
wmiService.InvokeMethod("Change", InParam, null);
}
catch(Exception ex)
{
}
}
|
|
|
|
|
it worked for me; thanks a lot
|
|
|
|
|
Excellent, thank you. Just what I was looking for. I only have one suggestion: do it in the service installer after service installation is completed, before the service starts up. This way the first time the service starts, it's already able to interract with the desktop:
private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
{
ServiceDesktopPermission();
var controller = new ServiceController("SERVICE_NAME");
controller.Start();
}
|
|
|
|
|
Try this C# code
href="http://it.expertmonster.com/question/Allow-service-to-interact-with-desktop-112.html
|
|
|
|
|
Hi
I am trying to modify class instance members using reflection. I am having problem when trying to add/remove/display elements related to List<int> member.
Following is the code.
[CODE]
class TestClass
{
public int i = 0;
public int IValue
{
get
{
return i;
}
set
{
i = value;
}
}
public List<int> m_intList = new List<int>();
}
class Program
{
static void Main(string[] args)
{
TestClass tcObject = new TestClass();
tcObject.i = 1;
tcObject.m_intList.Add(1);
tcObject.m_intList.Add(2);
{
FieldInfo fieldInfo = tcObject.GetType().
GetField(
"i",
BindingFlags.Static |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public);
fieldInfo.SetValue(tcObject, 2);
System.Console.WriteLine("I value '{0}'", fieldInfo.GetValue(tcObject));
}
{
PropertyInfo propertyInfo = tcObject.GetType().
GetProperty(
"IValue",
BindingFlags.Static |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public);
MethodInfo propertySetMethodInfo =
propertyInfo.GetSetMethod(true);
propertySetMethodInfo.Invoke(tcObject, new Object[] { 3 });
System.Console.WriteLine("Property IValue '{0}'", tcObject.i);
}
{
FieldInfo fieldInfo = tcObject.GetType().
GetField(
"m_intList",
BindingFlags.Static |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public);
foreach (int intItem in tcObject.m_intList)
{
System.Console.WriteLine("List Item value '{0}'", intItem);
}
}
}
}
</string></int></int></int> [/CODE]
Thanks
Chandra
modified on Thursday, October 16, 2008 1:55 AM
|
|
|
|
|
I don't want to lower your morale but I've been trying some time ago a similar thing to do and I had to abandon the idea because it get's very problematic when you are trying to generalize the issue. The main idea is, if you don't know the 'assembly type', you don't have a chance...
|
|
|
|
|
What do you mean by 'assembly type'. The assembly is .NET assembly written in C#.
|
|
|
|
|
At compile time I do not know whether the type is List<int> or List<string>. At runtime I should interpret it from the fieldInfo.FieldType.
|
|
|
|
|
I even tried the following code
MethodInfo addMethodInfo = fieldInfo.FieldType.GetMethod("Add");
object[] intValue = { 5 };
addMethodInfo.Invoke(tcObject, new Object[] { 5 });
But the above code gives me error "Unhandled Exception: System.Reflection.TargetException: Object does not match target type." when executing the "invoke"
|
|
|
|
|
Ok, forget 'assembly', if you don't know an Object type, you can't construct it... Hope somebody will have a solution for you problem, I'm just saying what I was trying to do and always came back to the same problem...
|
|
|
|
|
Hello everyone, thanks for your help. I was able to find the solution for my requirement. Following is the code
class ListElement
{
public ListElement()
{
m_element = 0;
}
public ListElement(int element)
{
m_element = 1;
}
public int m_element;
}
class TestClass
{
public int i = 0;
public int IValue
{
get
{
return i;
}
set
{
i = value;
}
}
public List<int> m_intList = new List<int>();
public List<listelement> m_lstElement = new List<listelement>();
}
class Program
{
static void Main(string[] args)
{
TestClass tcObject = new TestClass();
tcObject.i = 1;
tcObject.m_intList.Add(1);
tcObject.m_intList.Add(2);
tcObject.m_lstElement.Add(new ListElement(1));
{
FieldInfo fieldInfo = tcObject.GetType().
GetField(
"i",
BindingFlags.Static |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public);
fieldInfo.SetValue(tcObject, 2);
System.Console.WriteLine("I value '{0}'", fieldInfo.GetValue(tcObject));
}
{
PropertyInfo propertyInfo = tcObject.GetType().
GetProperty(
"IValue",
BindingFlags.Static |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public);
MethodInfo propertySetMethodInfo =
propertyInfo.GetSetMethod(true);
propertySetMethodInfo.Invoke(tcObject, new Object[] { 3 });
System.Console.WriteLine("Property IValue '{0}'", tcObject.i);
}
{
FieldInfo fieldInfo = tcObject.GetType().
GetField(
"m_intList",
BindingFlags.Static |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public);
MemberInfo[] listMemberInfoArray = tcObject.GetType().GetMember("m_intList");
MemberInfo listMemberInfo = listMemberInfoArray[0];
MethodInfo addMethodInfo = fieldInfo.FieldType.GetMethod("Add");
object[] elementValue = { 5 };
addMethodInfo.Invoke(fieldInfo.GetValue(tcObject), elementValue);
foreach(int currElement in tcObject.m_intList)
{
System.Console.WriteLine("INt List element {0}", currElement);
}
Console.WriteLine();
}
{
FieldInfo fieldInfo = tcObject.GetType().
GetField(
"m_lstElement",
BindingFlags.Static |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public);
MethodInfo addMethodInfo = fieldInfo.FieldType.GetMethod("Add");
Object listElementObject = Activator.CreateInstance(fieldInfo.
FieldType.
GetGenericArguments()[0]);
FieldInfo listElementFieldInfo = listElementObject.GetType().
GetField(
"m_element",
BindingFlags.Static |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public);
listElementFieldInfo.SetValue(listElementObject, 2);
object[] elementValue = { listElementObject };
addMethodInfo.Invoke(fieldInfo.GetValue(tcObject), elementValue);
foreach (ListElement currListElement in tcObject.m_lstElement)
{
System.Console.WriteLine("List Item value '{0}'", currListElement.m_element);
}
}
}
}
</listelement></listelement></int></int>
|
|
|
|
|
mates,
I have a project solution file but when i open it in microsoft visual studio 2005, format version 9.00, it doesn't open. i search already in google but does not solve my problem. some results are due to version problem, such as microsoft visual studio 2005 open in microsoft visual studio 2008. but my problem is even i open it in visual 2005 it still not open. could someone help my problem, i'm stuck on this. thanks in advance.
C# Coudou
Microsoft End User
2000-2008
******************************
The best things in life are free
******************************
|
|
|
|
|
Seems rather obvious to me. You are trying to open a VS2008 (ver 9) file with vs2005 (ver 8). Why not get VS2008 express.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
no.i'm trying to open vs2005(ver9) in vs2005(ver9).
there is no vs2008(ver9), i think so.
C# Coudou
Microsoft End User
2000-2008
******************************
The best things in life are free
******************************
|
|
|
|
|
ver 9 is VS 2008
Open up VS, go to help | about and you will see the version, in 2005 it is 8.#######.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This is what i mean, open a solution file in a notepad and you can see the version.
=========================
solution file for vs2005
-----------------------------------------------------------------------------
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Squawk", "Squawk\Squawk.vbproj", "{AF4879E7-ED61-4247-A0A3-46A4D14B536D}"
EndProject
=========================
solution file for vs2008
-----------------------------------------------------------------------------
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ProjectConverter", "ProjectConverter.vbproj", "{B637ACFD-0AFC-4FBB-A8C0-602B5ABA62F0}"
EndProject
* My problem is every time I double click my solution file it will not open eventhough it is in vs2005.
C# Coudou
Microsoft End User
2000-2008
******************************
The best things in life are free
******************************
|
|
|
|
|
Interesting, I looked at the VS IDE, not the solution file. The IDE version is 8 and 9, not 10.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Take a look at my response here[^].
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Subtle but confusing difference. The Microsoft Visual Studio Solution File, Format Version 10.00 line does not indentify the version of Visual Studio but rather the version of the solution file itself. The version of Visual Studio is identified by the next line (# Visual Studio 2008 .
Visual Studio 2008 is actually Visual Studio version 9 but uses a solution file format of 10.00. Likewise, Visual Studio 2005 is actually Visual Studio version 8 but uses a solution file format of 9.00.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|