|
RajArchana wrote: Can any one give me the link for VC++ questions and answers that are import for the interview.
please follow to link mentioned just beneath my name!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Look at the links on my previus post
you are on position number 2 and 3,... but it wasn't a Formula1 race!
|
|
|
|
|
_Russell_ wrote: but it wasn't a Formula1 race!
ohh I lost
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have written static function and i am calling UpdateData() from this static function. It's giving error - Can't call non-static from static.
What is the solution? Please help me.
|
|
|
|
|
Don't use a static function to host code which requires access to per instance state.
Steve
|
|
|
|
|
In addition to Stephen's answer: static member functions are not 'owned' by a particular instance of a class (they are 'shared' across all instances in fact). So this means they cannot access non-static member functions or variables (because this will require to know with which instance of the class they are dealing, which is impossible).
So, why do you need to have a static function ? Is there a specific reason for that ? I guess that you can simply change it into a non-static one.
If not, then provide more informations.
|
|
|
|
|
If you cannot change the static function to and non-static, from where is this static function called? Does it have the HWND of the dialog?
- NS -
|
|
|
|
|
No, it doesn't have the HWND of the dialog.
Anyway I have converted from static to non-static. It is working.
Thank you very much for the help.
-- modified at 4:05 Thursday 11th May, 2006
|
|
|
|
|
NS17 wrote: If you cannot change the static function to and non-static, from where is this static function called? Does it have the HWND of the dialog?
UpdateData from different Thread or point brings lot of problems!.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
You are right... You got what I aimed to do. Anyway what is your suggestion in such a situation?
- NS -
|
|
|
|
|
NS17 wrote: . You got what I aimed to do. Anyway what is your suggestion in such a situation?
create a userdefined message, and from the static funtion post that message to the to dialog for updating the data from/to the Dialog box
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Yes... Thank you.
- NS -
|
|
|
|
|
I checked many functions to do the same but i could not... i want the help to copy a folder and a file to another folder using a FTP connection... can any one help to do the same...awaiting your reply
|
|
|
|
|
Vivek krishna wrote: . i want the help to copy a folder and a file to another folder using a FTP connection... can any one help to do the same...awaiting your reply
there is no such function exist in Unmanaged VC++. you have to implement the logic urself for same, i.e. you have to create directory on remote servers ( CFtpConnection::CreateDirectory) and using CFtpConnection::PutFile you can recursivly put file on remote server!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
i tried the same but what happens is the file copies separately in the same place where the new folder created not inside the created folder.
pConnect = sess.GetFtpConnection(m_host,
m_user,m_pswd,atoi(m_port),false);
CFtpFileFind finder(pConnect);
pConnect->CreateDirectory("sample");
BOOL bWorking = finder.FindFile(_T("*"));
strFileName += m_host;
strFileName += finder.GetRoot();
MessageBox(strFileName);
BOOL bUploaded = pConnect->PutFile("C:/070206_NewVExls.xls",
"ss",FTP_TRANSFER_TYPE_BINARY,1);
if(bUploaded==0)
MessageBox("unsucess");
|
|
|
|
|
Vivek krishna wrote: I tried the same but what happens is the file copies separately in the same place where the new folder created not inside the created folder.
You need to change directory on the remote server, otherwise it won't know you need to put the files in a different place. FTP does not stand for File Transfer (Psychic).
Iain,
|
|
|
|
|
i tried to change directory using "SerCurrentDirectory()". but i m not able to change
|
|
|
|
|
Vivek krishna wrote: BOOL bUploaded = pConnect->PutFile("C:/070206_NewVExls.xls", "ss",FTP_TRANSFER_TYPE_BINARY,1); if(bUploaded==0) MessageBox("unsucess");
Please give Folder path as argument instead of string "SS"
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi,
i also facing the same problem, how i can connect to the FTP Server and also get the file and save the file in server??
is the connection using CFtpConnection? and where can i get the references...
have a nice day
|
|
|
|
|
You can see this here[^] and also see example ftp in MSDN
|
|
|
|
|
is message queue will be per process or thread or System???
|
|
|
|
|
Per thread; but it's created on demand so not all threads will have one.
Steve
|
|
|
|
|
if it is per thread, then why we need handle in MSG structure???
|
|
|
|
|
voorugonda prashanth wrote: then why we need handle in MSG structure???
I assume you're referring to the hwnd HWND in the struct. We need this because, regardless of any threading issues, we still need to know which window the message is for.
From MSDN on GetMessage
"The GetMessage function retrieves a message from the calling thread's message queue."
Steve
|
|
|
|
|
voorugonda prashanth wrote: is message queue will be per process or thread or System??
Exactly what you want to know?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|