|
Hi, my first post here
I'm very new to C# but am familiar with C++. I'm wanting to make a very simple game that will have an XY grid (2d array), and I need it's graphical representation, I also want the "display" to detect where (according to the displayed grid) the mouse was clicked and put a dot on the nearest grid lines intersection (I think the array will be updated first according to the click position, and from there the visual version of it).
I was looking for relevant tutorials, but havn't found anything that resembles to what I'm looking for. Would appriciate a point in the right direction, thanx
|
|
|
|
|
Hi,
here are some basic concepts:
- Windows apps are event driven
- there are several Mouse events, such as MouseDown
- all painting should occur in the Paint handler
if any of these sound unfamiliar, you need to work your way through a book
on C#, then have a look at some of the CodeProject articles, maybe from the
C# games section (I did one on Sokoban).
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
In the MouseDown event on the control, form, or whatever get the XY of the cursor.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I develop smart client application,that I need to export Microsoft local report to word format!
But already known that when developing application with win forms we use reportviewer but the reportviewer exports only image,excel and pdf formats!...so I need to export as word..
Heeeeellllp!
|
|
|
|
|
Have you started this task, if so, where are you having problems at? What SPECIFIC questions do you have?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
How to Build an independent 3 Tier Architecture,where i can change my Data Access Layer with out affecting Business logic layer
|
|
|
|
|
well gee, thats a great (and interesting) question but unfortunately its impossible to answer with a single forum post. We tend to answer questions about a specific piece of code in this particular forum.
You might try searching google for the exact keywords you used for the title of this (well named) thread.
Sorry I couldn't be more help.
Well wadda you know it is possible to answer these politely. live and learn.
|
|
|
|
|
J4amieC wrote: it is possible to answer these politely
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
The people in the lounge said I should google for the answer to a programming question but I do not know what search engine to use
|
|
|
|
|
Hi all,
i have developed a windows application where in i have to get the types defined in the assembly.But after loading the file and when i write
GetTypes(),
i get a error {"Could not load file or assembly or one of its dependencies. The system cannot find the file specified.} that i captured using LoaderException.
i tried searching out but didnt get any idea what exactly is happening.Plz somebody help me out,as i am badly in need of solution.
Thanks in advance.
Swarup
|
|
|
|
|
I helped someone with the same problem yesterday. First he pointed to a location other than where the dll was, and then he forgot to copy all the dependencies together with the dll. Maybe start by checking whether the dll exists in the given path and whether it can access all of its dependencies.
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
Can anybody help me how to display messageboxes with in the client region insted of displaying them at the default centre location on the screen area.
Any help will be greatly appreciated
|
|
|
|
|
|
hello,
I am beginner in c#. in fact I would like to write a program which reads a file CSV and transfert in a table with 2 dimensions.
the CSV file is like:
100;SG;
111;SAS;
112;HR FT HU ;
.
.
.
and i would like to have a table like this
telephon user
110 SG
111 SAS
112 HR FT HU
.
.
.
can you please help me
thanks
|
|
|
|
|
Try string.split() to get the values out of each line.
If you need more help, please specify where that table should be drawn. (console, gui...)
|
|
|
|
|
Why are you using a semi-colon in a CSV(comma seperated values) file as your delimiter?
Oh yeah, you will want to use a StreamReader .
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I have writen a simple program that calculates Pi to n number of digits. I have created a server that has it bound on a socket and then a client that calls it.
When I run up 6 or 7 clients only 4 requests are handled at once, about half the time 5 requests are handled at once and very very occassionly 6. The rest of the calls to CalculatePi are qued and are only processed once a slot frees up. Occasionally after the server has been running awhile it does more ie. it started only doing 4 then it starts doing 5.
Is there some limit to the number of remote calls I can make at once?
Why is it not a set number?
Can I change it?
I've added the decleration code below incase it's something I've done wrong there.
<br />
string strLocation = "tcp://localhost:65100/theEndPoint";<br />
TcpChannel chan = new TcpChannel(0);<br />
ChannelServices.RegisterChannel(chan);<br />
<br />
MarshalByRefObject obj =<br />
(MarshalByRefObject)RemotingServices.Connect<br />
(typeof(CalcPiNS.CalcPi),<br />
strLocation);<br />
<br />
<br />
<br />
TcpChannel chan = new TcpChannel(intPort);<br />
ChannelServices.RegisterChannel(chan);<br />
<br />
Type calcType =<br />
Type.GetType("CalcPiWinServerNS.CalcPiServer");<br />
<br />
CalcPiServer rmCalcPiServer = new CalcPiServer();<br />
ObjRef refCalcPiServer = RemotingServices.Marshal(rmCalcPiServer, "theEndPoint");<br />
|
|
|
|
|
remote object can be fixed in to ways
see these two topics on net
single call(stateless)
singleton(state full only once object can be created and other requests are kept in queue )
|
|
|
|
|
Using the method I have show how do I chose between singlecall and singleton?
Also if this is the case and it's because I am using singleton why do I gat 4/5/6 concurrent already?
|
|
|
|
|
Singleton: When the remote object is set to singleton it means that it will be available to all calling clients. The singleton object is instantiated at the first call of a method (from any client.) When other clients access it, they will be accessing the instance that the first client instantiated. This means that if the first call set a variable myNumber to 10, other clients connecting to the remote object would be able to read that value as well. It basically means that the remote object is shared among all clients.
SingleCall: In this configuration, the remote object is instantiated only for the duration of the method call. If a client is calling a specific method on an object, the object exists only during the execution of the method. Once the method returns, the object is destroyed. Clients cannot share the same remote object in this case.
Example: Suppose you have a remote object myObject . Suppose this object has 2 methods, one called Add that will add 2 numbers and place the result in a global variable myResult of myObject , and one called RetrieveResult that returns myResult .
public void Add(int a, int b)
{
myResult = a + b;
}
public int RetrieveResult()
{
return myResult;
}
In Singleton mode:
Client 1 calls myObject.Add(1,1) . In this case, myResult is 2.
Client 2 calls RetrieveResult() . The returned value will be 2.
In SingleCall mode:
Client 1 calls myObject.Add(1,1) . In this case, myResult is 2.
Client 2 calls RetrieveResult() . The returned value is 0 because the call of RetrieveResult created a new remote object.
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Yes but none of this is answering my question about the erractic behaviour of the number of instances. Nor did you answer the question of how I chose between single call and singleton using the method I showed in my code.
|
|
|
|
|
Hello,
I added "Exceptions.resx" to my project to provide some user defined exception.
In one of C# class of same namespace i am doing
"ResourceManager rm = new ResourceManager("Exceptions", Assembly.GetExecutingAssembly());"
Now if i do
"string str = rm.GetString(key);" , it gives exception by saying
"Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Exceptions.resources" was correctly embedded or linked into assembly "GlobalLayer" at compile time, or that all......."
What else should i do to solve this problem.
Gajesh
|
|
|
|
|
Hi fellas. I am trying to do a simple registration system with MS Access.
Currently I am using Access 2003, along with C# is VS.NET 2003.
The thing is, whenever I am executing the database connections part, I get this error:
The Microsoft Jet database engine cannot open the file 'C:\SamsTestData\Member.mdb'. It is already opened exclusively by another user, or you need permission to view its data. <br />
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br />
<br />
Exception Details: System.Data.OleDb.OleDbException: The Microsoft Jet database engine cannot open the file 'C:\SamsTestData\Member.mdb'. It is already opened exclusively by another user, or you need permission to view its data.<br />
I have absolutely no idea what is going on. I tried googling the web, however I am clueless, as well as where I should start. I am guessing I have to tinker with some settings, but where???
Anyway help would be greatly, greatly appreciated! THANKS!!!
|
|
|
|
|
A few clues:
1) Is the MDB open in Microsoft Access IDE, typically any table in its design view? If yes, then preferably close them.
2) http://support.microsoft.com/kb/174943[^]
3) Is MDB Path writeable by ASP.NET?
|
|
|
|
|
Thanks for your swift reply. I have closed the MS Access application when executing the page. I guess that is good enough?
I did went to the link you provided before I asked for help in here. However I just baffled by the terminology that's in there.
How do you determine whether the MDB path is writable in ASP.NET? Is the settings set in Access, VS.NET 2003, or from the Internet Information Services in the Administrative Tools of the Control Panel?
Thanks a bunch and looking forward to your reply!
|
|
|
|
|
do u have the Database already opened somewhere??
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|