Link to home
Start Free TrialLog in
Avatar of Hill8982
Hill8982

asked on

How to get FtpCommand working or do chmod via FTP?

How to get FtpCommand working?
I can't seem to compile this function.

I've added #include <Wininet.h>, and I added Wininet.lib to my project settings, but I still get the following compiler error:
error C2065: 'FtpCommand' : undeclared identifier

If this command is not functional, how can I do a chmod command via FTP using Wininet functions or CFtpConnection class?

I'm compiling to NT and Win98.
Avatar of jhance
jhance

I find the following in WININET.H:

BOOLAPI FtpCommandA(
    IN HINTERNET hConnect,
    IN BOOL fExpectResponse,
    IN DWORD dwFlags,
    IN LPCSTR lpszCommand,
    IN DWORD_PTR dwContext,
    OUT HINTERNET *phFtpCommand OPTIONAL
    );
BOOLAPI FtpCommandW(
    IN HINTERNET hConnect,
    IN BOOL fExpectResponse,
    IN DWORD dwFlags,
    IN LPCWSTR lpszCommand,
    IN DWORD_PTR dwContext,
    OUT HINTERNET *phFtpCommand OPTIONAL
    );
#ifdef UNICODE
#define FtpCommand  FtpCommandW
#else
#define FtpCommand  FtpCommandA
#endif // !UNICODE

I think that the problem is:

1) You are not properly including WININET.H in your build.
2) Your SDK header files are incorrect or out-of-date.

Have you checked YOUR WININET.H to verify that this declaration is present?
Avatar of Hill8982

ASKER

That's not in my version of Wininet.

What version of VC++ do you have?

I'm using version 6.0
If you're using 6.0, what service pack do you have?
ASKER CERTIFIED SOLUTION
Avatar of jhance
jhance

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Which Windows SDK?
There are seven listed.
I installed all the SDK (except .NET), and I still get the same compiler error
I found the path for the new wininet.h in this path
C:\Program Files\Microsoft SDK\include

And the new lib is in this path
C:\Program Files\Microsoft SDK\Lib

So how do I get VC++ to see the new header and libs over the old?

Shouldn't this have been done automatically when installing the new SDK?
Avatar of Axter
Go to Tools->Options
Select directories
Add the following:
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE
Move the newly added directory to the top of the list, by using the little arrows.

Change the "Show directories for" field to LIBRARY-FILES
Then add the following to the list:
c:\PROGRAM FILES\MICROSOFT SDK\LIB
Again, move then newly added directory to the top of the list.

That should do it.