Solved

How to get FtpCommand working or do chmod via FTP?

Posted on 2002-06-15
8
873 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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now