|
Hi,
Add resizing code on OnSize() function. Can use either the GetClientRect / the parameter from the onsize function, calculate the position and move the control to the new position using the MoveWindow function.
Sujan
|
|
|
|
|
There are several articles (with sample code) here on CP that discuss this very topic.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi ,
I am able to get it...i.e resize the controls. But I have a new problem now.
When I try to resize the view i.e child frame, there is a lot of flickering of all the controls. Can anyone please help to to remove this filckering of controls.
Thanks
Madhavi
|
|
|
|
|
this may not be of much help to you because I can't remember the exact name of the functions, but I was looking for something about resizing dialogs a while back and there's some function you can call like DeferDrawing() or something like that and then call another type of update function so that it draws everything at once sort of like a batch mode update. It might be a member of CWnd; check MSDN. Sorry I couldn't provide more info, but it's in a book I have (C++ .Net Bible by Tom Archer) that I don't have here at work with me today. And it's not .Net related.
[insert witty comment here]
bdiamond
|
|
|
|
|
hi,
Can anyone let me know how to add a scroll bar to Mainframe in MDI application?
Thanks
Madhavi
|
|
|
|
|
A scroll bar will appear automatically if any child frames stick out of the MDI window (main frame
blank area).
Failing that, you could add one in the same way as toolbars take up room around the edge, but that
is a lot of work.
Iain.
|
|
|
|
|
Hi All,
I have requirement to tranfer a file(test.txt) between 2 machines connected in same LAN.
May be we can use Sockets, but i dont know full details . please give me complete details with simple code if possible.
Regards,
Prax
|
|
|
|
|
I don't know if CopyFile will work between 2 different machines, but this should:
CFile fileFrom,fileTo;
CString strFrom,strTo;
int nOpen = fileFrom.Open(strFileArray[uFile],CFile::modeRead|CFile::shareDenyWrite);
if(!nOpen)
return;
unsigned long nLength = file.GetLength();
BYTE* pBytes = new BYTE[nLength];
if(!pBytes)
return;
fileFrom.Read(pBytes,nLength);
fileFrom.Close();
if(fileTo.Open(strTo,CFile::modeCreate | CFile::modeWrite,&ex))
{
fileTo.Write(pBytes,nLength);
fileTo.Close();
}
delete [] pBytes;
[insert witty comment here]
bdiamond
|
|
|
|
|
in the above code, the fileFrom.Open() call should have strFrom as the first parameter, not strFileArray[uFile];
[insert witty comment here]
bdiamond
|
|
|
|
|
Hi ,
It really worls , but one doubt , if v do not have the access password(already accessed that system from RUN : "\\system2") for the other system , it wont work.
is ther any way v can provide username and password for the other system's access?
Regards,
Thax,
Prax
|
|
|
|
|
I want to send a http POST request to a given url.How can I get it done. I usually use the CInternetSession class to
connect to a server and to get the specified page.From that page I go to the next page by fetching the next page's url
from the href of the SUBMIT button.
One day I get a page.But when clicked manually on the NEXT button (SUBMIT button of html) the url in the address bar do not change but the page is changed. Neither I found any url in the web page(source of page) also.
I come to know that this is because the page uses the POST method and by using the hidden values posted from the page the sever is dynamically moving to next page
Is it true.
Since user is not given any values in the page,can I get the next page by sending a POST request to the server using program.
Can we send a POST request to the server through VC++.
Plz help me and give any answer
Thanks in advance
Below shown the code . If you implement that in the code ,
it will be a good help for me
const int FILEBUFLEN = 1024;
char httpBuff[FILEBUFLEN+1];
TCHAR szCause[255];
/// var: url ,contains the url
TRY
{
CInternetSession session;
int numBytes;
session.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 1000);
session.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 3);
CFile *remoteFile=session.OpenURL(url, 1 , INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_RELOAD);
numBytes = remoteFile->Read(httpBuff, FILEBUFLEN);
while (numBytes)
{
httpBuff[numBytes]='\0';
data.Insert(data.GetLength()+10,httpBuff);
numBytes = remoteFile->Read(httpBuff, FILEBUFLEN);
}
}
CATCH_ALL(error)
{
error->GetErrorMessage(szCause,254,NULL);
data.Format("%s",szCause);
Logger logVar;
logVar.WriteLog(data);
return FALSE;
}
END_CATCH_ALL;
return true;
Now I want to give a post request to this page.I saw
an option in CHttpConnection::openRequest() to post request in POST method.I tried it But the fifth parameter is not working.If it is NULL then it will work.
|
|
|
|
|
Really Sir,
i amn't able to track error in your code,but i can suggest you a way to post data to HTTP server,there is one very good wrapper class that will do it for you
Search for amHttp AT CP
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi All,
I have requirement to tranfer a file(test.txt) between 2 machines connected in same LAN.
May b v can use Sockets., but i dont know full details . please give me complete details with
simple code if possible.
Regards,
Prax
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/copyfile.asp
4apai
There're no impossible tasks. There're tasks that required infinite period of execution time.
|
|
|
|
|
Hi,
It works ...!!!
Thx
Prax
|
|
|
|
|
Hello Friends,
I am using Form View on which I had placed two edit boxes. My problem is that The Edit box which is on the top of the FormView is not displaying the Vertical scroll bar and nor is doing the word wrapping thing, while the second edit box is wrapping the text present in it. I am using OnSize message also where I had specified the two edit boxes should change their size according to the size of the form view. Please help regarding this matter.
Thank you
Neelesh Jain.
|
|
|
|
|
Hi,
I Think you are having some problem with resizing/Refreshing problem.
Sujan
|
|
|
|
|
I had the problem with Refreshing i.e., The text is not getting wrapped to the next line even though I made the property of the edit box as no hscroll, and given autovscroll and even multiline. option.
Neelesh Jain
|
|
|
|
|
Hi guys,
I am having a cpp file in which i have added 2 more cpp files in which i have declared my classes... now when i compiles and builds well and executes ... but in the middle of execution it is giving an error window which states tht
"Debug Assertion Failed!" Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
I am not any idea why i am getting this... may be my stack is overflowing or is their any pointer mismatch or invalid references....? but as far as i know i havn't used pointers in my cube class except in sphere class.
plz can anyone help me on this issue...How can i upload my programs..if i want to overhere...?
thanks in advance,
Suman
|
|
|
|
|
Hi
I think, the program is trying to access an invalid pointer. Please check where it is happening using the call stack(view/debug windows), and step through the source.
Hope this might help you
Sujan
|
|
|
|
|
Hi,
i am not getting where it is.... actually this is wht happened... previously i am having a program which is having another file included in it. the other file is containing only some functions regrading to a particular task of considering a cube and finding values for something respectively.
now instead of having one cube ... i want to modify it to take more number of cubes... so i have just declared the other file in a class and declared all the previous functions as the methods of the class and all the variables used previously, as data members (but haven't changed any code regarding to logic). but in main file in whcih previously i used to call just functions, now i am calling them as methods of every cube instance. Now i am getting the above stated error.
hope now i am clear....
thanks,
Suman
|
|
|
|
|
How do i program the regional setting. You know when App runs in US, it will use $, runs in England, use pound. Thanks
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
GetCurrencyFormat()
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
How about the date format? How can we program, to make the regional and language option in control panel, what we want?
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|