|
*grin* I must admit I'd never seen your solution before. Will it make the UI responsive, or only *seem* responsive ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
It'll only fool the Task Manager into thinking the app is responsive, but this is what the guy asked for.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
That's fair enough, I was only curious for myself because I'd not seen it before at all, so I wanted to know for my own reference.
Thanks
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Try inserting
MSG msg;
PeekMessage(&msg,NULL,0,0,PM_NOREMOVE); every so often within your lengthy processing.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
The problem is that your "lengthy processing" is taking more than 5 seconds to complete, and during this time, it does not have a chance to process windows messages. The windows task manager will wait five sconds before deciding that a windows task is "dead", and will show the task as "not responding" as long as this condition is true.
Here's the code I use:
MSG msg;
if (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
I usually put this into a "while" or "do" loop when I'm waiting for another flag to be set to allow processing to continue.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I renamed the OK button : ID_FAKEOK and changed its tab order. Then my modeless dlg didnt vanish when I hit ok. BUT.....I dont want this button at all!!!! So when I deleted it, now the modeless dlg vanishes again when I hit enter.....
I plan to send and receive lots of messages in this CDialog so I think I cant pre-translatemessage it.
How shall I correct my enter-key response?
Appreciate your help,
ns
|
|
|
|
|
Try overriding OnOK with a do-nothing function.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
That did it!!!! Many thanks!
Appreciate your help,
ns
|
|
|
|
|
Hi,
I need some serious help setting a font in a CFormView (with an embedded CListCtrl)class. The on initial update code looks like this...
void CTextWindow::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
//size the window to the proper side that would fit the parent
CFrameWnd *pParentFrame = GetParentFrame();
pParentFrame->RecalcLayout();
ResizeParentToFit(TRUE);
//displays the window text depending on the template used to
//create an instance of this class.
if(GetDocument()->GetDocTemplate() == theApp.pOutputDocTemplate)
pParentFrame->SetWindowText("Output Window");
else
pParentFrame->SetWindowText("");
//intialize the font to be used with a constant font
font.CreateFont(14,0,0,0,0,0,0,0,0,0,0,0, FIXED_PITCH | FF_MODERN, "Courier New");
//delete all entries from the list control
m_List.DeleteAllItems();
//set up list control to contain one column
m_List.InsertColumn(0,"Text",LVCFMT_LEFT, 1600, -1);
//set a font of the list control
m_List.SetFont(&font,FALSE);
//set a boolean flag to false to indicate that no file has been loaded yet.
fFileLoaded = false;
}
Pay attention to the lines....
//intialize the font to be used with a constant font
font.CreateFont(14,0,0,0,0,0,0,0,0,0,0,0, FIXED_PITCH | FF_MODERN, "Courier New");
m_List.SetFont(&font,FALSE);
I'm trying to implement font control in this program after the initial update, but I also want to set the font before this window is created. So I'm having a lot of trouble.
I try to make a member function that looks like this.
void CTextWindow::SetScreenFont (...)
{
//same font object as before
font.CreateFont (//parameters);
m_List.SetFont (&font, FALSE);
}
I do this and I get Debug Assertion errors in the Debug configuration and crashes in the Release! Can anyone tell me how to remedy this problem and get a working font control algorithm?
Thanks,
Mike Mathers
|
|
|
|
|
Hi All,
I'm running VS 6.0, and I have created and SDI application using multiple splitter windows to display different aspects of stuff. In each of the splitter frames I have a CFormView derived class that handles the specifics of each view.
My problem is that when the main application gets resized or the splitters get resized, I need to be able to resize the dialog in each of the panes to the size of the pane. I don't have a clue how to do this. It seems I am only able to display the size of the orginal resource for that ID. Any ideas on how to do this??
Any help or suggestions or even just a general direction are greatly appreciated. Thank you.
Dan Willis
|
|
|
|
|
Use SetWindowPos , but be warned this will merely resize the dialog, yet the controls will stay in their original positions. If you want full control over how the dialog is to be laid out under size changes, check Erwin Tratar's Layout Manager for Dialogs, Formviews, DialogBars and PropertyPages[^]
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Actually, I believe that will work. LOL I knew there was a function out there, just couldn't think of the name of it.
I'm actually running a dll that takes the size of the window and makes all the on-screen adjustments, so all of the layout managing is already done. I think that will take care of it. Gotta run some tests to make sure. There's always a small catch. lol.
thanks! I'll keep ya posted.
Dan Willis
|
|
|
|
|
I have a dialog resource IDD_A, and need to "plug in" a new and improved IDD_A (Basically my existing IDD_A crashes the code when I add a third party ACtiveX control on it. However if I put that control on a CDialog BEFORE the other controls, then it doesnt crash. Now what I dont want to do is insert a new Dialog which has a different name IDD_B because Class WIzard will create a new class for it, and I'll have to go through the old class and put in stuff into the new class, and also replace the old class everywhere it occurs in my View class.....not pretty. I tried tricking VS by renaming the old dialog and calling the new dlg IDD_A. I also went and commented out stuff in the resource file. But when I go to give my new dialog dlg the name IDD_A it says that this is associated with IDD_AOLD (which is what I renamed the old dialog). NOw I dont see any place (searched) thaT I could do anything that will make my new CDialog get associated with the same class.
Help?
Appreciate your help,
ns
|
|
|
|
|
search for the line
enum { IDD = IDD_AOLD };
replace with
enum { IDD = IDD_ANEW};
|
|
|
|
|
OOps! I did what you said and it crashed....am going to see if I can see why...
|
|
|
|
|
Create the new dialog resource, give it the same name IDD_A and set the condition _NEW_INTERFACE_ (in the Properties dialog on the left panel), or whatever name you please. Then, by setting/resetting _NEW_INTERFACE_ in Project->Settings->Resources->Preprocessor definitions your program will use one or another dialog resource.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm using VS6. What properties window is this you mention?
Appreciate your help,
ns
|
|
|
|
|
Go to ResourceView on the left panel: there's a tree listing all resources you have included, right-click on that corresponding to the new dialog resource and select Properties.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I just got your response. In the meantime, I created my new dialog, and when I did ctrl W it said its a new dialog - cretae a new class or choose existing<. When i chose existing, it said okay I'm going to replace your old IDD_A with the new one IDD_B. And it did what it promised.....so I've pasted your resolution in m y hints.doc for the future.
Appreciate your help,
ns
|
|
|
|
|
If this line highlights the line in a list control:
m_mylistctrl.SetItemState( i,LVIS_SELECTED,LVIS_SELECTED );
how do I unhighlight the line i.e turn off these flags??
thanks
grahamoj.
|
|
|
|
|
m_mylistctrl.SetItemState( i,0,LVIS_SELECTED );
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
We need to put together a Visio-like visual designer app. Anyone know of a VC++ or .NET toolkit available to build this sort of application? I'm grateful for your suggestions!
|
|
|
|
|
Everybody is taking this word 4 granted - I even have a code (from my
ex-coworker) which has some of it included in a project (that I must continue) but I can't get the difference between 'Hardcoded' files & other 'normal' Visual C++ files.
So please can any1 tell me wtf( ) are these "Hardcoded files"?
Tnx!
Love is the law, love under will.
|
|
|
|
|
It depends on the context, but I'd take it to mean using a number directly in the source, where a constant could be used instead (or even read the value in from a config file, or the registry)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Hardcoded is a very general word. Usually it means that an implementation tends to be very inflexible and designed to solve a very narrow problem instead of the more general solution.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|