|
Just create a Control Variable by using the class wizard
and
yourControlVariable.EnableWindow(FALSE);will disable your combo..
Renjith CPian.
|
|
|
|
|
Thanks Renjith
Agnihothra
|
|
|
|
|
I'm writing an application that needs to change the font of MessageBox(),because the default font of it seems too small for me. How Can I do it?
Thanks in advance!
lilun
|
|
|
|
|
I dont think that you can do that, as it is a System
wide thing. But you could have your own message box.
There are some articles here at CP.
|
|
|
|
|
|
You can get the message box's window handle(maybe by its title or another way),then you can use CWnd::SetFont to change the font of MessageBox()
|
|
|
|
|
I have a application that uses URLDownLoadToFile. The problem is that the file downloaded gets cached and when the program is run again, it does not re-download the file, I need a way to download a new file everytime I call the function, not just use the cached one. THANKS
|
|
|
|
|
This is a dirty hack:
Try appending a '?<random number="">' to the URL. For example if the url is:
http://server/file.zip
change it to:
http://server/file.zip?37490394
James
Drinking In The Sun
Forgot Password?
|
|
|
|
|
Thanks! Works great. I know this is a dirty hack, but it will work as long as I use a question mark and a random number right? Why does this work, what does the question mark do?
Thank you!!
|
|
|
|
|
Question mark in a URL is used to pass parameters to a web server. When parameters are not needed, the webserver ignores them. Whoever is doing the caching does not detect that this file has been downloaded already since the URL is different each time. So basically you are fooling the caching mechanism into thinking that a different URL is requested each time.
Drinking In The Sun
Forgot Password?
|
|
|
|
|
Well it's a sweet hack . Thanks again. Everything is working perfectly.
|
|
|
|
|
Lets see is three times the charm will work with this problem. I'm getting close to a solution, but I'm not seeing it. I'm trying to get {right now ANYTHING!!!!} to be place into an MDI document and then displayed on the screen. I have tried several things, here is my latest try:
I have a menu item labeled InsertText, for that function, I have the following code:
void CMyAppView::OnTestingInserttext()
{
CMyAppDoc* pDoc = (CMyAppDoc*)GetDocument();
CDC* pDC;
CString outtext;
outtext="This is a test";
pDC->TextOut(outtext); I think part of my problem is here
pDoc->UpdateAllViews(NULL);
}
I then have the following code placed under OnDraw():
{
CMyAppDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
}
What am I doing wrong? When I place TextOut(0,0,outtext), it compiles, but then when I click the Insert Text, I get a DLL GPF error.
How do you get the current cursor position and then use that for the TextOut command? I'm using an EditView MDI, please help, I'm about to give up on C++ and go back to VB.
|
|
|
|
|
|
AHHHH!! I'm starting to like that location, perhaps I should build a house there.
Ok, so how do I initialize it correctly? Would I use the CMyDoc::GetDoc() and CMyView::GetView()? How do I get the pDC to point to the correct location using these? I have them programmed, just not used yet.
Other than that, am I coding the process correctly, other than getting the current position?
|
|
|
|
|
I don't understand why you need draw it from document.Set value in the doc,call from doc to updateallviews and in the view OnDraw call to
and call to dc->textout(pdoc->getvalue()).
Good luck.
|
|
|
|
|
GetDC() will return the pointer to the Current Device Context..
Renjith-CPian.
|
|
|
|
|
Bear with me here, so you call GetDC() and then you assign this to pDC correct?
Would the code look like this?
GetDC()* pDC;
How do you tell which document is active or do you need to?
|
|
|
|
|
YES!!!!!!!!!!!!!!!!
I found a command that worked!!!!
Since I'm using an EditView this function works:
void CMyAppView::OnTestingInserttext()
{
CMyAppDoc* pDoc = (CMyAppDoc*)GetDocument();
CString outtext;
CEditView::GetWindowText(outtext);
outtext=outtext+"This is my new stuff";
CEditView::SetWindowText(outtext);
pDoc->UpdateAllViews(NULL);
}
Thanks again for all your help, I simply stumble across the GetWindow text while looking for CDC information.
|
|
|
|
|
Good. Now try checking out CEdit::ReplaceSel function. It is more efficient than getting the current text into a string and appending and sending back to control. You will also need to look at CEdit::SetSel.
James.
Drinking In The Sun
Forgot Password?
|
|
|
|
|
|
Oh sure, now you tell me
I found it before I read any replies, but thanks for offering advice. Now the next question that comes to mind is, what is all that DrawText and TextOut used for?
Also, I know how to pass a variable from a modal dialog, how do you pass one from a modaless? Or should this be under a new thread?
|
|
|
|
|
Matt Fenwick wrote:
DrawText and TextOut used
DrawText and TextOut are used when you need to paint directly to the window. If you are using an edit control then the edit control will handle drawing directlty to the window, all you need to do it tell it what text to draw.
Matt Fenwick wrote:
how do you pass one from a modaless?
The variable must be a public member of your dialog class. Then you can access the variable from anywhere. Or you can create it private/protected and make a public function to retreive it. It is the same in modal/modeless.
Drinking In The Sun
Forgot Password?
|
|
|
|
|
I looked everywhere fonts, text api's but could not find a flag to set in order to draw text as superscript or subscript (using GDI). How is it normally done?
|
|
|
|
|
halve the font size and offset if necessary.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Remember that amateurs built the ark. Professionals built the Titanic.
|
|
|
|
|
That is simple. It just did not occur to me. Thanks!
|
|
|
|