|
Example 1: well, I have to admit that I'm using MFC as framework, but mostly for UI. My data structures (in CDocument-derived class) are STL-based, file formats are plain text or XML. I don't have much problems with this. However, I understand that it could be made easier.
Example 2: can't comment on GDI+, have zero experience with this.
Example with Accusoft - new image formats are the equivalent of new common controls supported by MFC, right?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have to admit I haven't seen MFC 7 yet, but from what I gather there aren't major leaps forward (please correct me if I'm wrong, I would like to know more).
What I'd like to see is greater functionality out of the whole thing, especially from a GUI point of view. Just think of all the spare time we'd have if we didn't spend it extending the MFC library
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
Just think of all the spare time we'd have if we didn't spend it extending the MFC library
That is an excellent point. It proves that the term "maturity" often used in regards to MFC is rather relative.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
It proves that the term "maturity" often used in regards to MFC is rather relative.
[edited message]
I strongly disagree. I don't want fancy bitmapped buttons, grids, sliding windows, etc. in MFC. This is a general-purpose library and should not contain any widget that's fashionable this fall.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I don't want fancy bitmapped buttons, grids, sliding windows, etc. in MFC.
Hey, that's why I used the word *relative*. MFC's own history tells us that it has extended and improved its GUI components from version to version. Sure most of them are more of a *wrapper* around their Win32 counterparts, but consider other GUI controls that are *extended* beyond this wrapping business (such as CBitmapButton, CCheckListBox etc.). Adding more controls into the library only makes it rich and thus leaving us, the end users to spend more time to make it even richer.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
Adding more controls into the library only makes it rich and thus leaving us, the end users to spend more time to make it even richer.
The problem is that rich library becomes bloated library. Take ISAPI helper classes for example. Sure, there are users who benefit from them, but I think they are not majority.
Generally speaking, the life of library writers is not an easy one - they have to hit the bullseye and provide enough functionality within reasonably-sized package.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
The problem is that rich library becomes bloated library.
Yep, that can be an issue while redistributing the runtimes. I guess the new approach MS has taken in MFC7 by integrating it more into ATL has the potential to take a lot of load outside the runtime and make it even lighter someday.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
I have two apps that share CString information using WM_COPYDATA.. One of my apps when minimized is hidden and can only be found on the system tray.. The problem is when I try to send WM_COPYDATA to the hidden app it fails (I'm assuming its because when its hidden it doesn't have a "Window Name").. any ideas on how I can keep my app hidden yet still send the data?
Thanks,
Mike
|
|
|
|
|
The fact that the window is hidden doesn't make a difference. As long as the window exists, you can send messages to it. Are you getting an error back from WM_COPYDATA? Post some code.
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
You are right.. The problem isn't with the window being hidden.. I threw in some code to pop up a msg box if the console app couldn't find the app and it didn't pop the msg.. I guess the problem is.. I spawn multiple dialogs with the same name, and when I send a msg from the console to the open app's I was assuming that they would all see the msg.. I set up the apps to look for a specific variable being sent in the msg and if it matched a CString that was stored in the dialog it would take the command and do what ever.. Guess I'll have to figure out a differen approach.
Any ideas?
Mike
|
|
|
|
|
Hi.
Is there a Function like the Sleep() Fuction which do not stop the whole Application. I want only to Delay and not to Sleep..
so any ideas?
|
|
|
|
|
What do you want exactly ? If you want to delay part of the app, try putting it in a thread.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Have you tried SetTimer?
That would allow your application to continue while you waited for the timer to go off. The only requirement is that you have to have a message pump. Even if you don't have a window, you still have to pump the message queue to get SetTimer to work.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
the timer is a good idea! thanks!
|
|
|
|
|
Couldn't you just use a callback function and let the default message handling take care of everything?
SetTimer(NULL,NULL,nMyMillis,TIMERPROC);
Erik G. Poel
|
|
|
|
|
Yes, but the important point is that you still have to have some form of a message loop. Which for 99% of all applications is already there.
Sometimes people try to use SetTimer with console applications where they don't have a message loop. If you aren't aware you have to do this, it is very frustrating trying to figure out why the timer doesn't go off.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
LOL
Sometimes people try to use SetTimer with console applications where they don't have a message loop.
I know the feeling
Regardz
Colin J Davies
|
|
|
|
|
A while back I remember seeing an article or message about registry entries you can set to enable XP UI look in a 'normal' application.
Anybody remember where that was?
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
|
Ok, will look into that. Thanks.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Forum Index | FAQ | Edit Profile | Send Private | Check Private | Search | Logout
Preview your post
The following is a preview of your post. If everything looks ok then you can click 'Continue' and your post will be entered. If not then use your back button to go back and edit some more.
Subject: WBEM Query too slow
Category:
I have an application that must find out the current load on the system on a regular basis. I'm using WMI/WBEM to do this. The problem is that one of the WMI calls takes about 1/2 second to return...
This is a BIG problem.
The call that takes so long is the ExecQuery call that only happens once per calculation. The loop gets the LoadPercentage for each proecssor on the system. (I think). I need the enumerator in anycase.
Here's my code:
long CSysLoad::GetLoadPercentage()
{
// Perform the query
IEnumWbemClassObject *pEnum = 0;
try
{
// ***********************The next line takes 1/2 second
hres = pSvc->ExecQuery( language,query,/*BEM_FLAG_FORWARD_ONLY*/ 0x20,NULL,&pEnum);
}
catch (CException *e)
{
}
if(FAILED(hres))
{
CErrorInfo err;
GET_ERROR_MSG(lpMsg, hres);
err.SetError(hres,CString((LPCSTR) lpMsg ));
throw err;
return 0;
}
long lReturnValue = 0;
// Define the object interface (AND initialize it to NULL)
IWbemClassObject *pObj = 0;
ULONG uReturned = 0; // Used to check the number of objects returned
long lTotalLoad = 0;
int iProcessorCount = 0;
while(true)
{
// Check each processor, average result
hres = pEnum->Next( 0,1,&pObj,&uReturned);
if(uReturned == 0) // If no more to process, uReturned is set to 0 so we're done
break;
// Since we're not done, extract the LoadPercentage from the query result
BSTR strClassProp = SysAllocString(L"LoadPercentage");
VARIANT v;
hres = pObj->Get(strClassProp, 0, &v, 0, 0);
SysFreeString(strClassProp);
// If the property is found, convert our variant to a number.
if(!FAILED(hres))
{
/* bstr_t temp(v);
TCHAR buf[128];
_tcscpy(buf, (LPTSTR)temp);
long lResult = atoi(buf);
*/ if (v.vt = VT_I4)
{
lTotalLoad += v.iVal;
iProcessorCount++;
}
} else {
CErrorInfo err;
GET_ERROR_MSG(lpMsg, hres);
err.SetError(hres,CString((LPCSTR) lpMsg ));
throw err;
return 0;
}
VariantClear(&v);
pObj->Release();
}
// Calculate the answer
return (iProcessorCount > 0) ? lTotalLoad / iProcessorCount : 0;
// If this doesn't work, we will be running WIDE OPEN!!!
}
Thanks for the help,
Bill
|
|
|
|
|
Hi,
Here's my situation...
I have an MDI app that has one CFormView class registered.
I'd like to add a simple new CView class to my app. I've registered
default CMyView/CMyDocument classes using:
m_pMyDisplayTemplate = new CMultiDocTemplate(
IDR_DEFECTSDISPLAY,
RUNTIME_CLASS(CMyDisplayDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CMyDisplayView));
AddDocTemplate(m_pMyDisplayTemplate);
This follows the original CMultiDocTemplate. So on
CWinApp::OnFileNew(), it creates a new document of the original
type. How do I bring up a prompt to ask what type of document
I want to create?
Much Thx,
t²
|
|
|
|
|
Does anyone knows how to draw polygon filled with red color and this change only pixels that are different from white ?
I know it should be some magic ROP2 Code, but which one ?
|
|
|
|
|
Ok I know this might sound stupid but I have to find out. I have recently come across code that does this:
unsigned int len:4;
What does the semicolon signify? I have not seen this type of "shortcut" using C++. I have been scouring through all the literature I have on C++ and can't find it so in taking the chance of sounding stupid I must ask this question.
What is this signifying a value? Or is it a bit designation saying use 4 bits instead of 4 bytes to represent this value? Please help I am going crazy trying to figure this out...
btw, please refrain from answer that this is a semicolon I know many of you are urged to do so <g>.
Sam C
----
Systems Manager
Hospitality Marketing Associates
|
|
|
|
|
it's a colon.
actually, it's a 'bitfield' specification, used to set a specific bit position for data within a struct or union.
from the MSDN:
This example defines a two-dimensional array of structures named screen.
struct
{
unsigned short icon : 8;
unsigned short color : 4;
unsigned short underline : 1;
unsigned short blink : 1;
} screen[25][80];
The array contains 2,000 elements. Each element is an individual structure containing four bit-field members: icon, color, underline, and blink. The size of each structure is two bytes.
Bit fields have the same semantics as the integer type. This means a bit field is used in expressions in exactly the same way as a variable of the same base type would be used, regardless of how many bits are in the bit field.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|