Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. TheGreyBeast

    How to disable System HotKeys?

    Ooops.. I made a mistake... it seems SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, 1, &old, 0); will disable hotkeys... There is something in each of us we don't know. Something with great power.
  2. TheGreyBeast

    How to disable System HotKeys?

    I want to create a 3d program using OpenGL and Software rendering (gdi). The main problem are the system hotkeys, because I don't want the user to be able to minimize/activate startmenu/press ALT-TAB, etc.. I know, using DirectDraw, SetCooperativeLevel with DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN will...
  3. TheGreyBeast

    I/O Difficulty Opening File

    I had a similar weird problem a while ago, and I didn't solve it. Try to reduce the number of fstreams you got by REUSING some of them. If you don't have all of them opened at the same time, why not reuse the closed ones instead of making a new one?
  4. TheGreyBeast

    executable size

    The reason that constants (or global variables) increase in size is that they are put into the .data segment, which is in the main executable. Variables on stack will not increase the size of the executable on disk, but will use stack memory, like global variables. In Low-level code, the stack...
  5. TheGreyBeast

    follow up...

    Here's another interesting book you should read to write great code: Write Great Code
  6. TheGreyBeast

    follow up...

    When I said it was good code, I realised you were a novice. I just tried to encourage you, because I saw how other novices make and they build pretty awful code.. I hope you haven't take it as an offense.
  7. TheGreyBeast

    follow up...

    Good code. You could try to optimize it a little more. First thing where to look are jumps and calls, and most of all, inner loops. I bet you can optimize them if you take a look at some optimization articles, such as Agner Fog's Pentium Optimisation manuals. You'll find them very useful...
  8. TheGreyBeast

    Why are stack probes used for?

    Visual C++ uses stack probes if a function requires more than 4K local storage, but why does it need stack probes? What are these stack probes actually doing? What is the _chkstk function doing? What exactly is a stack probe and why do you need it? Please forgive me for so many questions, but...
  9. TheGreyBeast

    should I use directX for 2d scroller game?

    Or you could use the Windows GDI (the standard windows gui). It's not so powerful, but I think it uses less resources than DirectX. PS: I may be wrong, so please correct me if so.
  10. TheGreyBeast

    __declspec VERSUS _stdcall

    __declspec(dllexport) is not a calling convention. It just exports the function so executables can use them. It is mainly used in dlls. __stdcall is a calling convention. See this for related information on Microsoft calling conventions.
  11. TheGreyBeast

    Is there a hint for this?

    Ok thanks. I didn't know it was less efficient, because all I wanted to do is keep a very temporary variable in registers to increase speed of a inner loop, but I guess I'll have to write the function in assembler if I want that. Thanks anyway.
  12. TheGreyBeast

    MOD in assembly

    Try AAM: Art of Assembly Language Programming book.
  13. TheGreyBeast

    Is there a hint for this?

    I use a lot of byte variables (5 in fact) and I want to achieve the most performant code with Visual C++ 6.0 I want to load all of them in registers, but the compiler isn't as smart as I thought... It loads three of them in registers al, bl and cl, but it doesn't want to load the others in ah...
  14. TheGreyBeast

    Search a string while a character is met

    The difference between intrinsic and inline is that in inline code you need to write C code. If you write inline assembler code, it will do a lot of crap on performance. For example, if I write my own inline memcpy, and then use the standard intrinsic memcpy, it's a little difference in the...
  15. TheGreyBeast

    Search a string while a character is met

    In Visual C++, the functions memcmp, memcpy and memset are all intrinsics (which makes them really fast), but is there a way to make memchr intrinsic too? Also, I'd like to make a new intrinsic function which searches a string and stops if it encounters a character other than al. For example...
  16. TheGreyBeast

    Inline assembly crash: memory access in kernel mode in Windows XP?

    Sorry I forgot to mention this in the last post: You shouldn't access memory by constants. Instead, if you want to have access to global variables, for example, use OFFSET, but don't try to access the memory directly using constants since it is likely Windows might use that memory locations, and...
  17. TheGreyBeast

    Inline assembly crash: memory access in kernel mode in Windows XP?

    You should preserve the EBX register. The registers that don't need to be preserved are EAX, ECX and EDX. All the other registers have to be preserved across asm blocks. In general, you should use __asm blocks to write entire routines. Try this: __asm { mov ecx, 10h mov al, BYTE PTR...
  18. TheGreyBeast

    Passing parameters in registers?

    Sorry for responding so late, I talked to my friend and he told me he built those .obj files with MASM. He also told me that MASM's .obj files are compatible with Microsoft Visual C++, but when I asked him how should I build his function prototypes in C++, he didn't know.. I only wanted to know...
  19. TheGreyBeast

    Passing parameters in registers?

    Hi, A friend gave me lots of .obj files which have useful functions. Some of the functions use parameters in registers. How can I do that in Visual C++? Something like void ClTile(reg al, reg ah, reg cx); The function is supposed to expect parameter1 in al, parameter2 in ah and parameter3 in...

Part and Inventory Search

Back
Top