
elikakohen
Members-
Posts
13 -
Joined
-
Last visited
elikakohen's Achievements
Newbie (1/14)
0
Reputation
-
sysdesigner started following elikakohen
-
steved, I have pulled that application to shreds... We seem to be doing everything the same except for the patterns we are using. Right now, all I am trying to get to work is a single window with two panel controls in it. I want to clear one panel to Turqouise and the other to WhiteSmoke. =) Can't get it to work at all. Sounds pretty simple I guess. But what I want to do after that is to use multiple viewports with each SwapChain. I am not exactly certain what ViewPorts do at this point. But I have a good idea. Hopefully its a Device->SwapChins->ViewPorts heirarchy. If not, then I am totally confused. Anyhoo. I can strip my code down to show you what I have. Let me know if you want me to post it.
-
Gangsta, Yes, if you get a hash of the hardware specs and then the user changes them the program will not run. This is the whole point. You want to detect if the user is installing the program on another system. You might want to make sure there is a handy dandy customer service email and phone number for those people who want to move the application to antoher machine or do major upgrades to their system. Just take a snapshot of system information that usually doesn't change. Such as: - Motherboard - Primary Hard Drive - Floppy Drive Model You can get this information from the - Programs - Accessories - System Tools - System Information Tool... There are some hardware identification keys in the registry that you can pull programitically if you need to. Also, I thought that the System Information utility had some exposed interfaces that you can access.... (I have usually done this type of thing through bios, but I am sure the Windows APIs would be much simpler to use.) The Activation Web Service that I spoke of is very easy to make. Just make sure you have a working primary and public key pair. To digitally sign your application us. sn -k to generate a key pair. use the private key to sign your application. In the AssemblyInfo.vs file in your project, there is an attribute that you use to point to your key file. [assembly: AssemblyKeyFile("\mykey.snk")] Honestly, digitally signing your assemblies is not the hard part. (remember, this only ensures that your code can't be changed. Not pirated.) By digitially signing your app, you ensure that someone can not change your piracy protection code. The hard parts are getting the hardware specs from the system. Remember the steps: [The client ] - Get hardware specs of system. - Serialize it. (Turn it into a string.) - Run a sha1 hash on it. (.NET Cryptography namespace) - Accesses Activation Web Service and submits product key and hardware hash. [Activation Web Service] - Confirms validity of product key - Ensures that that the product key is not already assiciated with another hardware hash in the databae, (xml file?) - Associates product key with hardware hash code in the database. - Digitally signs an "Activation Response" response containing the Hash and Product Key. [Client] - Saves Response to application folder. [Client upon startup] - Looks for an "Activation Response" on the hard drive. (If not prompts the user for activation.) - Verifies the "Activation Reponse" by: 1. Validating the digital signature by comparing it with a public key stored with the application or over the Internet. 2. Verifies the hash stored in the "Activation Response" with the actual hash of the system. This is done every time. This is essentially scanning for hardware changes. - If everything is verified, then the application launches. (There might be a grace period to all for people who don't have internet access and have to activate by phone. Hope this helps. You can do searches for almost everything I typed on google if you want a second opinion or cool ways to access hardware configuration information. Hope this helps.
-
MRCP, Don't use a regular collection. Although you could populate the collection, serialize it into text, and write the text stream to a file and reload it if neccessary. Why do that when you can enjoy the benefits of good old fashioned ADO.NET?! (okay, maybe not so old fashioned.) Just create a Typed DataSet, throw your information into it. Write the xml to a file, and reload it when needed. You will get a whole lot of extensibility this way. Also, you also get a table stucture that will help you move your data to a database in the future. Have fun.
-
Object reference not set to an instance of an object.
elikakohen replied to spaced's topic in ASP.NET
spaced, This is C# but I hope it helps... BookDataSet newBookDataSet; newBookDataSet = new BookDataSet(); // This is the line I think you are missing BookDataSet.BookRow newBookRow = newBookDataSet.Book.NewBookRow(); newBookRow.ID = DateTime.Now.Ticks.ToString(); newBookRow.Name = BookName.Text.Trim(); newBookRow.Summary = BookSummary.Text.Trim(); newBookDataSet.Book.AddBookRow(newBookRow); Hope this helps. -
Gangsta - How to protect your application against pirating with Product Keys and Application Activation. This is how to confine your app to one machine without using a hardcode DLL for each user: This involves using Asymetric Cryptography. Find the hardware specs of your machine. Serialize the Specs. Serialize the Product Key. SHA1 Hash the two strings. Send it to your Activation Web Service Your Web Service: - Confirms the Product Key. - Ensures no other Hardware Hashes are associated with that key. - Encrypyts a response with the hashcode in it using their private key. Your application saves the response to the application directory to be checked everytime the application is launched. The Application Decrypts the information using your public key. If the application can decrypt the info and the hardware hash code matches, then voila@, the application is authorized. Hope this helps.
-
You know... The sad thing is that I submit my resume to Blizzard every year for a job (My skillsets: Assembler, C++, C#, Open GL Programmer, Direct 3D, Distributed Transaction Architect, Project Management, etc.) NADA! Not one response. (Except for automated ones.) Anyhoo ... I imagine they are like the Mafia... You have to know someone to get in, and you can never get out.... I have never gotten a reply... =( Anyhoo. I think you should focus more on Customer Service. This position is about Customer Service. Dump as much as you can about all of the experience you have had resolving customer complaints. That is what the Interview will be about anyways. How would you handle this situation.... Anyhoo good luck. P.S. Anyone here ever work for Blizzard and can get me in on WoW? Just wondering.
-
Thanks again for your help... Still no luck.. Here's my code. (C#) SwapChain swapChain = new SwapChain(deviceManager.Device, this.presentParameters); // Tried setting the depthStencil as well. Surface depthStencil = deviceManager.Device.CreateDepthStencilSurface( Parent.Width, Parent.Height, deviceManager.Device.PresentationParameters.AutoDepthStencilFormat, deviceManager.Device.PresentationParameters.MultiSample, deviceManager.Device.PresentationParameters.MultiSampleQuality, true ); Surface renderSurface = swapChain.GetBackBuffer(0, BackBufferType.Mono); deviceManager.Device.SetRenderTarget(0, renderSurface); // deviceManager.Device.DepthStencilSurface = depthStencil; renderSurface.Device.BeginScene(); renderSurface.Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, System.Drawing.Color.Turquoise, 1.0f, 0); renderSurface.Device.EndScene(); renderSurface.Device.Present(); P.S How do you insert code and make it white?
-
AlexCode, It may be a whole lot easier to use dockers... Here is a very simple example. Let me know if this works for you... I can modify this a little if you need. dockerexample.zip
-
Thanks again, No bueno on the Present Parameters.... Was I correct about calling Device.Present instead of swapchain.Present? And do you set the RenderTarget before or after x.BeginScene()?
-
JP, I know you are probably going to want to shoot me, but I can't seem to get this to work... Is there anyway I could see your Device Presentation Parameters? It is as though my SetRenderTarget call is not working... One thing though, is that I wasn't assigning the new DeviceWindowHandle... I was just assigning the DeviceWindow. That seemed to clear up creating the new Swap Chain... I am supposed to call BeginScene, EndScene, and Present off of the base Device and not the SwapChain.Device right? (don't they both referred to the same instance anyways?) What's happening is that when I call ClearScreen it is just renderes the plain Green and Pinkish screens that get rendered if you don't clear the back buffer.... But I am... device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, color, 1.0f, 0); I have also tried: swapChain.Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, System.Drawing.Color.Turquoise, 1.0f, 0); It is not bueno. Anyhoo... I am doing this in C# as well... But I can not see any differences in our code... Thanks again.
-
Hello all, How do you get the Managed Pool to Load and Cache Textures for you?:confused: Problem Description - I started a project with multiple views using only one device and one swap chain. This is when I learned that most of the DirectX 9 functional implementations are really confusing state machines. (Lots of stuff is global.):eek: What really irked me is that VertexBuffers and Textures can not exist without a device. I wanted to do this so I could share VertexBuffers and Textures among multiple devices. These means that I have to multiple instances of the same "model". One for each device.:mad: What I started doing was caching the CustomVertex arrays and loading them into the GraphicsStream upon every render. So far the rendering wasn't so bad. Then I tried to do the same with Textures. OUCH. Okay. So I created these memory streams to make sure that there was only one instance of the texture in my application. Before I render the object, I check my "Texture Cache" to see if it is loaded. If it is, I proceed to load the texture onto the first texture stage. (TextureLoader.FromStream() ) This is painfully slow and slows down my application enormously. Which brings me back to my question.. - Isn't the managed pool supposed to do all of this for you? I would really like for Direct3D to ask my application for a texture if it ever needs one. However, I would really like it to cache these textures on the video card and in the phantom, "Managed Pool memory cloud in that wonderful state of bliss somewhere but not here...". :D Anyhoo. It looks like I can only cache 8 textures, (one for each texture stage) and then I have to reload them everytime I want to render a new model. However, I am kinda hoping that StateBlocks will help solve the problem of all of this. Although I can not see how... Can someone help?:-\ Thanks again for the help.
-
Just wondering if someone could help me with understanding swap chains... Are these true? -A Device can have many swap chains. -Swap Chains can have multiple other Swap Chains -Swap Chains can have multiple "View Ports" These are the assumptions that I have been working under but I can not get any swap chains to work... I think my problem is in this code... /*************************************************/ private static void SetRenderTarget(Control view) { SwapChain newSwapChain; Surface renderTarget; // Copying the Device's Presentation Parameters... PresentParameters pp = device.PresentationParameters; // Customizing Presentation Parameters for this view // Setting the Device window to be associated with a .NET control pp.DeviceWindow = view; pp.BackBufferHeight = view.Height; pp.BackBufferWidth = view.Width; // newSwapChain = device.GetSwapChain(0); // This works // Attempting to create a new Swap Chain newSwapChain = new SwapChain(device, pp); // This doesn't // Trying to get the new Surface from the chain. renderTarget = newSwapChain.GetBackBuffer(0,BackBufferType.Mono); // Getting a Depth Stencil... (The same as the Device's) device.DepthStencilSurface = GetDepthStencil(); // Vainly attempting to make this swap chain the target. device.SetRenderTarget(0, renderTarget); // It might be a good idea to dispose this.. // renderTarget.Dispose(); } However, I am beginning to think it is with the device.BeginScene(), EndScene, and Present() functions... I am supposed to call these off of the main device and not the Swap Chains or Surfaces right? Thanks for the help.
-
Just wondering if you could post the working code... I can not seem to get my swap chains to work...