This didn't fix the direct issue, but it did completely remove horizontal scrolling. This may be usable if I can get the template to resize with resizing the screen, but due to my current code and images probably won't work.
gamefreak2291
Posts
-
Horizontal Movement -
Horizontal MovementOkay, I don't know if this is more of a CSS or HTML question but I'm having issues with my navigation bar scrolling horizontally when the browser window is too small. I have my navigation bar on a separate layer from the rest of my web-page and have it in a fixed position. The only issue that I know is left is that if the user has their browser set to smaller dimensions than the webpage the navigation bar moves as they scroll horizontally. I'm trying to stop it from moving on the X-axis and only along the Y-axis.
-
how can ı change some of ascii table charactersif(0x65)
{
cout << 0x66;
}??
-
books on VC++Depending on what you're looking for.. I have a copy of "Starting out with Games & Graphics in C++" and it's very nice, it uses the Dark GDK wizards which you can get from www.thegamecreators.com for free.
-
Reset to computerAs someone else already suggested, you can use the command "shutdown -r" which will run just as though you used it through command prompt. An example:
void main()
{
system("shutdown -r");
}This will default to a 30 second timer before the computer begins to shutdown. With some effort, you should be able to find a way to decrease the timer, although I'm not positive. EDIT: system("shutdown -r -t 10"); that will set the shutdown timer to 10 seconds, instead of the default 30. The command shutdown tells the computer what to do, "-r" is for resetting the computer, "-t xx" (-t 10) sets the time to the amount of seconds you indicate, so if your code were "system("shutdown -r -t 1");" The computer would start resetting one second after your program executes that line of code. Theoretically you can set it to 0 seconds, but I don't feel like testing that one ;P
-
Multiple .cpp filesThe question should still exist, however it could have been slightly more direct. I understand how having multiple functions and variables withing a single .cpp work. I know extra functions must be called, from within the main function, to be 'executed'. I, however, did not understand how things would work having multiple .cpp files all with their own "main functions" because I had never been instructed, read about, or tried this before. Cedric Moonen understood exactly what I was doing wrong, made mention of it, and my confusion of how having multiple .cpp files work. I now understand it's used for organizational purposes, and works no differently that having multiple functions within one file. Nevertheless I appreciate the attempt at helping me.
-
Multiple .cpp filesSorry, but you're not helping at all. I do understand it. I understand what the compiler does. I know it processing the c++ code, converts it into machine code, creating object files, and then links them into the executable. The thing I did not understand was how the final product would run if there were multiple sources(these are also known as source files or .cpp files). I was attempting to see if when the final product was executed if the functions from each separate source would run along side one another, or if it worked the same as having multiple functions within one single .cpp file. So instead of judging my understanding of the process, try being helpful like the other fellow.
-
Multiple .cpp filesI was recently given a brand new copy of a Game and Graphics textbook for C++ and I've been putting it to use. But I like to veer off and try things as I go that aren't explained in my reading materials. The book explained how to color sections of the screen, and from there I used the index to find out the other parts and attempted to combine a few functions I had been wanting to do before starting Visual programming. Nevertheless I plan on finishing the book and maybe it'll continue to help out.
-
Multiple .cpp filesI do understand how the executable file is compiled, what I was not understanding is how the file is than actually executed.
-
Multiple .cpp filesYeah, that how the issue began, I want to have two continuous loops running. One looping at every possible interval(mouse position), the other looping every second or so(changing the colors of the squares). I was wanting to do this without having to create two separate executable files and running then side by side.
-
Multiple .cpp filesThat is what I was coming to think after I actually got the entire project to build and run and it still wasn't working the way I had been expecting. So to get the "main" function of the second .cpp file to run i have to call it within the other one using the same method used for calling the two functions that made the two different colored boxes correct?
-
Multiple .cpp filesI'm not sure how using multiple .cpp files to create one .exe works but I'm attempted to using multiples to create just one .exe file. I'm currently using Microsoft Visual Studio 2008 and I've created a project built the project, and ran the file. I've either done something incorrect, or my idea of how this would work is wrong, in which case, my bad.
#include "DarkGDK.h"
void drawBlueBox();
void drawRedBox();
int x=319;void DarkGDK()
{
dbSetWindowOff(); // window mode off
dbMaximiseWindow(); // maximise
dbSetDisplayMode(1280, 1024, 32);while(x=319){ dbCLS(); drawBlueBox(); drawRedBox(); } dbWaitKey();
}
void drawBlueBox()
{
int red = dbRND(255);
int green = dbRND(225);
int blue = dbRND(225);DWORD blue1 = dbRGB(red, green, blue); DWORD black = dbRGB(0, 255, 0); dbInk(blue1, black); dbBox(0, 0, 639, 511);
}
void drawRedBox()
{
int red = dbRND(255);
int green = dbRND(225);
int blue = dbRND(225);DWORD red1 = dbRGB(red, green, blue); DWORD black = dbRGB(0, 255, 0); dbInk(red1, black); dbBox(640, 512, 1280, 1024);
}
#include "DarkGDK.h"
int y=0;
void main()
{
int width = dbScreenWidth();
int height = dbScreenHeight();
int mouseX = dbMouseX();
int mouseY = dbMouseY();
dbPositionMouse(dbScreenWidth()/2, dbScreenHeight()/2);
DWORD white = dbRGB(255, 255, 255);
DWORD black = dbRGB(0, 255, 0);while(y=0){ dbInk(white, black); dbText(350, 150, "Screen Width: "); dbText(460, 150, dbStr(width)); dbText(120, 350, "Screen Height: "); dbText(240, 350, dbStr(height)); dbText(120, 363, "Mouse Position: ( , )"); dbText(255, 363, dbStr(mouseX)); dbText(297, 363, dbStr(mouseY)); dbWait(50); }
}
The first .cpp file makes a full screen window that makes two randomly color changing boxes, while the second .cpp files tracks your mouses movement as you move it across the screen and displays it. The code on either .cpp files is running properly when compiled alone and into two separate .exe files. If someone could explain exactly how one .exe file made with multiple .cpp files would run I think that would also be helpful.
-
C++ How to retrieve IP Address/Default GatewayI thought about that, and while I can get it down to the correct line, I couldn't get it to retrieve only the gateway. Had some issues using the find command. Its safe to say I'm pretty amateur.
-
C++ How to retrieve IP Address/Default GatewayI'm trying to figure out how to locate and use the IP Address/Default Gateway in a C++ program. This is so that a simple program can be universal on any network. I have been able to run "ipconfig /all" and output all the information to a text file, but I can't make it usable in the same program.
-
Writing a ScreensaverNo I don't have the SDK platforms, I have VS2008 on another computer or older harddrive somewhere but I have no idea which one and don't exactly prefer using VS over Dev.
-
Writing a ScreensaverSo, I got a little bored and decided to create a desktop locker through the screensaver function of windows. I'm running XP and Dev C++ 4.9.9.2 and Dev is causing my problem. Other places I've checked said i would need to link "comctl32.lib" which I can't seem to locate on my computer or the internet for download. Incase it would be of any use I'll post my program code.
#include <iostream>
#include <windows.h>
#include <scrnsave.h>unsigned char new1;
using namespace std;LONG WINAPI ScreenSaverProc(HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam)
{
// Handles screen saver messages
switch(message)
{
case WM_CREATE:
// Creation of the screen saver window
return 0;
case WM_ERASEBKGND:
// Erases the screen saver background
return 0;
case WM_TIMER:
uTimer = SetTimer(hwnd, 1, 1000, NULL);
// Handles the timer
return 0;
case WM_DESTROY:
KillTimer(hwnd, uTimer);
// Cleans up the screen saver window
PostQuitMessage(0);
return 0;
}
return DefScreenSaverProc(hwnd,message,wparam,lparam);
}
BOOL WINAPI ScreenSaverConfigureDialog(HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam)
{
return true;
}
BOOL WINAPI RegisterDialogClasses(HANDLE hmodule)
{
return true;
}I receive an error with the "uTimer = SetTimer(hwnd, 1, 1000, NULL);" line of code, but I'm assuming that its linked to the comctl32.lib considering I read scrnsave.h requires it; also the code compiles but does not work without the uTimer line.
-
How to retrieve Public IP AddressNo I have not tried InternetReadFile(), I looked into to it and I can't seem to get it to work.. I'm not very good when it comes to Win API functions
-
cant make it stop, problem with small c++ codeYeah I suggested the return 0 part but i failed to notice he didn't make main() an int or I would of mentioned that part too
-
cant make it stop, problem with small c++ codeI don't understand but only a few words of the Spanish and I was too lazy to check the math because I don't understand it either..(think I need to know the comment right before it) Anyhow if you add getch(); or system("pause"); right before your final bracket that will fix the problem for you. *notes: system("pause") should be platform dependent, but works in windows.. you have to press the enter key before the program does anything else getch = get character, all it does it waits for any key at all to be pressed and then continues.. should work on any platform but you may accidently hit a key and close the program its common practice to include return 0; or return 1; but as you can see, not necessary .
-
How to retrieve Public IP AddressI'm currently working on a program that outputs the information given under ipconfig/all in DOS to a text file. Now even though this seems very simple do check normally, its for people who don't know dos commands and that sort of thing. However to make this program more effective I would like to have it output the Public IP address of a network, this can be done normally by visiting http://whatismyip.com The code is currently:
#include #include #include int main()
{
system("ipconfig/all >> \"C:\\Documents and Settings\\gamefreak\\desktop\\test.txt\"");
}which is working, now I'm trying to output the information provided by http://www.whatismyip.com/automation/n09230945.asp I suppose an answer on how to copy and paste all the information from a webpage in C++ would work the easiest.