PlausiblyDamp
Administrators-
Posts
7016 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by PlausiblyDamp
-
If anything it is probably Access itself that doesn't support stored procedures.
-
Just to add that if you are looking at following the MS .Net coding standards then FxCop is a tool you really should be using. I also agree with mskeel that I would need a very strong argument to use a convention different to the existing framework one, why should I have to remember two sets of naming schemes, parameter passing conventions, error handling mechanisms, event / delegate conventions?
-
Theory on creating an EOB like graphical engine
PlausiblyDamp replied to EFileTahi-A's topic in Graphics and Multimedia
If you are using an EoB style engine where everything is done as a grid with no inbetween steps and 90 degree turns then all scaling values will be fixed as will all other transformations. Also depending on what technology you are using to draw to the screen this functionality may be provided for you. -
http://www.xtremedotnettalk.com/showthread.php?t=49597 is probably a good starting point for you. You are correct about interfaces being the way to go though ;) Also the loading mechanism in the linked article is only one way of doing this - you could also provide a more config file based approach to discovering and loading the dlls.
-
Theory on creating an EOB like graphical engine
PlausiblyDamp replied to EFileTahi-A's topic in Graphics and Multimedia
It would be far more effective in terms of storage and design time effort to create a single tile for each type and at runtime scale / rotate it to the correct size and angle. Rather than store the details (skeleton, torch, chains etc) on a given tile they could be created as separate images and overlayed on the tiles at runtime. -
1. I tend to avoid commenting what a variable is i.e. public static Device dxDevice1 = null; //Draws on pnl_map I would tend to give a more descriptive name to the variable 2. No real opinion, I tend to use regions to group related functions / interfaces etc rather than individual methods. 3 + 4. Personally I tend to avoid hungarian naming as a decent compiler / editor will give you the type information and detect and mismatches for you. If you code data type information into a variable that is just another thing that needs to be kept in sync with the code - the number of times I've seen VB code (mainly VB6 but the idea is the same) where variables declared like iOrderNumber weren't integers but longs - they were probably an integer originally but the declaration got updated to a new data type and the variable was never renamed for fear of breaking the code... If the variables have a meaningful name regardless of length then I'm happy. I personally would have written the above class definition similar to public class Engine { public static Device MapPanelDevice = null; public static Device SelectedPanelDevice = null; public static Device GraphicsPanelDevice = null; public static Texture tempTexture; public static string LayerText = "BOTTOM LAYER"; //Default layer text to be shown public static object TextColour = Color.FromArgb(0,255,0); public static object TextShadowColour= Color.Black; public const int DefaultScreenWidth = 1024; public const int DefaultScreenHeight = 768; //would use a point public Point SelectedTilePosition; //rather than two variables //public static int iGMapXPos = 0; //Stores the X pos of the current selected tile in the Graphics panel //public static int iGMapYPos = 0; //Stores the y pos of the current selected tile in the Graphics panel //not sure of the following line so I left it alone public static string[,] sArrGraphicsPanel = new string[1000,1000]; //private Texture spriteTexture; //not sure of the following line so left it alone public static Texture texDX2; public static Texture[] DeleteTile= new Texture[5]; public static Texture[] RegisterTile = new Texture[5]; I did have to guess at some of the variable usage but you should get the general idea, I would also have tended to wrap the variables inside properties rather than leaving them public but that's another issue entirely.
-
What language is that written in> I guessed at C# but as it doesn't compile I've no idea what you are trying to do or what the problem you are experiencing might be...
-
Try something like "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Analiza.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
-
Using a simple format like a zip file will allow you to replace / edit assets easily. A custom binary file will require the entire .pak (or whatever you call it) to be rebuilt and repacked everytime something changes. If users modifying the files is an issue you could always encrypt the assests or simply password the zip itself.
-
If this is a windows application then just add a OpenFileDialog control to the form and from your code just call it's .ShowDialog method, once the user has selected a file you can retreive it's name via it's .FileName property.
-
Only mods and admins can post there, if you have something you think should be in there just post it in the most appropriate place and it will get moved if we think it belongs in either the code library / tutors corner.
-
Does the messagebox give any other message / detail other than what you poosted above? If you try to step through the code (if possible) does it fail on a particular line?
-
You could always use a zip file without compression if speed is an issue, also using something like #zipLib will allow you to read data direct from the zip file.
-
Often a .pak file or .wad or whatever is just a way to store related files together. If you have no particular format requirement then you may as well just use a zip file or similar.
-
You could also use DateTime.Parse() or DateTime.ParseExact() to try the conversion rather than relying on a TypeDescriptor.GetConverter.
-
Could you attach the project - or at least a simple example that demonstrates this behaviour? Also if you open the file that declares the frmNew class - does it contain any explicit namespace declarations?
-
something like System.Collections.Hashtable h = new Hashtable(); //add stuff in h.Add("test", new Bitmap(1000,1000)); //to dispose foreach (object o in h.Values) { IDisposable d = o as IDisposable; if (d != null) d.Dispose(); } should do it
-
You will need to dispose of the bitmaps in the hashtable, not the hashtable itself.
-
What is the value of mintTblWaitingListId when you are calling this? Also what does the code for spWaitingList look like? Also have you tried setting the direction before assigning a value?
-
Why can I not get hashing to work
PlausiblyDamp replied to cpopham's topic in Directory / File IO / Registry
What version of .Net are you using as the line myStream.Write(myFileMain, 0, myFileMain.Length) will not compile under VS 2003 as the first parameter should be a byte aray not a stream. Also IIRC you do not need to allocate a size when you declare the memorystream im myStream As New MemoryStream(myFileMain.Length) plus I think you are allocating one byte too many here as the memory stream is zero based but the string's Length property is one based. Also as you read through the code you seem to be doing a lot of string -> byte conversions and then use encoder.GetString() on the bytes to do a byte->string conversion, it is probably easier to either use the byte arrays or use strings rather than converting back and fore between them. -
Could you give a bit more detail about the problems you are having? Or even post the relevant code.
-
If you are running this through a proxy server a 502 error could be caused by the proxy configuration. Alternatively it can indicate a bad gateway between you and the server.
-
Easiest option is probably the System.Net.WebClient class as it provides a simple DownloadData method that will return a URL as a byte array, this can easily be turned into a string via a StreamReader object or one of the classes under System.Text Dim x As New System.Net.WebClient() Dim b() As Byte = x.DownloadData("http://www.microsoft.com") Dim ms As New System.IO.MemoryStream(b) Dim sr As New IO.StreamReader(ms) Dim s As String = sr.ReadToEnd MessageBox.Show(s)
-
Theory on creating an EOB like graphical engine
PlausiblyDamp replied to EFileTahi-A's topic in Graphics and Multimedia
For each grid square you would need to store the varous textures (or a reference to the texture) and for the view calculate what parts are visible from a given location and render the appropriate textures. You may want to investigate the BSP algorithm as an example of how to do this, although for a very grid based system that may be more effort than you need. -
Cannot Delete The Dll After Calling LoadAssembly()
PlausiblyDamp replied to Wee Bubba's topic in ASP.NET
Once an assembly has been loaded there is no way to release the reference without unloading the ApplicationDomain that hosts it. The following may help: http://www.xtremedotnettalk.com/showthread.php?t=93636&highlight=unload+domain http://www.xtremedotnettalk.com/showthread.php?t=37362&highlight=unload+domain