- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 5
- Posts with Upvotes
- 5
- Upvoting Members
- 5
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
59 Posted Topics
I just finished up writing a class to encapsulate a pointer-to-pointer that provides auto-release functionality like shared_ptr<T>. I'm curious though, does something like this already exists, in the standard library, boost, ect? I know the idea exists, because in the Unity Engine, when you call Destroy(gameObject), any and all references … | |
Re: compiles fine for me. edit: if you are using visual studio 2010, there is a bug. If you think your code is wrong because you see red underlines, it's because you haven't included the header with your template in it in any other files yet. "Error: PCH warning: cannot find … | |
Re: Private Sub Text1_LostFocus() cmdGo_Click End Sub | |
Hi, if anybody has a second, I have a quick question: In the following situation, Container can contain any combination of the derived classes. If I wanted to go through "Container", for example, and delete all instances of the class DerivedC, how would I do that? [CODE] class Base; class … | |
Hi. I was wondering if someone could offer a bit of advice on this. I have made a web server, and everything seems to be done correctly as far as I can tell. It works and loads web pages just fine. The problem is, that when big files are requested … | |
Re: [quote]If I add a space in any of the strings it will also only display the previous variables and end at the space.[/quote] doesn't the << operator on stringstream parse the input using white-spaces as the delimeter? >oops< link for >> operator [URL="http://www.cplusplus.com/reference/iostream/istream/operator%3E%3E/"]http://www.cplusplus.com/reference/iostream/istream/operator%3E%3E/[/URL] | |
I was trying to make a for loop count down backwards using this loop, but when it gets to zero, instead of realizing that decrementing will bring the number below zero, it tries to make the unsigned short (-1), which is actually 65535 as unsigned. of course, this code produces … | |
Re: There is a god. | |
I have a simple web server built, and I created a status window that runs on a separate thread. If I have a list of structs being updated by the main thread, is it ok to read(only read) from those structs from the second thread for the purpose of getting … | |
If I am using overlapped sockets with i/o completion ports, is it ok to use WSASend on a socket to send data [B]after [/B]posting the initial WSARecv on that same socket, but [B]before [/B]having received any data? Will the socket still receive data and trigger the completion port if I … | |
I have read all the MSDN docs on this subject that seemed relevant, but I am still confused about a few things. I am trying to achieve functionality like WSAAsyncSelect(), but use a separate thread instead of the main window. Can I use the regular WSAEventSelect() for this? and if … | |
Re: reading the time in is probably the most complicated part. I would use stringstream. Give this a shot: [code] #include <iostream> // for accessing the console #include <sstream> #include <string> using namespace std; int main() { //variables for holding the user-inputted time in the format "00:00pm" char startTime[7]; char finishTime[7]; … | |
Hullo. I made a small webserver just to flex my winsock muscle, but it only works for small files like html files. Once I have processed the request to get the path of the file, I send the result like this: [code] ifstream fin; fin.open(URL, ios_base::binary | ios_base::in); if (!fin.good() … | |
hi, I put together a small app to try using SEE in assembly, but I am getting the wrong output. these are the .cpp file and the .asm file [code=cpp] #define WIN32_LEAN_AND_MEAN #include <iostream> using namespace std; extern "C" int *myFunc(float *a, float *b, float *result); int main(int argc, char … | |
Why does the debugger stop execution and give an error when WaitForSingleObject() is called on a closed HANDLE?? when I run my program outside of the VS2010 IDE, WaitForSingleObject(invalid handle) just returns WAIT_FAILED like its supposed to. Is there anything actually wrong with calling it on an invalid handle? | |
can anyone tell me why this would freeze? I'm trying to find a way to terminate a thread from outside of it, and allow the main program to do garbage cleanup, like closing any HANDLEs used or freeing any memory allocated. I trigger an event which should cause that loop … | |
Re: [code] //google "cross product" for how these calculations work GLvoid CalculateVectorNormal(GLfloat fVert1[], GLfloat fVert2[], GLfloat fVert3[], GLfloat *fNormalX, GLfloat *fNormalY, GLfloat *fNormalZ) { GLfloat Qx, Qy, Qz, Px, Py, Pz; Qx = fVert2[0]-fVert1[0]; Qy = fVert2[1]-fVert1[1]; Qz = fVert2[2]-fVert1[2]; Px = fVert3[0]-fVert1[0]; Py = fVert3[1]-fVert1[1]; Pz = fVert3[2]-fVert1[2]; *fNormalX = … | |
I just finished a small winsock program for sending files, but its soooooooooooooooooooooooooooooooooooooooooooooooooooooooo slooooowwwwwwwwwwwwwwwww:yawn: so I am hoping someone here may be able to offer me some advice. so far, the program works as follows: 1. User1 chooses a file and attempts to send it. 2. User2 chooses to accept … | |
I made a simple app to turn off a monitor. The entire program consists of just this: monoff.cpp [code] #include "windows.h" #define MON_OFF 0x2 int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, MON_OFF); return 0; } [/code] For some reason it still wont run … | |
I need a little help with this :icon_redface: if I use ifstream::read() and go past the end of the file, how do I tell how many chars have been read? thanks, Nick | |
Re: SetCursorPos [URL="http://msdn.microsoft.com/en-us/library/ms648394%28VS.85%29.aspx"]http://msdn.microsoft.com/en-us/library/ms648394%28VS.85%29.aspx[/URL] GetCursorPos [URL="http://msdn.microsoft.com/en-us/library/ms648390%28VS.85%29.aspx"]http://msdn.microsoft.com/en-us/library/ms648390%28VS.85%29.aspx[/URL] Creating a simple window [URL="http://www.winprog.org/tutorial/simple_window.html"]http://www.winprog.org/tutorial/simple_window.html[/URL] | |
Re: ofstream out("file2", ios::out |ios::binary | [COLOR="Green"]ios::app[/COLOR]); reference: [url]http://www.cplusplus.com/reference/iostream/fstream/open/[/url] | |
I have a small test program made, and it actually fully works. It connects, and you can send messages back and forth.....but for some reason, when I call connect(), It returns SOCKET_ERROR, but connects, and works fine anyways. Does anyone know why? here is the code: see lines 160, 161 … | |
Re: my preference: [url]http://www.cplusplus.com/reference/clibrary/cstdio/fscanf/[/url] you can also use this: [url]http://www.cplusplus.com/reference/iostream/fstream/[/url] | |
Hi, I am trying to make a windows forms application that starts using Sub Main instead of the Form1_Load event. I have tried putting this in Public Class Form1 [code="vb"] Public Shared Sub Main() MsgBox("ASdf") End Sub [/code] and also tried putting this at the top of the programs code … | |
Re: I'm only really use OpenGL ES for mobile devices, so don't quote me, but I think your keyboard procedure is the problem. You shouldn't be calling glTranslatef from inside the keyboard proc, because that one matrix will end up being applied to the entire scene. You have make your keyboard … | |
Hi, Does anybody know how to enable/disable a secondary monitor using ChangeDisplaySettingsEx or any other function? | |
Is there a way to put a computer to sleep somehow other than clicking start, then sleep? I am using a shortcut to this right now: C:\Windows\System32\rundll32.exe powrprof.dll,SetSuspendState 0,1,0 but it doesnt do the same thing as clicking "Sleep" in the start menu. I need a piece of C++ code, … | |
Re: ugh...I think a simple "watch out for facebook wierdos" would have sufficed =/ | |
Hello! I made a little app/page to help me count the money when Im done my shift at work. It runs fine in IExplorer, but it wont run in Firefox..can someone help? [CODE="html"] <html> <head> <title>Money Calculator 1.0</title> </head> <body> <script type="text/javascript"> function clr() { document.getElementById("hundred").value=0; document.getElementById("fifty").value=0; document.getElementById("twenty").value=0; document.getElementById("ten").value=0; document.getElementById("five").value=0; … | |
I can't figure out, or google how to do this =/ I just need something to put my computer to sleep [CODE="cplusplus"] #pragma comment (lib, "PowrProf.lib") #include "stdafx.h" #include "windows.h" #include "Powrprof.h" int _tmain(int argc, _TCHAR* argv[]) { SetSuspendState(false, false, false); return 0; } [/CODE] I get this error: 1>Sleeper.obj … | |
Hello! I am trying to read a value from the registry, but I can't get it to work. Everything compiles, but RegQueryValueEx keeps producing an error. this is the code: [code lang="cplusplus"] #include "stdafx.h" #include <windows.h> #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { HKEY hKey = … | |
I posted yesterday with some questions about making a mouse utility to replace the double click with a single keystroke. I finally put it all together, and came up with this DLL: [code="cplusplus"] #include "stdafx.h" #include <windows.h> #include <stdio.h> HHOOK hook = 0; bool quit = false; LRESULT CALLBACK ClickProc(int … | |
Hello! I have a piece of software called X-Mouse Button Control, and its able to intercept mouse events. The website for my mouse had this instead of a driver specifically for the mouse. In the program, I am able to "Intercept" the functions of Leftclick, Rightclick, ect, globally for windows. … | |
Hello~! ...again.. I got some help from you guys a while ago with this same app because it wouldn't run on winxp. It runs fine now, but my brother is still telling me he cant get it to work right...so rather than go through all the trouble of trouble shooting(he … | |
Sup guys...I tried to make a little program my brother asked for to try and increase his odds of winning the lotto! lol... anywho, It compiles and runs fine on my computer, but I tried it on two different computers running XP, and it doesnt work =( Both computers I … | |
Hi. I am trying to use assembly in C++, and need a few pointers(pun intended) lol I want to use C++ structs as operands, but can't figure out how. my code is like this so far: TEST.CPP [code=cplusplus] extern "C" WORD _add(WORD num1, WORD num2); int _tmain(int argc, _TCHAR* argv[]) … | |
I put together a simple speech recognizer. It works fine, but when I click the X to close it, it takes forever to unload... can I do anything about it? [CODE] Dim WithEvents RecoContext As SpInProcRecoContext 'RC Dim Grammar As ISpeechRecoGrammar Dim Recognizer As SpInprocRecognizer Private Sub Form_Unload(Cancel As Integer) … | |
right now, I am allocating a dynamic 2D array for my rasterizer's edge list. My setup looks like this: [code="cplusplus"] struct EDGE { float x, dx; float uvws[4]; //u, v, 1/z, shade float duvws[4]; float y_limit[2]; bool active; }; struct EDGERECORD { EDGE *left_edge; EDGE *right_edge; EDGE edges[9]; UINT16 num_edges; … | |
hello! I am trying to learn how to do paralell processing. I am baseing this on an example that I saw here: [url]http://www.codeproject.com/KB/recipes/sseintro.aspx[/url] the one titled "SSETest Demo Project" I tried to make my own, and don't understand why it isn't working. Here is the code: [code="cplusplus"] // testconsole.cpp : … | |
Im having a very strange problem that I can't explain =/ this is what the compiler is saying: 1>------ Build started: Project: 3d, Configuration: Debug Win32 ------ 1>Compiling... 1>RENDER.CPP 1>Generating Code... 1>Compiling... 1>GEOM.CPP 1>MAIN.CPP 1>MOVEMENT.CPP 1>Generating Code... 1>Linking... 1>MAIN.obj : error LNK2005: "struct OBJECT * obj" (?obj@@3PAUOBJECT@@A) already defined in … | |
I literally picked up asm today. I have been trying to create a 3d software rendering engine in C++, and figured out doing things directly would be faster....but, I tried the following code: [code="cplusplus"] int _tmain(int argc, _TCHAR* argv[]) { int num, timestart, dur; timestart = clock(); for(int i = … | |
I can't believe my eyes...the entire course is online! I am finding more and more of these lately. [url]http://www.youtube.com/view_play_list?p=84A56BC7F4A1F852[/url] about 20 complete lectures from the Programming Methodology class at Standford University. | |
I have seen functions defined these two ways: function(type *variablename) function(type variablename&) I commonly use the first one to pass on pointers to my structs, but is the second one the same as the first? | |
Hi, I'm trying to make 3D clipping for my 3D projection program, and I am having trouble with the FOV calculations. The problem is that I set FOV to 45, but a point placed at 45 degrees from the camera does not appear at the edge of the viewport. I … | |
when a cursor key is pressed, WM_KEYDOWN is received, and when it is released, WM_KEYUP is received. How can I get this same functionality with a character key? I found the messages WM_CHAR and WM_DEADCHAR, but they dont work like the above messages. Can anyone help? Thanks, Nick | |
i have a struct with an array of three points in it, for example: struct POINTS { POINT pts[3]; }; then I have another struct with two single points in it like this: struct EDGE { POINT *p1, *p2; } is there a way to set p1 to a single … | |
I posted this question in the regular C++ forum and havn't gotten any answers. hoping I will have better luck here, here was the question: [URL="http://www.daniweb.com/forums/thread160790.html"]http://www.daniweb.com/forums/thread160790.html[/URL] I need to load a bitmap from file, and get an array of bits that I cain use. I have used CreateDIBSection() to create … | |
hi, I have used LoadImage() to load a bitmap as HBITMAP. If I use SelectObject() to attach it to an HDC, and then BitBlt() it to the screen, that works fine. I need an array that would be compatible with the one produced by CreateDIBSection(). I have tried GetBitmapBits(), and … |
The End.