Jump to content
Xtreme .Net Talk

coldfusion244

Avatar/Signature
  • Posts

    269
  • Joined

  • Last visited

Everything posted by coldfusion244

  1. Nice, thanks again HJB!
  2. I need to use a 32bit datatype that is in the order of big-endian. I'm unsure of how .NET order's it's data, depending on if it's big/little I could change the data it must hold. Does anyone know what scheme MS uses? The data I'm using is 0x7E.
  3. Yes, you can still do MFC. I encourage everyone to learn unmanaged c++, it'll give you insight to what you are actually doing in other languages that's hidden from you.
  4. I am attempting to teach myself DC's, these from what I understand can be anything from a window to a printer, monitor, etc. As an experiment to try and learn it, I want to grab the background image or color of the desktop and change it to some random color or colors. This is what I was thnking: PseudoCode Start Grab hWnd Grab DC CreateBitmap Toggle Bitmap Colors? Write Bitmap to DC using BitBlt? Release DC End [/Code] Does that look like it'll work? I haven't used bitmaps before either, so hopefully it'll be a good learning tool. I am using Unmanaged C++.
  5. Started with Basic, then QBasic, VB4,5,6, then C++,PHP, x86 asm, 68xxx asm... by far I love C++ and PHP the most then asm, do alot of embedded systems with basic and asm still... vb and php are just for fun :) About 12 years.
  6. You must free up any memory that you have dynamically allocated or it will be viewed as a memory leak. Especially if you are using large amount of data as you said. You need to call delete after you are done working with all the memory and have your final answer. Once you no longer need the array, delete it.
  7. instead of having all those functions in one file, try creating a class for each type of sort. Then in the destructor of each class have it free up any memory used, that should take care of your problem (if I am reading it correctly). This way, you can sort one way then free up the memory. Sort another and again free it up.
  8. Wile, most cheaters, though, edit the file and replace the current one with their new one so that it allows their loader to inject code into it. This is at least how most of the cheaters in Americas Army Operations do it. It's had to even say verify it with a MD5 checksum as some of the more advanced cheaters can use the hole in md5 to make it seem like the original. Just some FYI.
  9. If you want to learn Managed C++, it's just like learning Visual C# (almost). However you have explained that your background is Visual C++ 6.0, so if you choose to use unmanaged code it will be exactly the same as 6.0. I personally use unmanaged and watch the C++ forum... Kinda new myself but I will give you as much help as I can. I would advise against learning VB.NET first, as the syntax and methodology is completely different (unless of course you want managed C++). API in unmanaged works the same, pointers, primitives, the same. Your choice.
  10. Ok, I followed it (I think) and for some reason it doesn't come out right.. I'm thinking this is because you can choose any polynomial that you wish (Although I used the one for Ethernet). Any Ideas? Here is the code I used (I did it the slow way I guess, no lookup table). #include "stdafx.h" #include <iostream> #include <fstream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { ifstream mf; char *b = new char(); unsigned long r = 0x04c11db7L; unsigned long s = 0; unsigned long t = 0; unsigned long temp = 0; mf.open("C:\\test.txt",ios::binary); while(mf.peek() != -1) { s = r & 0xff000000; cout<<mf.read(b,1); s = s ^ *b; temp = r & 0xFF000000; temp = temp>>24; r = r<<8; r = r | temp; s = s ^ r; t = t + s; } mf.close(); cout<<endl<<r<<"|"<<s<<"|"<<t<<endl; cin.get(); return 0; } [/Code]
  11. I was curious about CRC32 so I did a quick google search and it brought up some examples. They weren't all that exceptional so I figured I'd post here to get more information. From what I gathered, you take a message that is 32 bit of data in length, then shift it left bitwise 3 places. Take the lowest 5 bits from that message and add 1 to it which would become the checksum. you then append the checksum on the end of the message. To check you would take the message modulo the checksum and shouldn't have a remainder.Is that correct or did I not fully understand it?
  12. It would help if you posted more code than that, sounds like you aren't instantiating an object.
  13. If I compile and run a program in C++ it runs off the stack unless I allocate memory in the heap and load the rest of my code there correct?
  14. GetKeyState sorry I don't know the .net version of this, people seem to frown upon API here, but this is my 2 cents.
  15. I just find it odd that it's set up for ByVal and not ByRef. If you're going to be passing an arguement to be changed I would pass it's reference, not it's value. I know C# has the 'out' modifier... Just my thoughts.
  16. Ah, I thought you meant how could you ALLOCATE space for the byte array, sorry.
  17. Does anyone know how to get low level access to a drive (whether it be a hard drive, removable storage, optical, etc) to that you can read from it bit by bit? This of course I can accomplish with ASM, but I wanted to code this project in C++. Any ideas? Suggestions?
  18. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecoreos5/html/wce50lrfheapalloc.asp is that what you're looking for?
  19. Why not use SetWindowLong and make it always topmost?
  20. You want to find the handle of a window that doesn't belong to your program? If so, look at FindWindow and FindWindowEx API. If it belongs to your program you should know it once you create the window.
  21. TAPI isn't a program, it's API Provided by microsoft. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tapi/tapi2/tapi_2_2_reference.asp
  22. You'll want to use the Process class. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticsprocessmemberstopic.asp [Process].Start() and [Process].WaitForExit()
  23. You said you are using all these bitwise operations on 2-byte values. So if you use a 4 byte value (32-bit integer) and attempt bitwise shifting, you're not going to get the right answer unless yuo use it for shifting a 2-byte value inside of a 4-byte data type. Example: 1: 16-bit unsigned number 1100010100101011 = 50475 shifting bits to the left 8 will result in 0010101111000101 = 11205 2: 32-bit unsigned number 00000000000000001100010100101011 = 50475 which is the ssme as above, but when we shift left 8 bits... 00000000110001010010101100000000 = 12921600 which isn't the same. The MSByte in this case is 00000000. and the LSByte = 00000000 which is different from the 16-bit data type. Take into account that these are unsigned values which means the sign bit is being used a regular value. If you would have a signed value, would you include the sign bit as you shift left and right? You'd have to figure out how you wanted to handle this before moving on I would think.
  24. when you use LSB are you implying that the B means Byte or B means Bit? I belive you are talking about byte... I am not sure what it all calls for, but if you aren't dealing with negative numbers you can use an unsigned 16-bit integer; right now you're using a signed 32-bit integer... See the difference. You have the right idea though.
×
×
  • Create New...