|
|
this is the code:
#include "stdafx.h"<br />
#include "wininet.h"<br />
<br />
wchar_t *lpszAgent;<br />
wchar_t *server = L"aaaa.t35.com";<br />
wchar_t *username = L"aaaaaaaa.t35.com";<br />
wchar_t *password = L"gaaaaa";<br />
wchar_t upFileName[] = L"test.txt";<br />
wchar_t dir[] = L"test";<br />
HINTERNET hInternet;<br />
HINTERNET ftp;<br />
<br />
void upload(void);<br />
<br />
<br />
<br />
int APIENTRY _tWinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance,<br />
LPTSTR lpCmdLine,<br />
int nCmdShow)<br />
{<br />
upload();<br />
return 1;<br />
}<br />
<br />
void upload()<br />
{<br />
<br />
<br />
<br />
hInternet = InternetOpen( NULL, 1, NULL , NULL,1);<br />
<br />
ftp = InternetConnect(hInternet, server,21, username, password, 1,1,1);<br />
FtpCreateDirectory( ftp, dir );<br />
FtpSetCurrentDirectory(ftp, dir);<br />
<br />
FtpPutFile( ftp, upFileName,upFileName,2, NULL);<br />
<br />
InternetCloseHandle(ftp);<br />
InternetCloseHandle( hInternet);<br />
<br />
<br />
}
but i get these error no matter i tried in many computer (which installs both Visual studio 98 and Visual studio 2005), i dont' know why? can't any one help me?
Error 7 error LNK2019: unresolved external symbol __imp__InternetCloseHandle@4 referenced in function "void __cdecl upload(void)" (?upload@@YAXXZ) et.obj <br />
<br />
Error 8 error LNK2019: unresolved external symbol __imp__FtpPutFileW@20 referenced in function "void __cdecl upload(void)" (?upload@@YAXXZ) et.obj <br />
<br />
Error 9 error LNK2019: unresolved external symbol __imp__FtpSetCurrentDirectoryW@8 referenced in function "void __cdecl upload(void)" (?upload@@YAXXZ) et.obj <br />
<br />
Error 10 error LNK2019: unresolved external symbol __imp__FtpCreateDirectoryW@8 referenced in function "void __cdecl upload(void)" (?upload@@YAXXZ) et.obj <br />
<br />
Error 11 error LNK2019: unresolved external symbol __imp__InternetConnectW@32 referenced in function "void __cdecl upload(void)" (?upload@@YAXXZ) et.obj <br />
<br />
Error 12 error LNK2019: unresolved external symbol __imp__InternetOpenW@20 referenced in function "void __cdecl upload(void)" (?upload@@YAXXZ) et.obj <br />
<br />
Error 13 fatal error LNK1120: 6 unresolved externals D:\My Documents\Visual Studio 2005\Projects\et\Debug\et.exe 1
-- modified at 7:16 Friday 16th June, 2006
|
|
|
|
|
In the additional lib's have you specified Wininet.lib?
You also need to include the file wininet.h in the file where you are using the API functions.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You also need to include the file wininet.h in the file where you are using the API functions.
--> does it mean i have to include wininet.h in the "upload" funtion?
|
|
|
|
|
As it seems, that's not the problem.
The errors you get are all link errors, so they originates from not linking wininet.lib
|
|
|
|
|
but i need detail solution? can you or anyone help me ? please!
|
|
|
|
|
If you got VC 6 (as me), do this:
1.
Press AltF7 to get to "Project"->"Settings"
2.
In the left window (top), select "All Configurations"
3.
Click on the "Link" tab
4.
Select "Category" Input
5.
In the edit line under "Object/Library modules", go to the end of the line.
6.
write a space, followed by wininet.lib
7.
Click the "OK" button
Build (or rebuild) the project.
|
|
|
|
|
Have you Selected the proper project. Because after including the files Wininet.h and Wininet.lib the program runs perfectly well.
And if you don't include it It will give the errors as you have described
Cheers
"Peace of mind through Technology"
|
|
|
|
|
stupidmistakez wrote: but i need detail solution? can you or anyone help me ? please!
Just add the following in your Stdafx.h header file
#pragma comment(lib, "wininet");
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Of course. I'm using it all the time, and still I forgot when I wrote my answer
|
|
|
|
|
kakan wrote: Of course. I'm using it all the time, and still I forgot when I wrote my answer
Remember next time
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I promise
|
|
|
|
|
Open the Properties dialog of your project and go to Linker --> Input --> Additional Dependencies fiels. Type here "Wininet.lib" (use space as separator, if there are other items). Repeat this for Debug and Release configurations. Then try to build the project.
The libraries and headers you need usually are described in the documentation.
Hope it helps.
|
|
|
|
|
No you only need to include the wininet.h file where you are using the API functions at the top where you are including rest of the files
Alternatively you can include this wininet.h file in the stdafx.h file if you are using this API at various places in your project
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
plz tell me how to open a dialog box from another dialog box using MFC in a way that control can be transfered from one dialog to another simultaneously.
|
|
|
|
|
Create the second dialog box as a Modeless one.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
If you need to interact with both, make the second dialog modeless. Otherwise, if you don't need to interact with the first dialog while the second dialog is active, make the second dialog modal.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to place a bitmap on the other side of the toolbar which is always empty.how can i use this place.
E-Ramu
|
|
|
|
|
Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
objective: my objective is to write a code that has gui buttons, just by simply drag and drop i have to create a flow chart(same as the controls what we use in MFC). Does any one know how to do it. Help me.
KIRAN PINJARLA
|
|
|
|
|
See Here[^]
Cheers
"Peace of mind through Technology"
|
|
|
|
|
My first suggestion would be to break this problem down into several, smaller ones (e.g., one project with GUI buttons, one project that supports drag-and-drop, one project that allows drawing flowcharts). Solve them each individually, and then solve the project as a whole.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello
In Visaul Studio, I create a button in childview by CButton.create. Then I run the PPC emulator. I use the button in childview and the left key in navigation control set to call the specified function. When I press the left key, I can use the WM_KeyDown to call the specified. Then I pree the button, I can use
the OnCommand to call the specified function. Once I press the left key, but
I can't get the WM_KeyDown message.
What function or what setting are necessary to solve the question.
Thanks a lot
1
|
|
|
|
|
hi there,
which is the best way to add class objects at
program (c++) run-time?
thanx,
di troia
|
|
|
|
|
Uuuh ??
What do you mean by 'adding a class at runtime' ? You can't do such a thing (not directly I mean)
Cédric Moonen
Software developer
Charting control
|
|
|
|