?
Solved

How to get FtpCommand working or do chmod via FTP?

Posted on 2002-06-15
8
Medium Priority
?
913 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
  • 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 1200 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

850 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