Sign in to follow this  
jschorn0

error codes need help

Recommended Posts

Recently a piece of software i use was no longer being supported by the developer and he posted the source code if others wanted to keep it up. The reason he no longer wanted to support it is the game it attaches to changed there ip address to there game servers. I made the appropriate changes to server names and ip addresses. I Have successfully compiled one of the dll files, the second dll file is giving me some problems. Below is the list of error codes: dsound.cpp C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(701) : error C2061: syntax error : identifier 'LPCGUID' C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(711) : error C2065: 'LPCGUID' : undeclared identifier C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(711) : error C2146: syntax error : missing ')' before identifier 'pcGuidDevice' C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(711) : warning C4229: anachronism used : modifiers on data are ignored C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(711) : error C2373: 'DirectSoundCreate' : redefinition; different type modifiers c:\program files\microsoft visual studio\vc98\include\dsound.h(196) : see declaration of 'DirectSoundCreate' C:\Documents and Settings\User\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(711) : error C2059: syntax error : ')' C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(712) : error C2143: syntax error : missing ';' before '{' C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(712) : error C2447: missing function header (old-style formal list?) C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(752) : error C2065: 'LPDIRECTSOUND8' : undeclared identifier C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(752) : error C2065: 'ppDS8' : undeclared identifier C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(752) : error C2275: 'LPUNKNOWN' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\unknwn.h(88) : see declaration of 'LPUNKNOWN' C:\Documents and Settings\user\My Documents\Downloads\nf-fixer-source-3-21a\dsound.cpp(753) : error C2448: '<Unknown>' : function-style initializer appears to be a function definition Error executing cl.exe. Below is the code for each error. line 701 HRESULT __stdcall Initialize(LPCGUID pcGuidDevice) { HRESULT result = m_directSound->Initialize(pcGuidDevice); CheckHresult(result); Log("CMyDirectSound::Initialize %d\n", pcGuidDevice); return result; } line 711-750 HRESULT WINAPI DirectSoundCreate(LPCGUID pcGuidDevice, LPDIRECTSOUND *ppDS, LPUNKNOWN pUnkOuter) { typedef HRESULT (WINAPI * DirectSoundCreate)(LPCGUID pcGuidDevice, LPDIRECTSOUND *ppDS, LPUNKNOWN pUnkOuter); static DirectSoundCreate directSoundCreateFn = NULL; Log("DirectSoundCreate\n\n"); if (NULL == gs_realDSDll) { char buffer[MAX_PATH]; ::GetSystemDirectory(buffer,MAX_PATH); strcat(buffer,"\\dsound.dll"); gs_realDSDll = ::LoadLibrary(buffer); if (NULL == gs_realDSDll) { MessageBoxA(NULL, "Can't find dsound.dll", "Can't find dsound.dll", MB_ICONERROR); ::ExitProcess(0); // exit the hard way } directSoundCreateFn = (DirectSoundCreate)GetProcAddress(gs_realDSDll, "DirectSoundCreate"); Log("Loaded real dsound.dll, DirectSoundCreate is at %p\n", directSoundCreateFn); } LPDIRECTSOUND realDS = NULL; HRESULT result = directSoundCreateFn(pcGuidDevice, &realDS, pUnkOuter); CheckHresult(result); CMyDirectSound * myDirectSound = new CMyDirectSound(realDS); *ppDS = (IDirectSound *)myDirectSound; Log("DirectSoundCreate %d, new CMyDirectSound %p, real LPDIRECTSOUND %p\n", result, myDirectSound, realDS); return result; } line 752-759 HRESULT WINAPI DirectSoundCreate8(LPCGUID, LPDIRECTSOUND8 *ppDS8, LPUNKNOWN) { // This is called, but apparently never used Log("DirectSoundCreate8 called\n"); *ppDS8 = NULL; return DS_OK; } when i change the dsound.h file in the include directoty to the one supplied in the source code and then compile the error codes are: dsound.cpp c:\program files\microsoft visual studio\vc98\include\dsound.h(5) : error C2146: syntax error : missing ';' before identifier 'NF_Fixer_DLL_switchToNavyFieldRequested' c:\program files\microsoft visual studio\vc98\include\dsound.h(5) : fatal error C1004: unexpected end of file found Error executing cl.exe. the source code dsound.h code is #pragma once extern void NF_Fixer_DLL_readValuesFromRegistry(void); extern BOOL NF_Fixer_DLL_switchToNavyFieldRequested(void); extern void NF_Fixer_DLL_switchToNavyFieldPerformed(void); this is the second file i need to compile there is 1 more i need to do, and this file is holding me up from completing this project. Any help would greatly be apreciated

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this