Solved

How to get FtpCommand working or do chmod via FTP?

Posted on 2002-06-15
8
882 Views
Last Modified: 2007-11-27
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.
0
Comment
Question by:Hill8982
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7080569
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?
0
 

Author Comment

by:Hill8982
ID: 7080855
That's not in my version of Wininet.

What version of VC++ do you have?

I'm using version 6.0
0
 

Author Comment

by:Hill8982
ID: 7080856
If you're using 6.0, what service pack do you have?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Accepted Solution

by:
jhance earned 300 total points
ID: 7081500
It doesn't matter what version of VC++ or what SP of VC++ you have.  The SDK is not the same as VC++.

Download the latest Windows SDK from Microsoft.

See:

http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

0
 

Author Comment

by:Hill8982
ID: 7081543
Which Windows SDK?
There are seven listed.
0
 

Author Comment

by:Hill8982
ID: 7081888
I installed all the SDK (except .NET), and I still get the same compiler error
0
 

Author Comment

by:Hill8982
ID: 7081897
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?
0
 
LVL 30

Expert Comment

by:Axter
ID: 7081933
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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question