Files
firestorm/Gameleap/code/mw4/Tools/findvc/findvc.cpp
T
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
2026-06-24 21:28:16 -05:00

50 lines
1.4 KiB
C++

#include <windows.h>
#include <stdio.h>
#include <string.h>
char *keyname = "ProductDir";
char *rootname = "SOFTWARE\\Microsoft\\DevStudio\\6.0\\Products\\Microsoft Visual C++";
int main (int argv,char **argc)
{
long retval;
DWORD dispos;
HKEY rootkey;
DWORD datatype;
char *data;
DWORD datasize;
FILE *thefile;
retval = RegCreateKeyEx (HKEY_LOCAL_MACHINE,(LPCSTR) rootname,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&rootkey,&dispos);
RegQueryValueEx (rootkey,keyname,0,&datatype,NULL,&datasize);
data = new char[datasize+200];
RegQueryValueEx (rootkey,keyname,0,&datatype,(unsigned char *) data,&datasize);
RegCloseKey (rootkey);
strcat (data,"\\include");
thefile = fopen ("stl_inc_find.hpp","r");
if (thefile)
return 0;
thefile = fopen ("stl_inc_find.hpp","w");
if (!thefile)
return 1;
fprintf (thefile,"#pragma once\n");
fprintf (thefile,"#ifndef __STL_INC_FINDHPP__\n");
fprintf (thefile,"#define __STL_INC_FINDHPP__\n");
fprintf (thefile,"#define __PLACEMENT_NEW_INLINE\n");
fprintf (thefile,"void *operator new(size_t, void *_P);\n");
fprintf (thefile,"#define __STL_NATIVE_HEADER(x) <%s/##x>\n",data);
fprintf (thefile,"#define __STL_NATIVE_C_HEADER(x) <%s/##x>\n",data);
fprintf (thefile,"#define __STL_NATIVE_CPP_C_HEADER(x) <%s/##x>\n",data);
fprintf (thefile,"#endif\n");
fclose (thefile);
delete[] data;
return 0;
}