this is my code in a nutshell
Code: Select all
extern char **names;
extern void *cptr;
HANDLE tmp1;
tmp1=CreateFile(*names[*cptr],GENERIC_READ,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,0);
Code: Select all
extern char **names;
extern void *cptr;
HANDLE tmp1;
tmp1=CreateFile(*names[*cptr],GENERIC_READ,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,0);
Code: Select all
int main()
{
int x = 5;
void* pVoid = &x;
int y = *pVoid;
return 0;
}
Code: Select all
int main()
{
int x = 5;
void* pVoid = &x;
int y = *((int*) pVoid);
return 0;
}
Code: Select all
names -> char **
names[x] -> char *
*names[x] -> char
Code: Select all
void rant() {
puts("Blah blah blah...");
puts("Blah blah blah...");
puts("Blah blah blah...");
puts("Blah blah blah...");
puts("Blah blah blah...");
}
int main(int argc, char **argv) {
int val;
// Here's the problem! Since rant doesn't
// return anything, I can't compare it...
if (rant() < 0) {
return 1;
}
// C won't let this happen either...
val = rant();
}
Code: Select all
extern char **names;
extern void *cptr;
HANDLE tmp1;
tmp1=CreateFile(TEXT(names[*(int*)cptr]),GENERIC_READ,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,0);
Code: Select all
#ifdef UNICODE
#define MessageBox MessageBoxW
#else
#define MessageBox MessageBoxA
#endif
Code: Select all
#ifdef UNICODE
typedef WCHAR TCHAR;
#else
typedef CHAR TCHAR;
#endif
Code: Select all
#ifdef UNICODE
typedef TCHAR WCHAR;
#else
typedef TCHAR CHAR;
#endif
eh? that's backwards, you're typedefing WCHAR/CHAR as being of the type TCHAR. According to MS:Kemp wrote: You mean
Right?Code: Select all
#ifdef UNICODE typedef TCHAR WCHAR; #else typedef TCHAR CHAR; #endif
Code: Select all
#ifdef UNICODE
typedef wchar_t TCHAR;
#else
typedef unsigned char TCHAR;
#endif
Code: Select all
#ifdef UNICODE
typedef WCHAR TCHAR,*PTCHAR;
typedef LPWSTR LPTCH,PTCH,PTSTR,LPTSTR;
typedef LPCWSTR LPCTSTR;
#else
typedef char TCHAR,*PTCHAR;
typedef LPSTR LPTCH,PTCH,PTSTR,LPTSTR;
typedef LPCSTR LPCTSTR;
#endif