Board index » cppbuilder » LONG64 issues - [was Massive Problem Solved . . .]

LONG64 issues - [was Massive Problem Solved . . .]


2003-07-30 06:41:16 PM
cppbuilder96
Chris Uzdavinis (TeamB) < XXXX@XXXXX.COM >wrote:
Quote
"Mark D" < XXXX@XXXXX.COM >writes:
Chris
Thanks for the reply.
I made that change to the imagehlp.h header. I'm not referring to LONG64 in _any_ of my code. The API call I want to use
needs that header, I #include that header and get the ambiguity
error unless LONG64 in imagehlp.h is edited to ::LONG64. On XP it AVs.
Code for this bit is pasted below. This flies on Win2K but AVs
on XP Home.
#include <vcl.h>
#pragma hdrstop
#include <imagehlp.h>
#include "Unit1.h"
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
void __fastcall TForm1::FormCreate(TObject *Sender)
{
char * root = "c:\\";
char * findit = "vtplus32.exe";
LPSTR fullpath;
BOOL gotit;
gotit= SearchTreeForFile(root, findit, fullpath);
if(gotit)
ShowMessage("Got it");
else
ShowMessage("Ain't got it");
}
If editing the system header is not the way to go, it looks I
can't use this API call. Or can anyone get SearchTreeForFile
to work on XP and 2K without editing imagehlp.h?
Thanks
Mark D
 
 

Re:LONG64 issues - [was Massive Problem Solved . . .]

Mark D wrote:
Quote
The API call I want to use
needs that header, I #include that header and get the ambiguity
error unless LONG64 in imagehlp.h is edited to ::LONG64. On XP it AVs.
Well if all is only about SearchTreeForFile() than you do not need to
include that imagehlp.h at all. The compiler only needs the declaration
for SearchTreeForFile(). So make your live a little simple with just
copy
BOOL
IMAGEAPI
SearchTreeForFile(
PSTR RootPath,
PSTR InputPathName,
PSTR OutputPathBuffer
);
from imagehlp.h and paste to your Unit1.cpp and change it in
bool
__stdcall
SearchTreeForFile(
PSTR RootPath,
PSTR InputPathName,
PSTR OutputPathBuffer );
For the rest: if all is about finding a file on your drive
you could write a snall function using FindFirst()/FindNext()
in a few lines.
Hans.