|
Dear all
I would like to introduce myself first, Omar Ali, MSc student in the research stage, college of Engineering, Baghdad University, Iraq.I am making research on (Active Networking System- Security of Active Networks).I found out throughout my research that I need FTP client under windows to help me accomplishing my research.
I request your kind assistance to help providing me with answer to the following question about "TJFTP" software.
"After a successful compilation under MS VC++6 compiler, the linker is failed in linking the source code files. The linking result is shown below:
Output Window
Compiling resources...
Compiling...
tjftpdoc.cpp
csock.cpp
ftpconnect.cpp
mainfrm.cpp
f:\c projects\tjftp_src\mainfrm.cpp(122) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
f:\c projects\tjftp_src\mainfrm.cpp(123) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
stdafx.cpp
tjftp.cpp
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
libcd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/TJFTPtest.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Results
TJFTPtest.exe - 4 error(s), 2 warning(s)
What is the problem please? I need correct building of the TJFTP code. I would like to make some modifications to the original TJFTP software (security, for example). I will, surely, refer to the original TJFTP author and site in references of my thesis. "
Knowing that I have been visited your site and find it related (in some cases) to my research.
Your kind assistance in providing me with answers to this question will help me allot to tackle and overcome the problems I am facing in my research.
I highly appreciate your kind assistance. With best regards.
MSc student
O. Ali
Iraq
|
|
|
|
|
Did the demo project and/or source that you downloaded include a project file or solution file?
If so, are you using those?
Make sure the project settings are set to build a multithreaded application.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Did you set /MT for your program?
|
|
|
|
|
Hello
I am writing below code for reading file from disk, But again agian
i am getted failed.
CString str;
CString strLine = "";
CString buffer = "";
CFileDialog Obj(TRUE);
if(Obj.DoModal() ==IDC_BUTTON3)
{
m_Upload = Obj.GetFileName();
}
str.Empty();
str = Obj.GetPathName();
SetDlgItemText(IDC_EDIT1,str);
CStdioFile fileObj;
fileObj.Open("str", CFile::modeRead | CFile::shareDenyWrite);
while(fileObj.ReadString(strLine))
{
fileObj.ReadString(strLine);
buffer += strLine + "\r\n";
}
fileObj.Close();
MessageBox(buffer);
can any one in this community soly this problem .
Regard's
Kaushik
|
|
|
|
|
fileObj.Open("str", CFile::modeRead | CFile::shareDenyWrite);
remove these double quotation mark from str n then try it
fileObj.Open(str, CFile::modeRead | CFile::shareDenyWrite);
|
|
|
|
|
Thanks you so much Sir.
Again thank you. ( it was realy silly mistake by me)
Can you told me how we copy this file to another folder.
Actually i am writing a program in which user can browse .doc and .txt file from Harddisk and save it in database.
Now : i am doing to save .doc or .txt file in a folder on local PC and its name save in database.
I can save its name in database . I am unable to save file in to folder
if you can plz help me
Regard's
Kaushik
|
|
|
|
|
if you want to make a copy of this file in another folder
you have to create a new file using open function and passing the name in 1st parameter then passing second parameter as CFile::modeCreate....
then you read content of already created file an write in this newly created file ......
and your database point is not clear to me...
|
|
|
|
|
suppose new file name is temp. and i want to copy it to UserFile (UserFile is the name of folder located in c:\UserFolder ) then if we write code
for copy file in to folder how we assign the path of folder to file
fileObj.Open(temp,CFile::modeCreate);
its not clear how new file read data from old one and how we assing path its for saving temp to folder.
Regard's
Kaushik
|
|
|
|
|
you can't copy file in a folder but you can create a new file in the folder and then write contents to that file.
For creating new file in the folder u have code
CStdioFile file_ptr;
file_ptr.open("c:\\UserFolder\\UserFile\\temp.txt",CFile::modeCreate|mode::ReadWrite,NULL);
this will create a file in the specified folder with name temp.txt
now if you want to write the content into it open the previous file that contains content.Read the content a write it simultaneously....
|
|
|
|
|
Sir Ji I am very near for solving this problem ( Actually i am making such type of thing first time )
if i wrote this code
CString fname;
fname = fileObj.GetFileName();
MessageBox(fname);
it will be show file name
when i write
fileObj.Open("c:\\UserFolder\\temp.txt",CFile::modeCreate,NULL);
i can create file successfully
But in that case
fileObj.Open("c:\\UserFolder\\fname.txt",CFile::modeCreate,NULL);
file name become fname (Not actual file name) Why??
How can we read contant of old file and copy to new one simultaniously..
can you give me some hint regarding this .
Regard's
Kaushik
|
|
|
|
|
Y_Kaushik wrote: But in that case
fileObj.Open("c:\\UserFolder\\fname.txt",CFile::modeCreate,NULL);
file name become fname (Not actual file name) Why??
Because that's exactly what you told it to do.
Y_Kaushik wrote: How can we read contant of old file and copy to new one simultaniously..
Use the Read() and Write() methods. Start reading the documentation so that you are not asking the most basic of questions.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I have a MFC app with a main form (CMainFrame) and a dialog. How can I call a member function of CMainFrame from another dialog?
|
|
|
|
|
One way is to pass the CMainFrame into your dialog. Another is to use the m_pMainWnd member from your application object like this:
CMainFrame* mainFrame = dynamic_cast<cmainframe *="">(AfxGetApp()->m_pMainWnd);
mainFrame->doThisMemberMethod();
|
|
|
|
|
Hey, I tried that. But while compiling I am getting error:
error C2059: syntax error : ')'
I can't figure out why. Can u please help me?
|
|
|
|
|
Oh!
I looked at MSDN and found the correct way to use it.
The code should be as follows:
<code>
CMainFrame* mainFrame = dynamic_cast<CMainFrame*>(AfxGetApp()->m_pMainWnd);
mainFrame->doThisMemberMethod();
</code>
Thanks.
-- modified at 6:26 Sunday 17th June, 2007
|
|
|
|
|
Ooops. I copied the code from one of my own projects and had to rename things from my class name to CMainFrame. I accidentally erased <cmainframe *="">. Very sorry about that. Glad you still figured it out.
I ran into my own pet peeve of someone giving a code example which doesn't work.
|
|
|
|
|
Hmmm, strange. Apparently I did not erase it. It seems the forum is completely deleting my code. I just typed it again in my previous message and it does not show up in the post.
Somehow it worked when you typed it in your post. I wonder why.
|
|
|
|
|
StevenS_Dev wrote: It seems the forum is completely deleting my code.
No, it's there, albeit not shown. You are just failing to use the angle brackets above the smileys.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi everyone. This is my first post ever :P
I am currently programming a MSVC(no MFC), WIN98/WINXP, TaskManager-like application that enumerates all running processes through PE32, and displays total and hidden HWNDs per PID and running status. Options for killing a PID, show/hide/close hwnds are also available. So far so good.
This program detects via SendMessageTimeout any HWND that is not responding, but what about the ones without any HWNDs? How can I detect if a PID is not responding if it is windowless?
CTRL-ALT-DEL shows (not responding) for the hanged windowless process, and maybe I could use that as a workaround, but I do not know how to access this information either.
Three days so far in the web without success. HELP!!!
|
|
|
|
|
Dear all
who can provide any a cube class snippet? thanks...
Li Zhiyuan
5/10/2006
|
|
|
|
|
class Cube
{
}
What did you want it to do ? Sounds like homework to me.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: class Cube
{
}
It won't work, you forgot the ; after the class
|
|
|
|
|
You beat me to it!
Kevin
|
|
|
|
|
Your code is helpful but it has a problem why other elements are transparent ?
|
|
|
|
|
You asked this question previous and but you said cube can you more explain?
|
|
|
|