#include "stdafx.h"
#include "windows.h"
#include "string.h"
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
char szCurDir[MAX_PATH];
printf("Hello World!\n");
GetCurrentDirectory( MAX_PATH, szCurDir );
// ShellExecute(0,TEXT("open"), TEXT("test.txt"), NULL,szCurDir, 0);
ShellExecute(0,"open","test.txt",NULL,szCurDir,0);
return 0;
}
I get this error:
C:\cons\cons.cpp(16) : error C2065: 'ShellExecute' : undeclared identifier
you could have found this out easily yourself by searchig for ShellExecute in the MSDN
bye
jb
<abba> schrieb im Newsbeitrag news:93a28...@news1.newsguy.com...
> It is still doing it!
[...]
#include <shellapi.h>
--
John A. Grant * I speak only for myself * (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here
I removed the stafx include to be left with this:
#include "windows.h"
#include "string.h"
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
char szCurDir[MAX_PATH];
printf("Hello World!\n");
GetCurrentDirectory( MAX_PATH, szCurDir );
// ShellExecute(0,TEXT("open"), TEXT("test.txt"), NULL,szCurDir, 0);
ShellExecute(0,"open","test.txt",NULL,szCurDir,0);
return 0;
}
and then compiled the file using BCC++ 5.02 and this was the result:
---------------------------------------------------------------------
Zeus for Windows Programmers Editor - Version 3.50
Copyright (c) Xidicone Pty Ltd 1991-2001. All rights reserved.
---------------------------------------------------------------------
Borland C++ 5.0 for Win32 Copyright (c) 1993, 1996 Borland
c:\temp\t.cpp:
Warning c:\temp\t.cpp 14: Parameter 'argc' never used in ....
Warning c:\temp\t.cpp 14: Parameter 'argv' never used in ....
and as you can see it compiled fine.
Jussi Jumppanen
Author of: Zeus for Windows, Win32 (Brief, WordStar, Emacs) Text Editor
"The C/C++, Java, HTML, Pascal, Cobol, Fortran programmer's text editor"
http://www.zeusedit.com