|
I want to be able to disable the UI for an ActiveX control while certain processing is happening. Is there a way to "gray-out" the entire control without having to disable each individual button or field in the control?
|
|
|
|
|
Why don't you do the processing in a background thread, and maintain a responsive UI (and perhaps offer the user a way to abort the process)?
L u n a t i c F r i n g e
|
|
|
|
|
Processing will be done on a background thread, and in most cases, I do wish to maintain a responsive UI. But in some cases, I need to visibly disable the UI and was hoping for some magic options that wouldn't require disabling each control individually.
|
|
|
|
|
I don't know of one, sorry. Other than CWnd::EnableWindow , which doesn't do what you're looking for.
L u n a t i c F r i n g e
|
|
|
|
|
I have been struggling with how to remove the floating/docking/.... popup that appears when you right click on the cvslistbox toolbar. I have successfully removed it from other controls by overiding OnContextMenu. For cvxlistbox it only overides when right clicking the list area itself. If I right click on the toolbar, where the new/delete button is located, it is not overidden. Instead it calls a different CPane derived class which calls OnShowControlBarMenu.
Any help with removing this popup would be appreciated.
Thank you
Steve
|
|
|
|
|
I am writing an ActiveX control that uses a CMFCStatusBar. To do so, I added a CMFCStatusBar to a CFrameWndEx and put the latter into my control. This worked just fine; my status bar appears at the bottom of my control. When I set the style of my Frame to CMFCVisualManagerOffice2003, only the status bar appears. That is the behavior I want. However, when I use a better looking style, such as CMFCVisualManagerOffice2007, I get the status bar on the bottom and a title bar across the top. What do I need to change to use the 2007 visual style but without the title bar?
For reference, this is the code I am calling in my Frame's OnCreate():
CMFCVisualManager::SetDefaultManager (RUNTIME_CLASS (CMFCVisualManagerOffice2003));
|
|
|
|
|
#include<iostream>
using namespace std;
class list
{
public:
int number,score;
char name[10];
class list*next;
};
void create(list* head)
{
list* p=head;
while(1)
{
list* pp=new node;
if(!pp)
{
cout<<"erroe"<<endl;
exit(1);
}
cout<<"Please input the student ID:";
cin>>pp->number;
if(pp->number==0)
break;
else
{
cout<<"Pleast input the studnet name";
cin>>pp->name;
cout<<"Please input score:";
cin>>pp->score;
p->next=pp;
p=pp;
}
}
}
void show(list* head)
{
list* ptr=head;
cout<<"\n -- STUDNET ---"<<endl;
cout<<"ID\tNAME\tscore\n============================"<<endl;
while(ptr!=NULL)
{
cout<<ptr->number<<"\t"<<ptr->name<<"\t"<<ptr->score<<endl;
ptr=ptr->next;
}
}
int main()
{
list* head=NULL;
create(head);
show(head);
return 0;
}
|
|
|
|
|
Please read the posting guidelines[^] before posting.
1) Use the pre tag to format your code properly so that it is readable.
2) Ask a question. Dumping your code without explaining what the problem is not very useful. We can't read minds you know.
|
|
|
|
|
what error ?
compile error ? runtime error ?
did you try to "run" your program manually on paper (i.e. follow each step manually to see if your algo is at least valid ) ?
did you try debugging it with a debugger ?
This signature was proudly tested on animals.
|
|
|
|
|
I suspect it was what is commonly described as 'cockpit error'.
L u n a t i c F r i n g e
|
|
|
|
|
Please read the gudelines[^] and reformat your post so the code is within <pre></pre> tags and correctly indented. That way we can read it. Secondly try to add a question, as this entry is meaningless.
MVP 2010 - are they mad?
|
|
|
|
|
wbgxx wrote: list* pp=new node;
You might start here.
Once you get that corrected, you should do some serious cleanup to the create() function. No screen I/O should be performed in that function. Prompt the user for input elsewhere and pass that data to the create() function.
Also, the call to new inside the while() loop is wrong.
Is each new node added to the front of the list or the rear? If the front, no while() loop is necessary. If the rear, the while() loop should simply iterate each node until NULL is reached.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hiiii to all
I wanna know the difference between the
return(0);
return 0;
return;
from a function call...... return(0) and return 0 is same or not ??
Thanking you
--------------
|
|
|
|
|
krish_kumar wrote: return(0) and return 0 is same or not ??
Yes, it is the same. The parenthesis are here just useless.
But, there's a difference between return; and return 0; : the first one is used in a function that returns nothing (void) and the second in a function that returns something (here, probably an integer).
|
|
|
|
|
krish_kumar wrote: return(0) and return 0 is same or not
Yes, exactly the same. The addition of brackets makes no difference.
krish_kumar wrote: return;
This however is totally different, and only valid in a "void" function - i.e. one which doesn't return a result.
The difference between them can be illustrated as :-
int DoSomething_1(int val)
{
return (0);
}
void DoSomething_2(int val)
{
return;
}
Days spent at sea are not deducted from one's alloted span - Phoenician proverb
|
|
|
|
|
molesworth wrote: void DoSomething_2(int val){ // some processing // ... return; // must not return a value as it's a "void" function}
isn't it:
molesworth wrote: void DoSomething_2(){ // some processing // ... return; // must not return a value as it's a "void" function}
[Edit] sorry for the layout...
|
|
|
|
|
Er, no.
A "void" function describes what it returns, rather than the number of parameters it has.
Graham
Librarians rule, Ook!
|
|
|
|
|
Thanks Graham, I was just about to say that...
Days spent at sea are not deducted from one's alloted span - Phoenician proverb
|
|
|
|
|
To build a solution, you can simple pass in the path to the solution file and optionally a configuration, such as debug or release. Projects are compiled by using the Project switch, and you can build one project at a time, also optionally specifying the configuration to use.
The syntax to use is:
devenv solutionfile.sln /build [solutionconfig]
[/project projectnameorfile [/projectconfig name]]
My question is,
1)if we dont specify configuration either "debug" or "release" as it is optional, will it build both debug and release or any one (debug or release) by default.
2) Any idea how to build both "debug" and "release" in one command line.
Thanks,
Nandu
|
|
|
|
|
Nandu_77b wrote: 1)if we dont specify configuration either "debug" or "release" as it is optional, will it build both debug and release or any one (debug or release) by default.
What happens when you try?
Nandu_77b wrote: 2) Any idea how to build both "debug" and "release" in one command line.
No, but there may be some suggestions here[^].
MVP 2010 - are they mad?
|
|
|
|
|
I don't use the devenv program, but from a batch file I use something like this:
vcbuild /r /useenv \Source\Mapp\bld\myapp.sln $ALL
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
We have several exes that need access to common dialogs for database administration on common tables. Dialogs need access to a database via ADO/ODBC and user interface. We have in the past recreated the same dialog repeatively. Getting tired of doing that. Would like to create for each dialog an EXE/DLL or something that we can link at runtime in case of changes. A DLL looks like the best way. Any BOOKS or PUBLICATIONS out there to exactly guide us from creating , calling from current EXEs, and distribution? Really need step by step not just a reference document. Would just creating an EXE for each dialog and shell execute would work? Pros / cons.
thank you
|
|
|
|
|
|
(If you're using MFC) We had a similar problem, and eventually, after lots and lots of deliberation, we opted for a non-portable solution, where the DLL with the dialogs export the entire CDialog classes, using the __dllexport keyword in the class declaration. Code won't be reusable by any other platform or compiler, but it works... You could pass in a CDatabase or what have you to the dialog constructor.
|
|
|
|
|
Hello, I'm having a very difficult time changing parameters using code to a program that has a few labels. I was able to move their position, change their color, but unfortunately not their sizes. This project also uses ActiveX. I'm using VS 2008, and the only articles that give any insight are all for VS 6.
m_lblctrl1.SetWindowPos(&wndBottom,0,0,0,0,SWP_NOSIZE);
changes m_lblctrl1 position (x,y,cx,cy)
m_lblctrl1.SetForeColor(RGB(255,0,0));
changes m_lblctrl1 to red.
m_lblctrl1.SetFont(LPFONTDISP);
now this is where i've been hitting a very bad wall
this is the method i've been tackling.
CFont font;
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfHeight = 12;
strcpy_s(lf.lfFaceName, "Arial");
VERIFY(font.CreateFontIndirect(&lf));
m_lblctrl1.SetFont(&lf);
the error i'm getting is "error C2664: 'CLabel::SetFont' : cannot convert parameter 1 from 'LOGFONT *' to 'LPFONTDISP' " I've done all the research i could do to properly troubleshoot this, but unfortunately i've hit the point where i need professional help. m_lblctrl1 is defined as a CLabel in case that helps. Also i used Do Data Exchange from the original label defined:
DDX_Control(pDX, IDC_LBLCTRL1, m_lblctrl1);
If anyone has experience with this LPFONTDISP and how to change the label size/font, i'd greatly appreciate help.
Thank you for any input, if there is any details i left out, I'd gladly add it.
-David
|
|
|
|