|
The best place to start is here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
Dear frineds i ve created an exe project in MFC. now my problem is how to hide the dialog box during runtime?
is there anyway to do that? if so pls let me know.
thanks(in anticipation)
Malini Nair
|
|
|
|
|
this->ShowWindow(SW_HIDE);
|
|
|
|
|
Hi,
Does anyone knowes how can I obtain the virtual memory size of the process I'm running in?
Thanks,
|
|
|
|
|
How about VirtualQueryEx() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
hi all,
I have a series of JPEG file coming from a source. I have to create a MPEG file from the series of JPEG file, which can be played in Media Player. How can I do this. What algorith i have to use or else i have to use COM and ActiveX control for the same. Can u give any idea regarding this.
Thanks and Regards
Yudhisthira Attry
|
|
|
|
|
Unless you have an MPEG-1 encoder available, you'll need to understand MPEG-1 compression.
The MPEG Home Page[^]
Which part is giving you trouble?
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
hi,
I m not understanding how to start that. how to take JPEG for converting MPEG-1. which encoder i have to use and how i have to use. please help me.
i never did such type of programming.
thanks
Yudhisthira Attry
|
|
|
|
|
There's several steps involved - reading the jpeg, decompressing the jpeg, compressing the jpeg
in mpeg format, and writing the mpeg file.
Windows has ways to read/decompress the JPEGs no problem...
Converting video frames to MPEG-1 requires an encoder which you can find/buy from 3rd party
vendors or write your own if you can learn the specification (I gave you the link).
Windows doesn't include an MPEG-1 encoder due to licensing.
If you choose to not write your own encoder, a google search for "MPEG-1 encoder" may help.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Good morning, i want to send, for example a WM_LBUTTONDONW, to windows to simulate a mousehit.
windows should manage this message and send them to the correct window.
I tried this with
SendMessage (NULL, WM_LBUTTONDOWN, 0, MAKELPARAM(y, x));
but it does't works and with
SendMessage (HWND_BROADCAST, ...);
windos sends the message to all active programms.
can someone help me,
thanks
|
|
|
|
|
if you want simulate a click action in some place in screen its better to use the SendInput function than sending the WM_LB... messages.
nave
|
|
|
|
|
thx, i found also an other solution,
i send the message to that window, which i get with the funktion
HWND WindowFromPoint(POINT Point);
thx
|
|
|
|
|
Hi,
I want to get the background color of a property page (from its child). I have written the following code which works fine if the child is in a dialog but not for the property page
Here is my code (taken from //http://www.thescripts.com/forum/thread281595.html)
//methods in the child control
bool getColorMethod1()
{
bool bRet=false;
if (GetParent())
{
CDC* pParentDC=GetParent()->GetDC();
if (pParentDC)
{
HBRUSH hbrush;
hbrush =(HBRUSH) GetParent()->SendMessage(WM_CTLCOLORDLG,(WPARAM)pParentDC->m_hDC,(LPARAM) GetParent()->m_hWnd);
if (hbrush)
{
LOGBRUSH lb;
if ((BOOL)GetObject(hbrush, sizeof(lb), &lb))
{
if (BS_SOLID == lb.lbStyle)
{
m_clr = lb.lbColor;
bRet = true;
}
}
}
ReleaseDC(pParentDC);
}
}
return bRet;
}
bool getColorMethod2()
{
bool bRet=false;
CWnd *pParentWnd=GetParent();
if (pParentWnd)
{
CDC* pParentDC=GetParent()->GetDC();
if (pParentDC)
{
CDC memDC;
CBitmap memBitmap;
CBitmap* oldBmp;
CRect rc;
pParentWnd->GetClientRect(&rc);
memDC.CreateCompatibleDC(pParentDC);
memBitmap.CreateCompatibleBitmap(pParentDC,rc.Width(),rc.Height());
oldBmp=memDC.SelectObject(&memBitmap);
if (pParentWnd->SendMessage(WM_ERASEBKGND, (WPARAM)memDC.m_hDC, 0))
{
m_clr=memDC.GetPixel( 0, 0);
bRet=true;
}
memDC.SelectObject(oldBmp);
memBitmap.DeleteObject();
memDC.DeleteDC();
ReleaseDC(pParentDC);
}
}
return bRet;
}
None of the above methods are returning me the correct color for the control on the property page but they work fine on the dialog
So can any body pleeeeeeaaaaaaaaaase help
Thanks
|
|
|
|
|
I'm not sure, why this bunch of code is required for this.
Doesn't following code suffice.
CDC* pDc= GetParent()->GetDC();
COLORREF crBkgnd = pDc->GetBkColor();
ReleaseDC(pDc);
|
|
|
|
|
I have a legacy app that reads a lot of config settings from several Excel files.
The app reads the settings from Excel using OLE. I think it's slow.
Some ideas about the best way to speed up the reading ?
Excel is used because our customer asked for it (every sheet is a grid of values and it's an easy way for them to change the values)
|
|
|
|
|
aoe wrote: The app reads the settings from Excel using OLE. I think it's slow
Are the cells by any chance read one by one?
In that case it can be very slow because each call is made out-of-process since Excel runs as such server.
I've encoutered this once when writing a huge amount of data into an Excel sheet and it took about 40 minutes to complete the operation. Then I realized that it could all be done in one single call by using a multidimensional SafeArray. The only thing is that the SafeArray can only hold one datatype at a time, i.e. you cannot read headings for the columns in the same call as numeric data.
After I made the change the operation completed in less than 10 seconds.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I read the cells in a big chunk, using an Excel range.
Maybe I have reached the limit for speeding up that operation ?
|
|
|
|
|
How much data are we talking about, what datatypes, how long time does it really take and how long time would you expect it to take?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I read some 30 Excel files. Amount of data in each file varies from 50 to 600 cells.
Total time is in the range of 4 seconds (P4 2.4 GHz, 1GB RAM, XP SP2, Excel 2003)
From the previous reply, I suppose a big amount of the time comes from the out-of-process switch.
It's not a big problem in my machine, but some users have older PC's and I've been trying to improve the startup time. Excel reading was one of the targets and I've improved that, caching some values. I have to check the library used to access Excel, because I think it's doing some redundant work.
Do you have some criteria to decide when to stop improving that way (because of the limits of using Excel that way) and go to another method ?? Maybe text files or a database would do the work, but currently our customer is very happy with Excel (he can change settings very easily), and I don't want to build a front end interface for another method.
|
|
|
|
|
aoe wrote: I read some 30 Excel files. Amount of data in each file varies from 50 to 600 cells.
The amount of data is ridiculously small.
In my case it was a couple of hundred thousand cells.
What takes time in your case is probably dealing with so many different Excel files.
For each file you have to make a large number of calls to Excel before you can actually read the data. Reading the data in this case is neglectable in the aspect of required CPU time.
aoe wrote: currently our customer is very happy with Excel....and I don't want to build a front end interface for another method.
I can appreciate that. Using Excel for such purpose can be justified in many ways so in my opinion you shouldn't change that approach unless being forced to for some reason.
aoe wrote: Do you have some criteria to decide when to stop improving that way.....and go to another method?
Well, a kind of.
I usually think that when things get unreasonably complicated I suspect that I'm doing something wrong and try to find another way to do it. This is mainly at design level.
If I was in your situation I would first measure what operations that consume the most CPU time by measuring it to prevent me from solving the wrong problem. I would compare the amount of time required for opening the files to the time required for reading the data. I would expect to find that opening the files is the culprit by far, but I would like to make sure.
If I would find that opening the files is the performance bottleneck, I would try opening the files directly instead of using Excel for that. This can get somewhat complicated and you would have to know the Excel file format.
You can find the Excel file format here[^], but there's another thing that you have to care about: given the complexity of this solution you have to get approval from your customer before starting.
You have to ask your customer if he/she think it's worth 2-4 weeks of implementation to save those 4 seconds and still using Excel. The amount of time it will take is dependant on your skill and how generic you want the solution.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: I can appreciate that. Using Excel for such purpose can be justified in many ways so in my opinion you shouldn't change that approach unless being forced to for some reason.
Yes. I think i'm not going to change that. I even considered using Excel as a front end for my customer but saving data in another format (plain text, database), but I think is too much work (and adding complexity to the process -> more errors possible).
Roger Stoltz wrote: If I would find that opening the files is the performance bottleneck, I would try opening the files directly instead of using Excel for that.
I don't want to go so far. I suppose that the bottleneck is in the opening of files AND in some redundant work in my library. I'm going to review the library to improve that. It's probably a good compromise "improvement / work".
Thank you very much for your help.
|
|
|
|
|
Hi,
why does the view, which will be destroyed get the focus during destruction?
Anyone an idea?
Thanks
|
|
|
|
|
Hi,
I have to create a application which parses the xml data,for that i have seperate parser,
Function to accept Xml file from the user
Storing the file content in a buffer
passing the buffer pointer in the parser...
How can i implement this tasks,Please help out with your suggestions.
Thanks in advance.
Siddharth
|
|
|
|