196 Topics

Member Avatar for triumphost

I hooked a game's OpenGL.dll with my own glwrapper but this game uses two dll's.. It uses a wrapper of OpenGL32 and my hook is also a wrapper. So what I need: I want to know if these symbols point to the same functions.. http://i.imgur.com/eMZC5.png @28, @28, @28.. That means …

Member Avatar for gusano79
0
136
Member Avatar for triumphost

I've hook a game that uses OpenGL and I'm trying to draw text on the window but when drawn, it has a background that I do not want. Currently i'm using: void glPrint(HDC DC, COLORREF Colour, int X, int Y, const char* format, ...) { if (format == NULL) return; …

Member Avatar for triumphost
0
382
Member Avatar for triumphost

So... I'm looking into learning Assembly. I downloaded the FASM assembler and I want to know how useful is assembly? I want the opinion from Cpp programmers because assembly programmers always tell me it's the best language -__- Also quick question: How do I know which register to put stuff …

Member Avatar for DeanMSands3
0
166
Member Avatar for triumphost

How can I get SetConsoleTextAttribute to work with my Console? I tried everything. First I redirected the cout and cin buffers so that my console can have input and output. But now it doesn't have Colour :S I used: HANDLE OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(OutputHandle, 10); I don't think GetStdHandle is …

Member Avatar for triumphost
0
338
Member Avatar for triumphost

How can I create PNG Files from an array of bytes or read a PNG file to create an array of bytes? I looked up the format but it looks nothing like a bitmap and I read the GDI doesn't support PNG's. So how does LibPNG do it then? I …

Member Avatar for DeanMSands3
0
310
Member Avatar for triumphost

How can I get camera view and Triangle count of models in OpenGL? I know it's a vague question but I'm just starting opengl and none of the tutorials explain how to get the current camera view. I hooked all OpenGL calls for a game and figured out how to …

Member Avatar for mike_2000_17
0
146
Member Avatar for triumphost

I'm learning how to detour-hook functions from tutorials online but when I follow along, my DLL says symbols not found. The error I get says: > Linking dynamic library: bin\Debug\GLHook.dll > Cannot export GLHook_glAccum: symbol not defined > Cannot export GLHook_glAlphaFunc: symbol not defined I don't know why though.. I've …

Member Avatar for triumphost
0
761
Member Avatar for triumphost

I'm having a huge problem trying to learn how to export classes from a DLL. I can do some functions just fine but the classes are mangled :S I've tried from .def file, I've used extern "C" but when I did, it threw errors and won't export the class at …

Member Avatar for mike_2000_17
0
2K
Member Avatar for triumphost

I have: 39H4-GTT7-LGLN And I'm trying to find every possible combination of sets. Basically each section is scrambled within itself. So there's only 16 combinations for each section. Example the first section I wrote it out as: 39H4 394H 349H 34H9 49H3 4H93 493H 4H39 9H34 934H 943H 9H43 H493 …

Member Avatar for Lucaci Andrew
0
107
Member Avatar for triumphost

I have a Two Test classes that use variadic templates but I made the constructors explicit so that the compiler doesn't convert anything and leave everything as it was. One class was Array and the other was called 2DArray. When I intialize 2DArray, the compiler was converting its arguments to …

Member Avatar for deceptikon
0
3K
Member Avatar for triumphost

I'm trying to test my copy con and move con as well as their assignment operators. It NEVER gets invoked :S Copy con gets invoked just fine but the assignment operators are never called and neither is the move constructor. How can I test it to make sure it works …

Member Avatar for mike_2000_17
0
276
Member Avatar for triumphost

> "warning: 'class Debug' has pointer data members but does not override 'Debug(const Debug&)' or 'operator=(const Debug&)' [-Weffc++]" The only pointer member I see here is the HANDLE hTHread. Why should I override my constructors or add a move/copy to this class as the compiler suggests? class Debug { private: …

Member Avatar for mike_2000_17
0
4K
Member Avatar for triumphost

How can I create a Modifiable Const vector but make it unable to be resized? Either that OR I want to return a pointer from a function but not allow the user to delete it. This is my example so far: class MemberRawArrayVector { private: vector<unsigned char> MemberRawArray; public: MemberRawArrayVector(int …

Member Avatar for mike_2000_17
0
216
Member Avatar for triumphost

Why does the following code skip the initialization of values of the temporary created? Box::Box() : X1(0), Y1(0), X2(0), Y2(0), W((X2 < 0 ? -X2 : X2) - (X1 < 0 ? -X1 : X1)), H((Y2 < 0 ? -Y2 : Y2) - (Y1 < 0 ? -Y1 : Y1)) …

Member Avatar for Milton Neal
0
231
Member Avatar for triumphost

I'm a bit confused atm, I don't know when to use const T& or T& or T as a parameter. Currently I'm doing: void Resize(std::vector<T> &Vec, const size_t &NewLength) //Ahh edited the function as a result of Lucaci's answer. { Vec.resize(NewLength); } //But thinking of doing: void Resize(std::vector<T> &Vec, size_t …

Member Avatar for mike_2000_17
0
3K
Member Avatar for triumphost

I have the following code to take a bitmap of a portion of the screen specified by the Box Area. Area is just a struct that holds Width, Height, X1, Y1, X2, Y2 and represents a box. Basically a RECT with additional features. For some reason, if Box is (0, …

0
88
Member Avatar for triumphost

I've just read a tutorial on Classes Under the hood/behind the scenes. It says that: Foo* A = new Foo(); // Is different from: Foo* B = new Foo; What in the world? I never put the brackets for my classes like that. Why does the first initialize variables and …

Member Avatar for mike_2000_17
0
271
Member Avatar for triumphost

I just learned C++ style casting and the 4 types of casts. I'm not sure if I'm abusing it though. Examples: typedef long (*stringFromString)(int, char*) __cdecl; //TO: typedef long static_cast<*stringFromString>((int, char*)) __cdecl; SmartSetup((char*)World.c_str(), (char*)",f5", 765, 503,(char*)""); //TO: SmartSetup(static_cast<char*>(World.c_str()), static_cast<char*>(",f5"), 765, 503, static_cast<char*>("")); memcpy(&INH, (void*)((DWORD)Buffer + IDH.e_lfanew), sizeof(INH)); TO: memcpy(&INH, static_cast<void*>(static_cast<DWORD>(Buffer) …

Member Avatar for mike_2000_17
0
669
Member Avatar for triumphost

I have just came across a class for the first time ever that does not have variables in any of it's declarations but has them in the implementation. Why is this class behaviour allowed? What are the benefits of not putting variable names? class Testing { public: Testing(int, int, int); …

Member Avatar for deceptikon
0
130
Member Avatar for triumphost

This works fine. For any type I create (Example): BoxArray& operator -= (const Box& B); BoxArray& operator -= (const BoxArray& BA); BUT when it comes to my literal types like char's and strings and char*'s, I get Ambiguous overloads: StringArray& operator -= (const std::string& S); StringArray& operator -= (const StringArray& …

Member Avatar for triumphost
0
139
Member Avatar for triumphost

Hey when I don't template my classes, I can pass member functions to eachother normally. But when I template it, I get errors. The two functions are defined as so: CustomType& Delete(int Position); CustomType& Delete(T ValueToDelete, bool All = false); CustomType& Delete(CustomType ValuesToDelete); And Implemented like this: template<typename T> CustomType<T>& …

Member Avatar for deceptikon
0
500
Member Avatar for triumphost

How can I do the following but easier? I'm templating a class but I want it so that if typename T is of a literal type such as a string or char, then it can use the following member-function. If not then it cannot use it. I've been using typeid …

Member Avatar for Schol-R-LEA
0
842
Member Avatar for triumphost

I've read that anonymous structs are a compiler extension and codeblocks allows them as long as -pedantic-errors are not enabled. My question is, since it is not legal in C++, what would be the legal equivalent of: typedef union XYZ { int Color; struct { BYTE X, Y, Z; }; …

Member Avatar for mike_2000_17
0
277
Member Avatar for triumphost

How can I cast a class to another type? Example: class Point { Point(int X, int Y); }; Point A(10, 10); POINT P = (POINT)A; A = (Point)P; //I've tried: Point::Point(POINT P) : X(P.x), Y(P.y), Color(0) {} //Constructor. Point& Point::operator ()(POINT P) { if (X != P.x && Y != …

Member Avatar for mrnutty
0
138
Member Avatar for triumphost

Well I like to learn as much code as I can in a day and I just came across the copy constructor. I do not understand when I need to use it. Do I need to use it for every class I make? I came across it after getting the …

Member Avatar for triumphost
0
279
Member Avatar for triumphost

Yesterday I took a dive into smart pointers and wasn't sure when I should use them vs. Raw pointers. I found out they are quite useful but they do not work all the time for me. Example of working: char* Buffer = new char[1024]; fread(buffer, 1, sizeof(buffer), infile); //took out …

Member Avatar for mike_2000_17
0
234
Member Avatar for triumphost

Why does this say shaddowing? If I change my member X and Y to `_X, _Y` then when I access my class via the dot operator, it shows FOUR values.. Current Class: class Point { public: int X, Y; Point(int X, int Y); ~Point(); }; Point::Point(int X, int Y) : …

Member Avatar for triumphost
0
127
Member Avatar for triumphost

I'm trying to figure out why I should convert all my unsigned ints/shorts to size_t. I'm doing the things below but I'm not sure which one to use and which type to iterator my for-loop with: unsigned short Size() { return vector.size(); } int Size() { return vector.size(); } unsigned …

Member Avatar for triumphost
0
203
Member Avatar for triumphost

Currently I'm reading Multi-String values from the registry. These strings are double null terminated and single null delimiters are between each one. So below I have the following where these are declared as so: std::string KeyToRead, Result; DWORD KeyType. Now I'm returning an std::string aka Result. So I iterated my …

Member Avatar for triumphost
0
465
Member Avatar for triumphost

Why does the below crash? My pointer is still alive and is constructed in the main so it should not die until main returns :S I was using this with createthread a while back but my Mingw4.5 never supported it. I just upgraded to 4.7 but now this crashes and …

Member Avatar for triumphost
0
1K
Member Avatar for triumphost

I have a header file that I include into my main.cpp file. I want to set some flags when this file is included. std::cout.flags(std::ios::boolalpha); I want to set that automatically how can I do this? I tried: #ifdef DEFINES_HPP_INCLUDED std::cout.flags(std::ios::boolalpha); #endif //Gives me the error: //error: 'cout' in namespace 'std' …

Member Avatar for mike_2000_17
0
131
Member Avatar for triumphost

I'm trying to understand recursion and stack overflows. First, why does this not cause a stack overflow? Is it because the function returns every time and that the stack isn't populated upon each call? void Meh() { } int main() { while (true) Meh(); } Two, What is the difference …

Member Avatar for mike_2000_17
0
108
Member Avatar for triumphost

The code below gives me a Narrowing conversion from int to uint32_t: typedef union RGB { uint32_t Color; struct { unsigned char B, G, R, A; }; } *PRGB; inline RGB Rgb(int R, int G, int B) {RGB Result = {((R & 255) << 16) | ((G & 255) << …

Member Avatar for WaltP
0
354
Member Avatar for triumphost

Can anyone check my memory class and suggest changes or things I may need? I'm writing it so that I don't have to worry about deleting anything everytime I allocate. #include <iostream> template<typename T> class Memory { private: size_t size; T* data; public: explicit Memory(size_t Size) : size(Size), data(new T[Size]){} …

Member Avatar for rubberman
0
140
Member Avatar for triumphost

What's a fast way to fill a union/struct of integral members with ALL Zeroes? RECORD* UNION = {0}; void ZeroStruct(int X, int Y) { UNION = new RECORD[X * Y]; int K = 0; for (int I = 0; I < X; I++) for (int J = 0; J < …

Member Avatar for mike_2000_17
0
272
Member Avatar for triumphost

Is it possible to overload one operator more than once? I have a struct that is just my idea of a C++ Box. I'm trying to increase the size of a box using an integer or another box. I'm trying to do: Box X(0, 0, 0, 0); Box Y(1, 1, …

Member Avatar for triumphost
0
2K
Member Avatar for triumphost

I have a union defined as so: typedef union RGB { unsigned Color; struct { unsigned char B, G, R, A; }; } *PRGB; I'm reading 32 bit and 24 bit bitmaps. I'm trying to Read Pixels from my RGB union and set pixels as well. I know bitmaps are …

Member Avatar for triumphost
1
446
Member Avatar for triumphost

I'm trying to have my function return an OPENFILENAME struct. Problem: It returns it fine and everything except that I cannot print the filetitle :S At the moment, it prints the path of the file perfectly fine but when it comes to printing the file title via cout, it prints …

Member Avatar for Ancient Dragon
0
275
Member Avatar for triumphost

What should I be using? Should I be using _T? or L? Or Neither? I know some functions end with the A for Ansi and some end in W for the Unicode version but I have no clue what I want to use. if I use _T would I have …

Member Avatar for ravenous
0
268
Member Avatar for triumphost

Is it necessary to seperate the headers from the source? For example I don't know why but I love to do: //Foo.H class Foo { Foo(){} ~Foo(){} void Func() { //......... //......... } void Func2() { //........ //........ } }; Instead of doing: //Foo.H class Foo { Foo(); ~Foo(); void …

Member Avatar for mike_2000_17
0
2K
Member Avatar for triumphost

Currently I use: DWORD ThreadProc(LPVOID lpParameter) { void (* function)() = (void (*)())lpParameter; function(); return 0; } void Threading(HANDLE &hThread, DWORD &ThreadID, void* FunctionToPass) { hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc, (void*)FunctionToPass, 0, &ThreadID); } And I want to call it like: Handle hThread; DWORD ThreadID; Threading(hThread, ThreadID, AnyFunctionHere); That way …

Member Avatar for mike_2000_17
0
456
Member Avatar for triumphost

I want to start developing an IDE or at least a Syntax highlighter into my program. Atm it's a simple text editor with basic copy paste functions. How does Notepad++ do it? Is there a way I can integrate that into my own program? If not then I'll write it …

Member Avatar for mike_2000_17
0
1K
Member Avatar for triumphost

I'm trying to convert My Console classes to .Net classes because I can't use std::vector or anything like that in WindowsFormsApplications. So I decided to convert all Vectors to Lists and I thought that the classes work the same but my code below throws a massive amount of errors and …

Member Avatar for triumphost
0
186
Member Avatar for triumphost

typedef union { unsigned Color; struct { unsigned char B, G, R, A; }; } RGB, *PRGB; inline RGB Rgb(int R, int G, int B) {RGB Result = {((COLORREF)((BYTE)(R)|((BYTE)(G) << 8)|((BYTE)(B) << 16)))}; return Result;} inline RGB Rgb(COLORREF Color) {RGB Result = {Color}; return Result;} The above is my code …

Member Avatar for L7Sqr
0
141
Member Avatar for triumphost

I have the following: typedef union { unsigned Color; struct { unsigned char B, G, R, A; }; } RGB, *PRGB; Then I have: RGB Rgb(XYZ Xyz) { RGB Result; double X = Xyz.X / 100; double Y = Xyz.Y / 100; double Z = Xyz.Z / 100; double Red …

Member Avatar for triumphost
0
953
Member Avatar for triumphost

What is the difference between these two and why does one compile fine compared to the other :S //MyFile.h #include<iostream> using namespace std; inline std::ostream& operator << (std::ostream& Str, const RGB &Rgb) { Str<<"R: "<<(int)Rgb.R<<" G: "<<(int)Rgb.G<<" B: "<<(int)Rgb.B; return Str; } //Main.cpp #include <iostream> #include "MyFile.h" using namespace std; …

Member Avatar for Ancient Dragon
0
209
Member Avatar for triumphost

I have an application that will be minimized and running in the background. I want this application to have it's own moveable mouse so that it does not use my current mouse. How can I accomplish this? I'm not exactly sure where to start to create a mouse for it.

Member Avatar for triumphost
0
416
Member Avatar for triumphost

I have an application I'm updating from Java 6 to 7 inorder to get it to run. The code looks like: public Canvas(GraphicsConfiguration config) { this(); graphicsConfig = config; } But when compiled I get: "graphicsConfig is private access" @ line graphicsConfig = config. How can I do the same …

Member Avatar for NormR1
0
82
Member Avatar for triumphost

I have a class that just creates a blank bitmap it's quite large so I removed a LOT! of code to make it easier to see my problem. No knowledge of bitmaps required. I declared "Pixels" as an array of RGB but in one function, Pixels is empty whereas in …

Member Avatar for triumphost
0
225
Member Avatar for triumphost

How can I stop a process cleanly given it's name? I can use TerminateProcess but it says it does not allow the application to clean up and of course I want it to clean up. This application does not have a WM_CLOSE or WM_QUIT.. I tried.. and I cannot send …

Member Avatar for deceptikon
0
84

The End.