Question

I can't seem to get this code to execute...... can somone show me how?.... it keeps looking for an executable ....?

Asked by: VWrestle97

MD5ChecksumDefines.h
=======================================================================================================================
//Magic initialization constants
#define MD5_INIT_STATE_0 0x67452301
#define MD5_INIT_STATE_1 0xefcdab89
#define MD5_INIT_STATE_2 0x98badcfe
#define MD5_INIT_STATE_3 0x10325476

//Constants for Transform routine.
#define MD5_S11  7
#define MD5_S12 12
#define MD5_S13 17
#define MD5_S14 22
#define MD5_S21  5
#define MD5_S22  9
#define MD5_S23 14
#define MD5_S24 20
#define MD5_S31  4
#define MD5_S32 11
#define MD5_S33 16
#define MD5_S34 23
#define MD5_S41  6
#define MD5_S42 10
#define MD5_S43 15
#define MD5_S44 21

//Transformation Constants - Round 1
#define MD5_T01  0xd76aa478 //Transformation Constant 1
#define MD5_T02  0xe8c7b756 //Transformation Constant 2
#define MD5_T03  0x242070db //Transformation Constant 3
#define MD5_T04  0xc1bdceee //Transformation Constant 4
#define MD5_T05  0xf57c0faf //Transformation Constant 5
#define MD5_T06  0x4787c62a //Transformation Constant 6
#define MD5_T07  0xa8304613 //Transformation Constant 7
#define MD5_T08  0xfd469501 //Transformation Constant 8
#define MD5_T09  0x698098d8 //Transformation Constant 9
#define MD5_T10  0x8b44f7af //Transformation Constant 10
#define MD5_T11  0xffff5bb1 //Transformation Constant 11
#define MD5_T12  0x895cd7be //Transformation Constant 12
#define MD5_T13  0x6b901122 //Transformation Constant 13
#define MD5_T14  0xfd987193 //Transformation Constant 14
#define MD5_T15  0xa679438e //Transformation Constant 15
#define MD5_T16  0x49b40821 //Transformation Constant 16

//Transformation Constants - Round 2
#define MD5_T17  0xf61e2562 //Transformation Constant 17
#define MD5_T18  0xc040b340 //Transformation Constant 18
#define MD5_T19  0x265e5a51 //Transformation Constant 19
#define MD5_T20  0xe9b6c7aa //Transformation Constant 20
#define MD5_T21  0xd62f105d //Transformation Constant 21
#define MD5_T22  0x02441453 //Transformation Constant 22
#define MD5_T23  0xd8a1e681 //Transformation Constant 23
#define MD5_T24  0xe7d3fbc8 //Transformation Constant 24
#define MD5_T25  0x21e1cde6 //Transformation Constant 25
#define MD5_T26  0xc33707d6 //Transformation Constant 26
#define MD5_T27  0xf4d50d87 //Transformation Constant 27
#define MD5_T28  0x455a14ed //Transformation Constant 28
#define MD5_T29  0xa9e3e905 //Transformation Constant 29
#define MD5_T30  0xfcefa3f8 //Transformation Constant 30
#define MD5_T31  0x676f02d9 //Transformation Constant 31
#define MD5_T32  0x8d2a4c8a //Transformation Constant 32

//Transformation Constants - Round 3
#define MD5_T33  0xfffa3942 //Transformation Constant 33
#define MD5_T34  0x8771f681 //Transformation Constant 34
#define MD5_T35  0x6d9d6122 //Transformation Constant 35
#define MD5_T36  0xfde5380c //Transformation Constant 36
#define MD5_T37  0xa4beea44 //Transformation Constant 37
#define MD5_T38  0x4bdecfa9 //Transformation Constant 38
#define MD5_T39  0xf6bb4b60 //Transformation Constant 39
#define MD5_T40  0xbebfbc70 //Transformation Constant 40
#define MD5_T41  0x289b7ec6 //Transformation Constant 41
#define MD5_T42  0xeaa127fa //Transformation Constant 42
#define MD5_T43  0xd4ef3085 //Transformation Constant 43
#define MD5_T44  0x04881d05 //Transformation Constant 44
#define MD5_T45  0xd9d4d039 //Transformation Constant 45
#define MD5_T46  0xe6db99e5 //Transformation Constant 46
#define MD5_T47  0x1fa27cf8 //Transformation Constant 47
#define MD5_T48  0xc4ac5665 //Transformation Constant 48

//Transformation Constants - Round 4
#define MD5_T49  0xf4292244 //Transformation Constant 49
#define MD5_T50  0x432aff97 //Transformation Constant 50
#define MD5_T51  0xab9423a7 //Transformation Constant 51
#define MD5_T52  0xfc93a039 //Transformation Constant 52
#define MD5_T53  0x655b59c3 //Transformation Constant 53
#define MD5_T54  0x8f0ccc92 //Transformation Constant 54
#define MD5_T55  0xffeff47d //Transformation Constant 55
#define MD5_T56  0x85845dd1 //Transformation Constant 56
#define MD5_T57  0x6fa87e4f //Transformation Constant 57
#define MD5_T58  0xfe2ce6e0 //Transformation Constant 58
#define MD5_T59  0xa3014314 //Transformation Constant 59
#define MD5_T60  0x4e0811a1 //Transformation Constant 60
#define MD5_T61  0xf7537e82 //Transformation Constant 61
#define MD5_T62  0xbd3af235 //Transformation Constant 62
#define MD5_T63  0x2ad7d2bb //Transformation Constant 63
#define MD5_T64  0xeb86d391 //Transformation Constant 64


//Null data (except for first BYTE) used to finalise the checksum calculation
static unsigned char PADDING[64] = {
  0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

==========================================================================================================================
resource.h
==========================================================================================================================
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by MD5.rc
//

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        101
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1000
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif
============================================================================================================================
StdAfx.h
============================================================================================================================
// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#if !defined(AFX_STDAFX_H__EA97A192_032A_11D4_A4DA_000000000000__INCLUDED_)
#define AFX_STDAFX_H__EA97A192_032A_11D4_A4DA_000000000000__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN            // Exclude rarely-used stuff from Windows headers

#include <afx.h>
#include <afxwin.h>

// TODO: reference additional headers your program requires here

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__EA97A192_032A_11D4_A4DA_000000000000__INCLUDED_)
============================================================================================================================
MD5Checksum.cpp
============================================================================================================================
#include "stdafx.h"
#include "MD5Checksum.h"
#include "MD5ChecksumDefines.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif


CString CMD5Checksum::GetMD5(const CString& strFilePath)
{
      //open the file as a binary file in readonly mode, denying write access
      CFile File(strFilePath, CFile::modeRead | CFile::shareDenyWrite | CFile::typeBinary);

      //the file has been successfully opened, so now get and return its checksum
      return GetMD5(File);
}


CString CMD5Checksum::GetMD5(CFile& File)
{
      try
      {
            CMD5Checksum MD5Checksum;            //checksum object      
            int nLength = 0;                        //number of bytes read from the file
            const int nBufferSize = 1024;      //checksum the file in blocks of 1024 bytes
            BYTE Buffer[nBufferSize];            //buffer for data read from the file

            //checksum the file in blocks of 1024 bytes
            while ((nLength = File.Read( Buffer, nBufferSize )) > 0 )
            {
                  MD5Checksum.Update( Buffer, nLength );
            }

            //finalise the checksum and return it
            return MD5Checksum.Final();
      }

      //report any file exceptions in debug mode only
      catch (CFileException* e )
      {
            TRACE0("CMD5Checksum::GetMD5: CFileException caught");      
            throw e;
      }
}


CString CMD5Checksum::GetMD5(BYTE* pBuf, UINT nLength)
{
      //entry invariants
      AfxIsValidAddress(pBuf,nLength,FALSE);

      //calculate and return the checksum
      CMD5Checksum MD5Checksum;
      MD5Checksum.Update( pBuf, nLength );
      return MD5Checksum.Final();
}


DWORD CMD5Checksum::RotateLeft(DWORD x, int n)
{
      //check that DWORD is 4 bytes long - true in Visual C++ 6 and 32 bit Windows
      ASSERT( sizeof(x) == 4 );

      //rotate and return x
      return (x << n) | (x >> (32-n));
}


void CMD5Checksum::FF( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
      DWORD F = (B & C) | (~B & D);
      A += F + X + T;
      A = RotateLeft(A, S);
      A += B;
}


void CMD5Checksum::GG( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
      DWORD G = (B & D) | (C & ~D);
      A += G + X + T;
      A = RotateLeft(A, S);
      A += B;
}


void CMD5Checksum::HH( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
      DWORD H = (B ^ C ^ D);
      A += H + X + T;
      A = RotateLeft(A, S);
      A += B;
}


void CMD5Checksum::II( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
      DWORD I = (C ^ (B | ~D));
      A += I + X + T;
      A = RotateLeft(A, S);
      A += B;
}



void CMD5Checksum::ByteToDWord(DWORD* Output, BYTE* Input, UINT nLength)
{
      //entry invariants
      ASSERT( nLength % 4 == 0 );
      ASSERT( AfxIsValidAddress(Output, nLength/4, TRUE) );
      ASSERT( AfxIsValidAddress(Input, nLength, FALSE) );

      //initialisations
      UINT i=0;      //index to Output array
      UINT j=0;      //index to Input array

      //transfer the data by shifting and copying
      for ( ; j < nLength; i++, j += 4)
      {
            Output[i] = (ULONG)Input[j]                  |
                              (ULONG)Input[j+1] << 8      |
                              (ULONG)Input[j+2] << 16 |
                              (ULONG)Input[j+3] << 24;
      }
}

void CMD5Checksum::Transform(BYTE Block[64])
{
      //initialise local data with current checksum
      ULONG a = m_lMD5[0];
      ULONG b = m_lMD5[1];
      ULONG c = m_lMD5[2];
      ULONG d = m_lMD5[3];

      //copy BYTES from input 'Block' to an array of ULONGS 'X'
      ULONG X[16];
      ByteToDWord( X, Block, 64 );

      //Perform Round 1 of the transformation
      FF (a, b, c, d, X[ 0], MD5_S11, MD5_T01);
      FF (d, a, b, c, X[ 1], MD5_S12, MD5_T02);
      FF (c, d, a, b, X[ 2], MD5_S13, MD5_T03);
      FF (b, c, d, a, X[ 3], MD5_S14, MD5_T04);
      FF (a, b, c, d, X[ 4], MD5_S11, MD5_T05);
      FF (d, a, b, c, X[ 5], MD5_S12, MD5_T06);
      FF (c, d, a, b, X[ 6], MD5_S13, MD5_T07);
      FF (b, c, d, a, X[ 7], MD5_S14, MD5_T08);
      FF (a, b, c, d, X[ 8], MD5_S11, MD5_T09);
      FF (d, a, b, c, X[ 9], MD5_S12, MD5_T10);
      FF (c, d, a, b, X[10], MD5_S13, MD5_T11);
      FF (b, c, d, a, X[11], MD5_S14, MD5_T12);
      FF (a, b, c, d, X[12], MD5_S11, MD5_T13);
      FF (d, a, b, c, X[13], MD5_S12, MD5_T14);
      FF (c, d, a, b, X[14], MD5_S13, MD5_T15);
      FF (b, c, d, a, X[15], MD5_S14, MD5_T16);

      //Perform Round 2 of the transformation
      GG (a, b, c, d, X[ 1], MD5_S21, MD5_T17);
      GG (d, a, b, c, X[ 6], MD5_S22, MD5_T18);
      GG (c, d, a, b, X[11], MD5_S23, MD5_T19);
      GG (b, c, d, a, X[ 0], MD5_S24, MD5_T20);
      GG (a, b, c, d, X[ 5], MD5_S21, MD5_T21);
      GG (d, a, b, c, X[10], MD5_S22, MD5_T22);
      GG (c, d, a, b, X[15], MD5_S23, MD5_T23);
      GG (b, c, d, a, X[ 4], MD5_S24, MD5_T24);
      GG (a, b, c, d, X[ 9], MD5_S21, MD5_T25);
      GG (d, a, b, c, X[14], MD5_S22, MD5_T26);
      GG (c, d, a, b, X[ 3], MD5_S23, MD5_T27);
      GG (b, c, d, a, X[ 8], MD5_S24, MD5_T28);
      GG (a, b, c, d, X[13], MD5_S21, MD5_T29);
      GG (d, a, b, c, X[ 2], MD5_S22, MD5_T30);
      GG (c, d, a, b, X[ 7], MD5_S23, MD5_T31);
      GG (b, c, d, a, X[12], MD5_S24, MD5_T32);

      //Perform Round 3 of the transformation
      HH (a, b, c, d, X[ 5], MD5_S31, MD5_T33);
      HH (d, a, b, c, X[ 8], MD5_S32, MD5_T34);
      HH (c, d, a, b, X[11], MD5_S33, MD5_T35);
      HH (b, c, d, a, X[14], MD5_S34, MD5_T36);
      HH (a, b, c, d, X[ 1], MD5_S31, MD5_T37);
      HH (d, a, b, c, X[ 4], MD5_S32, MD5_T38);
      HH (c, d, a, b, X[ 7], MD5_S33, MD5_T39);
      HH (b, c, d, a, X[10], MD5_S34, MD5_T40);
      HH (a, b, c, d, X[13], MD5_S31, MD5_T41);
      HH (d, a, b, c, X[ 0], MD5_S32, MD5_T42);
      HH (c, d, a, b, X[ 3], MD5_S33, MD5_T43);
      HH (b, c, d, a, X[ 6], MD5_S34, MD5_T44);
      HH (a, b, c, d, X[ 9], MD5_S31, MD5_T45);
      HH (d, a, b, c, X[12], MD5_S32, MD5_T46);
      HH (c, d, a, b, X[15], MD5_S33, MD5_T47);
      HH (b, c, d, a, X[ 2], MD5_S34, MD5_T48);

      //Perform Round 4 of the transformation
      II (a, b, c, d, X[ 0], MD5_S41, MD5_T49);
      II (d, a, b, c, X[ 7], MD5_S42, MD5_T50);
      II (c, d, a, b, X[14], MD5_S43, MD5_T51);
      II (b, c, d, a, X[ 5], MD5_S44, MD5_T52);
      II (a, b, c, d, X[12], MD5_S41, MD5_T53);
      II (d, a, b, c, X[ 3], MD5_S42, MD5_T54);
      II (c, d, a, b, X[10], MD5_S43, MD5_T55);
      II (b, c, d, a, X[ 1], MD5_S44, MD5_T56);
      II (a, b, c, d, X[ 8], MD5_S41, MD5_T57);
      II (d, a, b, c, X[15], MD5_S42, MD5_T58);
      II (c, d, a, b, X[ 6], MD5_S43, MD5_T59);
      II (b, c, d, a, X[13], MD5_S44, MD5_T60);
      II (a, b, c, d, X[ 4], MD5_S41, MD5_T61);
      II (d, a, b, c, X[11], MD5_S42, MD5_T62);
      II (c, d, a, b, X[ 2], MD5_S43, MD5_T63);
      II (b, c, d, a, X[ 9], MD5_S44, MD5_T64);

      //add the transformed values to the current checksum
      m_lMD5[0] += a;
      m_lMD5[1] += b;
      m_lMD5[2] += c;
      m_lMD5[3] += d;
}


CMD5Checksum::CMD5Checksum()
{
      // zero members
      memset( m_lpszBuffer, 0, 64 );
      m_nCount[0] = m_nCount[1] = 0;

      // Load magic state initialization constants
      m_lMD5[0] = MD5_INIT_STATE_0;
      m_lMD5[1] = MD5_INIT_STATE_1;
      m_lMD5[2] = MD5_INIT_STATE_2;
      m_lMD5[3] = MD5_INIT_STATE_3;
}


void CMD5Checksum::DWordToByte(BYTE* Output, DWORD* Input, UINT nLength )
{
      //entry invariants
      ASSERT( nLength % 4 == 0 );
      ASSERT( AfxIsValidAddress(Output, nLength, TRUE) );
      ASSERT( AfxIsValidAddress(Input, nLength/4, FALSE) );

      //transfer the data by shifting and copying
      UINT i = 0;
      UINT j = 0;
      for ( ; j < nLength; i++, j += 4)
      {
            Output[j] =   (UCHAR)(Input[i] & 0xff);
            Output[j+1] = (UCHAR)((Input[i] >> 8) & 0xff);
            Output[j+2] = (UCHAR)((Input[i] >> 16) & 0xff);
            Output[j+3] = (UCHAR)((Input[i] >> 24) & 0xff);
      }
}



CString CMD5Checksum::Final()
{
      //Save number of bits
      BYTE Bits[8];
      DWordToByte( Bits, m_nCount, 8 );

      //Pad out to 56 mod 64.
      UINT nIndex = (UINT)((m_nCount[0] >> 3) & 0x3f);
      UINT nPadLen = (nIndex < 56) ? (56 - nIndex) : (120 - nIndex);
      Update( PADDING, nPadLen );

      //Append length (before padding)
      Update( Bits, 8 );

      //Store final state in 'lpszMD5'
      const int nMD5Size = 16;
      unsigned char lpszMD5[ nMD5Size ];
      DWordToByte( lpszMD5, m_lMD5, nMD5Size );

      //Convert the hexadecimal checksum to a CString
      CString strMD5;
      for ( int i=0; i < nMD5Size; i++)
      {
            CString Str;
            if (lpszMD5[i] == 0) {
                  Str = CString("00");
            }
            else if (lpszMD5[i] <= 15)       {
                  Str.Format("0%x",lpszMD5[i]);
            }
            else {
                  Str.Format("%x",lpszMD5[i]);
            }

            ASSERT( Str.GetLength() == 2 );
            strMD5 += Str;
      }
      ASSERT( strMD5.GetLength() == 32 );
      return strMD5;
}


void CMD5Checksum::Update( BYTE* Input,      ULONG nInputLen )
{
      //Compute number of bytes mod 64
      UINT nIndex = (UINT)((m_nCount[0] >> 3) & 0x3F);

      //Update number of bits
      if ( ( m_nCount[0] += nInputLen << 3 )  <  ( nInputLen << 3) )
      {
            m_nCount[1]++;
      }
      m_nCount[1] += (nInputLen >> 29);

      //Transform as many times as possible.
      UINT i=0;            
      UINT nPartLen = 64 - nIndex;
      if (nInputLen >= nPartLen)       
      {
            memcpy( &m_lpszBuffer[nIndex], Input, nPartLen );
            Transform( m_lpszBuffer );
            for (i = nPartLen; i + 63 < nInputLen; i += 64)
            {
                  Transform( &Input[i] );
            }
            nIndex = 0;
      }
      else
      {
            i = 0;
      }

      // Buffer remaining input
      memcpy( &m_lpszBuffer[nIndex], &Input[i], nInputLen-i);
}

===========================================================================================================================
MD5Checksum.h
===========================================================================================================================
#if !defined(AFX_MD5CHECKSUM_H__2BC7928E_4C15_11D3_B2EE_A4A60E20D2C3__INCLUDED_)
#define AFX_MD5CHECKSUM_H__2BC7928E_4C15_11D3_B2EE_A4A60E20D2C3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CMD5Checksum  
{
public:
      //interface functions for the RSA MD5 calculation
      static CString GetMD5(BYTE* pBuf, UINT nLength);
      static CString GetMD5(CFile& File);
      static CString GetMD5(const CString& strFilePath);

protected:
      //constructor/destructor
      CMD5Checksum();
      virtual ~CMD5Checksum() {};

      //RSA MD5 implementation
      void Transform(BYTE Block[64]);
      void Update(BYTE* Input, ULONG nInputLen);
      CString Final();
      inline DWORD RotateLeft(DWORD x, int n);
      inline void FF( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
      inline void GG( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
      inline void HH( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
      inline void II( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);

      //utility functions
      inline void DWordToByte(BYTE* Output, DWORD* Input, UINT nLength);
      inline void ByteToDWord(DWORD* Output, BYTE* Input, UINT nLength);

private:
      BYTE  m_lpszBuffer[64];            //input buffer
      ULONG m_nCount[2];                  //number of bits, modulo 2^64 (lsb first)
      ULONG m_lMD5[4];                  //MD5 checksum
};

#endif // !defined(AFX_MD5CHECKSUM_H__2BC7928E_4C15_11D3_B2EE_A4A60E20D2C3__INCLUDED_)
==============================================================================================================================
StdAfx.cpp
==============================================================================================================================

// stdafx.cpp : source file that includes just the standard includes
//      MD5.pch will be the pre-compiled header
//      stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"
===========================================================================================================================








This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-08-25 at 06:03:27ID20719151
Tags

cmd5checksum

Topic

C++ Programming Language

Participating Experts
3
Points
500
Comments
9

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Assert or ???
    I found a snippet of code on the internet which fits what i need. however, within the code snippet is: Assert( Assigned( tv )); Assert( Assigned( S )); Since i am using delphi 2 to produce my program it does not compile with these statements. Anyone care to explain thei...
  2. Assertion Failure
    I keep getting assertion failures what are they and how do i stiop this happening thamks
  3. CSingleLock Assertion Error?
    Hi - What causes this code in MTEX.CPP to fail: ------------------ BOOL CSingleLock::Lock(DWORD dwTimeOut /* = INFINITE */) { ASSERT(m_pObject != NULL || m_hObject != NULL); ASSERT(!m_bAcquired); m_bAcquired = m_pObject->Lock(dwTimeOut); return m_bAcquired; } -------...
  4. void value..
    Hi, I want to do some thing like this... void func(); void test() { if((int)func()+1) printf("done"); } As you can see I want to execute the func() and after its done I want to print a string.. func() is in a library, I can't change its return type. func() ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: jkrPosted on 2003-08-25 at 06:18:33ID: 9215924

>>it keeps looking for an executable ....?

It woud be helpful if you could tell what actually is the problem...

 

by: norsethomasPosted on 2003-08-25 at 06:59:47ID: 9216209


"Keeps looking .....', VWrestle97, where is your main()
routine? What does your VS say, when you just try to
compile your module by "Build->Compile" ?

Thomas

 

by: smitty1276Posted on 2003-08-25 at 09:50:37ID: 9217484

You can't post 20 pages of code and not even give error message.

 

by: VWrestle97Posted on 2003-08-25 at 16:26:01ID: 9220153

there is no Error.... I just don't know how to execute it.... I think that this is an MFC
I don't know how to create my own executable from the program (an executable already exists but I want to create my own and it doesn't get created when I try executing the project-- it just compiles with no errors)
I just got this code from the "code" directory of a project
How do you create an Executable..... is there supposed to be a main?.   ... cause it is does not exist in any of the above files.  
Am I supposed to include code from the "Release" or "Test" directories?  if so... what is the proper way of including them... cause I already tried and I am still having problems

 

by: VWrestle97Posted on 2003-08-25 at 16:42:51ID: 9220241

I get an error when I have the setting in C++ "Code Generation" set to "Debug Multithreaded"................

--------------------Configuration: MD5Checksum - Win32 Debug--------------------
Compiling...
MD5Checksum.cpp
StdAfx.cpp
Linking...
libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/MD5Checksum.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

MD5Checksum.exe - 2 error(s), 0 warning(s)

 

by: VWrestle97Posted on 2003-08-25 at 16:44:25ID: 9220249

I get another error if I change the Project settings to "Debug Multithreaded DLL"..................

--------------------Configuration: MD5Checksum - Win32 Debug--------------------
Compiling...
MD5Checksum.cpp
StdAfx.cpp
Linking...
nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
msvcrtd.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
Debug/MD5Checksum.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

MD5Checksum.exe - 7 error(s), 0 warning(s)

 

by: norsethomasPosted on 2003-08-25 at 21:45:04ID: 9221373

Debug Multithreaded is ok.

As I guessed, the main routine is missing. You must
have something like


int main()
{
     int nResult = 0;

      // ....

      return nResult ;
}


in your code. The .... is the code that uses your class ...

 

by: norsethomasPosted on 2003-08-25 at 22:25:03ID: 9221481


Addon:

>I just got this code from the "code" directory of a project
>How do you create an Executable..... is there supposed to be a main?.  

Yes, a program like yours - which is not an DLL or other kind of library
or object file - is supposed to have a routine that is called main, which
is the entry point to the program.

Depending on the compiler, the signature of main routine can be different

int main()
int main(int argc, char** argv)
int main(int argc, char** argv, char** envp)
void main()
void main(int argc, char** argv)
void main(int argc, char** argv, char** envp)
...

but int main() and int main(int argc, char** argv) should work with your
Microsoft compiler.

>... cause it is does not exist in any of the above files.  

Well, if it doesnt exist, then most probably you havent got all source files...
A main is required to compile an executable.


Thomas

 

by: norsethomasPosted on 2003-09-04 at 23:21:07ID: 9293741

So VWrestle97 , what's going on ?

Thomas

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...