TheBeast32 54 Posting Whiz in Training

Do what Salem said. I'm pretty sure it's called double buffering.

TheBeast32 54 Posting Whiz in Training

oops sry =(

TheBeast32 54 Posting Whiz in Training

if you are getting multiple definition errors, change your headers to look like this:

#ifndef HEADERNAME_H
#define HEADERNAME_H

// Your code here

#endif

That way if you include a header more than once, it'll only be included if it hasn't been.

TheBeast32 54 Posting Whiz in Training

Try passing C:\Dev-cpp\ or whatever the root directory for Dev-C++ is.

TheBeast32 54 Posting Whiz in Training

I'll look into it

TheBeast32 54 Posting Whiz in Training

We won't do your homework for you.

TheBeast32 54 Posting Whiz in Training

Oh MY GOD! The multi(0) stuff is WINDOWS LOADING. I use safe mode ALL THE TIME. JUST WAIT FOR IT TO LOAD

TheBeast32 54 Posting Whiz in Training

I think it's giving an error because dev-c++ 4.9.9.2 uses code completion. it makes a cache, and it may be looking for that. =|

TheBeast32 54 Posting Whiz in Training

You can do that:

#include <sstream>

std::string Convert (float number){
     std::ostringstream buff;
     buff<<number;
     return buff.str();
}

but for more precision, include <iomanip>, and add setprecision(<number of digits of precision>) in your buff<<number. Like "buff << setprecision(32) << number;"

TheBeast32 54 Posting Whiz in Training

No, I have the beta version (4.9.9.2). It's weird. I can't find a config directory. I'll look around for it.

TheBeast32 54 Posting Whiz in Training

DOES the directory exist?~! If it doesn't, then get a new installer or something.

TheBeast32 54 Posting Whiz in Training

To pass a parameter to the program, do it from the command line. If it's devcpp.exe. Do dev-cpp.exe -c "C:\config"

TheBeast32 54 Posting Whiz in Training

i'll attack the devpak! =)

iamthwee commented: Excellent! +17
TheBeast32 54 Posting Whiz in Training

Dev-C++ WILL download it. You have to pick the option in the package downloader that says community devpaks, scroll down and find it. Download it, and it should automatically bring you to an installer.

TheBeast32 54 Posting Whiz in Training

Use the GMP library. It works for me. If you're using Dev-C++, you can just search for packages online with the built in "Check for updates/packages" thing, and find it in the list. If not go here: http://gmplib.org/

TheBeast32 54 Posting Whiz in Training

Anyone?

TheBeast32 54 Posting Whiz in Training

Hi, I'm making a program that can send an SMS message to a cell phone using any number that the user chooses. I have been successful sending a message with an SMTP server that says it's from an email address, but I need to make it show up as a number. For example, person A send a text to person B with the number "1-234-567-8910" that says "hi". It's like a spoofing program. Anyway, how would I change the number?

Here's what I'm doing on an SMTP server:

helo www.google.com
mail from:aaa@gmail.com
rcpt to:**********@email.uscc.net
data
Subject:hi


Hello, this is a message

.

quit

TheBeast32 54 Posting Whiz in Training

I found this:

while (*atts) {
    printf(" %s='%s'", atts[0], atts[1]);
    atts += 2;
  }

It works, but I have no idea what it's doing.

TheBeast32 54 Posting Whiz in Training

I don't do the allocating.. Expat does.

XMLCALL startElement(void *userData, const char *name, const char **atts)

Once I define that function, It calls it with all of the parameters filled in for me so I can use them when it finds a new element.

TheBeast32 54 Posting Whiz in Training

Hi, I'm using Expat to parse XML, and I have an array of attributes for an element. I need to be able to loop through them all, and get their values, I don't know the array size, and it's a multidimensional array, so I couldn't do

int count = sizeof(array)/sizeof(char);

Please help.....

The array looks like this:

char **atts

.

TheBeast32 54 Posting Whiz in Training

Hi, I'm starting to program with DirectX. I haven't use pixel or vertex shaders, but I know DirectX supports them. My graphics card is a piece of crap, and it doesn't support pixel and vertex shaders. How could I render them with software or an emulator, so I can test them on my PC? Check my computer specs if you want to know. They're on my profile.

TheBeast32 54 Posting Whiz in Training

No, I don't even have that. I have dial-up, so if it's big, then I don't want to get it right now.

TheBeast32 54 Posting Whiz in Training
TheBeast32 54 Posting Whiz in Training

Hi, whenever I compile any sample code for DirectX, I get this error: [Linker error] undefined reference to `D3DXCreateFontA@48'. I'm using Dev-C++ 4.9.9.2, I'm linking it with:
libd3d9.a
libd3dx9d.a
libdinput.a
libdinput8.a
libdxguid.a

I don't know why this is happening. Please help.:twisted:

TheBeast32 54 Posting Whiz in Training

Where can I get the SDK for the samples here http://www.tapi.info/default.aspx/TAPI/PSDKSamples.html

TheBeast32 54 Posting Whiz in Training

OOOOOOOPSSSSSSSSSSS, I'm StUPID. No i didn't. I don't know why I put that........:$ :$ :$
I'm an idiot.......................

TheBeast32 54 Posting Whiz in Training

How would you compile this in Dev?

using System;
using System.Collections.Generic;
using System.Text;
using JulMar.Tapi3;

namespace TestTapi
{
   class Program
   {
      static void Main(string[] args)
      {
         TTapi tapi = new TTapi();
         TCall call = null; TAddress modemAddr = null;

         tapi.Initialize();
         tapi.TE_CALLNOTIFICATION += delegate(object sender, TapiCallNotificationEventArgs e)  
         {
            Console.WriteLine("New call {0} detected from {1}", e.Call.ToString(), e.Event);
         };
         tapi.TE_CALLSTATE += delegate(object sender, TapiCallStateEventArgs e)
         {
            Console.WriteLine("{0}:{4} has changed state to {1} due to {2} - current={3}:{5}", 
                  e.Call, e.State, e.Cause, e.Call == call, e.Call.GetHashCode(), (call != null) ? call.GetHashCode() : 0);
            if (e.State == CALL_STATE.CS_INPROGRESS && e.Call == call)
            {
               Console.WriteLine("Dropping call");
               e.Call.Disconnect(DISCONNECT_CODE.DC_NORMAL);
            }
         };

         foreach (TAddress addr in tapi.Addresses)
         {
            if (String.Compare(addr.ServiceProviderName, "unimdm.tsp", true) == 0 && 
               addr.QueryMediaType(TAPIMEDIATYPES.AUDIO))
               modemAddr = addr;
         }

         if (modemAddr != null)
         {
            Console.WriteLine("{0} = {1} ({3}) [{2}]", modemAddr.AddressName, modemAddr.State, modemAddr.ServiceProviderName, modemAddr.DialableAddress);
            modemAddr.Monitor(TAPIMEDIATYPES.AUDIO);
            ConsoleKey ki = ConsoleKey.A;

            while (ki != ConsoleKey.Q)
            {
               // Flip the auto-destroy flag
               if (ki == ConsoleKey.D) 
               {
                  tapi.AutoDestroyCalls = !tapi.AutoDestroyCalls;
                  Console.WriteLine("Set AutoDestroy to {0}", tapi.AutoDestroyCalls);
               }
               // List existing calls
               else if (ki == ConsoleKey.L)
               {
                  foreach (TCall _call in modemAddr.EnumerateCalls())
                  {
                     Console.WriteLine("Existing call found: {0}:{1}", _call, _call.GetHashCode());
                     _call.Dispose(); // Go ahead and dump it
                  }
               }
               // Create a new call
               else
               {
                  call = modemAddr.CreateCall("5551213", LINEADDRESSTYPES.PhoneNumber, TAPIMEDIATYPES.DATAMODEM);
                  Console.WriteLine("Created new call {0}:{1}", call, call.GetHashCode());
                  try
                  {
                     // This will fail if existing call interface is still around (i.e. not disposed)
                     call.Connect(false);
                  }
                  catch (TapiException ex)
                  {
                     Console.WriteLine(ex.Message);
                  }
               }
               Console.WriteLine("Press a key to try another call.. Q to quit");
               ki = …
TheBeast32 54 Posting Whiz in Training

I use Dev-C++, and that works fine with OpenGL, and Irrlicht (irrlicht.sourceforge.net), so I'm betting you could make your aquarium with that.

TheBeast32 54 Posting Whiz in Training

By "How", I mean I looked for like an hour finding only stuff about .Net, and was wondering what the code would be, what libraries I might have to get, and so on. Like I said before, I'm using Dev-C++ 4.9.9.2, so anything that could be compiled with that IDE would help me a lot.

TheBeast32 54 Posting Whiz in Training

Anyone?

TheBeast32 54 Posting Whiz in Training

Hi, I was wondering how to use TAPI in C++ to communicate with my modem. How would I accomplish this? I'm not using Visual C++. I'm using dev-c++ 4.9.9.2.

TheBeast32 54 Posting Whiz in Training
TheBeast32 54 Posting Whiz in Training

marco93, I'm reading Programming Windows by Charles Petzold, and I know about MSDN, it doesn't show every cool thing that can be done with C++. If it did, I would be completely amazed. Also, HOW IS THE CODE HORRIBLE?. BlockInput can't do everything. Compile the first code for a mouse disabler. It makes it so you can only move it in a circle. Can you do that with BlockInput?

William Hemsworth commented: nicely said :) +3
mitrmkar commented: you posed a good question there ;) +4
TheBeast32 54 Posting Whiz in Training

Wow, I thought it just disabled the mouse completely, it makes it limited to a circle. COOL. I'm gonna prank lots of people ^^.

TheBeast32 54 Posting Whiz in Training

Cool =)

TheBeast32 54 Posting Whiz in Training

I can't find it. What is the code?

TheBeast32 54 Posting Whiz in Training

Hi, I was wondering if anyone knew any code snippets that do something cool like:

Open the CD tray:

mciSendString("open CDAudio", NULL, 0, NULL);

cout << "Opening CD-ROM door ..." << endl;
mciSendString("set CDAudio door open", NULL, 0, NULL);

cout << "Closing the CD-ROM door in 5 seconds ..." << endl;
Sleep(5000);
mciSendString("set CDAudio door closed", NULL, 0, NULL);

mciSendString("close CDAudio", NULL, 0, NULL);

Turn the monitor off and on:

cout << "Turning off monitor...";
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);

cout << endl << "Turning monitor back on...";
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) -1);
William Hemsworth commented: Nice :) +3
TheBeast32 54 Posting Whiz in Training

It works doesn't it?:sad:

TheBeast32 54 Posting Whiz in Training

No, just copy the url to view the picture! you don't have to register! =)

TheBeast32 54 Posting Whiz in Training

I have to give the credit to the guy who posted this though: http://otfans.net/archive/index.php?t-21886.html.

TheBeast32 54 Posting Whiz in Training

=(

TheBeast32 54 Posting Whiz in Training

Also, TSearch is way better than ArtMoney. You can inject asm code into a program with it! =)

TheBeast32 54 Posting Whiz in Training

Prabakar, a trainer is something that lets you cheat on games. They can give you like infinite money and health and stuff.
hdan, to get a variables address in your own program do this:

#include <iostream>
#include <ostream>
#include <ios>

using namespace std;

int main()
{
          int n;
          n = 1;
          cout << &n;
          cin.get();
          return 0;
}

I have tried to do the same thing in the past. Here's the code. You need the text of the window for the program to cheat on.

#include <stdio.h>
#include <conio.h>
#include <windows.h>
#include <iostream>
using namespace std;

int Memory(char Caption[], int long Address, int Value, bool _w)
{
    DWORD PROC_ID;
    HANDLE PROC_HANDLE;

    GetWindowThreadProcessId(FindWindow(NULL, (LPCTSTR)Caption), &PROC_ID);
    PROC_HANDLE = OpenProcess(PROCESS_ALL_ACCESS, false, PROC_ID);
    if(_w)
        WriteProcessMemory(PROC_HANDLE, (LPVOID)Address, &Value, sizeof(long int), NULL);
    else
        ReadProcessMemory(PROC_HANDLE, (LPVOID)Address, &Value, sizeof(long int), NULL);
    CloseHandle(PROC_HANDLE);
    return Value;
}

int main()
{
    SetConsoleTitle("EditMemory");
    char Caption[1000];
    cout << "Enter the caption: ";
    cin.getline(Caption, 1000);
    HWND Test = FindWindow(NULL, Caption);
    if (!Test)
    {
    cout << "\nCannot find window \"" << Caption << "\"!";
    cin.get();
    return 0;
    }
    
    LPVOID Address;
    cout << "\nEnter the address: ";
    cin >> Address;
    
    int Value;
    cout << "\nEnter the value to write: ";
    cin >> Value;
    
    bool _w;
    char aChar[100];
    cout << "\nEnter 'w' to write, or 'r' to read: ";
    cin >> aChar;
    
    switch (aChar[0])
    {
       case 'w':
       _w = true;
       break;
       
       case 'r':
       _w = false;
       break;
       
       default:
       cout << "\nYou didn't enter 'w' or 'r'!";
       cin.ignore();
       cin.get();
       return 0;
       break;
    }
    cout << …
Prabakar commented: Impressive:) +1
TheBeast32 54 Posting Whiz in Training

Thanks mitrmkar. That worked perfectly!

TheBeast32 54 Posting Whiz in Training

Hi, I'm reading Programming Windows Fifth Edition by Charles Petzold. In the part I'm
reading, it talks about GDI functions. I'm trying to get the pixels that are 1 to 100 + the
mouse x coordinate and the y coorinate, then draw them on my window. It's hard to explain. I want it to make a complete copy of the 100x100 box from the mouse position. Look at my drawing:

100px
*----------
|----------|
|----------| 100px
|----------|
------------

The * is the cursor. I want to get all of the pixels, then draw them on my window. It's like a copy of what's around the mouse. I tried it, but the box just goes black then white.

#include <windows.h>
#include <stdio.h>
#define ID_TIMER 1

/*  Declare Windows procedure  */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

/*  Make the class name into a global variable  */
char szClassName[ ] = "WindowsApp";

int WINAPI WinMain (HINSTANCE hThisInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nFunsterStil)

{
    HWND hwnd;               /* This is the handle for our window */
    MSG messages;            /* Here messages to the application are saved */
    WNDCLASSEX wincl;        /* Data structure for the windowclass */

    /* The Window structure */
    wincl.hInstance = hThisInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
    wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
    wincl.cbSize = sizeof (WNDCLASSEX);

    /* Use default icon and mouse-pointer */
    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hIconSm = …
TheBeast32 54 Posting Whiz in Training

Post your resource.h Code Shark, so we can see if there's anything wrong.

TheBeast32 54 Posting Whiz in Training

1. There could be a missing semicolon in resource.h if he didn't use all #define macros, and declared something like "long something" in it. It would look weird, but there still could be one.

2. Take a look. His error is "3 C:\Dev-Cpp\lolLOLlol.cpp expected `,' or `;' before numeric constant". C:\Dev-Cpp\ is Dev-C++'s default installation directory. That must mean he's using it right? Also, I'm not saying that a C++ compiler could do that. I'm just saying that he must have an error in resource.h or something.

TheBeast32 54 Posting Whiz in Training

Dev-C++ 4.9.9.2 will compile this. I have done it before. Check your resource.h for any missing semicolons.

TheBeast32 54 Posting Whiz in Training

I think you're right. I changed the command to help. That displayed the entire thing. Thanks for the help!

TheBeast32 54 Posting Whiz in Training

I modified it a little:

strcat(command, "\n");
fputs(command, fp);

It's better, but I still can't get the ouput correctly.