|
wait a minute ! hope i am not confusing u here..its been a long time since i had worked on such stuff..
could it be due to screen resolution..because of things like screen co-ordinates or client co-ordinates..ohhhh i am so forgetful...
There are no failures; there are only extended learning opportunities.
|
|
|
|
|
In that case using ScreenToClient() should solve it.
Regards,
Griffith
Everything you say will be misquoted, ripped out of context and used against you.
|
|
|
|
|
I wrote this dialog app and after it runs for awhile it just stops updating all the objects on the screen. What I mean by not updating is that some of the object just stop appearing or are only drawn partially. I have many pages in this dialog and they mostly just have large buttons on them. I'm not calling wm_paint or messing with any of the draw functions, I have just let Windows handle that.
Also, I noticed that some of the drop downs instead of having a down arrow it will display a "6".
Any idea on how I can make sure that everything gets drawn on the screen?
|
|
|
|
|
i am not really sure of the answer..just a guess..
Could you check if ur app is leaking memory..could u check the taskmanager to see ur app's mem utilization ?
There are no failures; there are only extended learning opportunities.
|
|
|
|
|
Make sure that the application is not storing huge amount of data in memory and continue adding more data. The program could have memory leaks.
Check task manager and make sure the size of the process in more is consistant and does not increase dramatically.
Kuphryn
|
|
|
|
|
It looks to me like a resource leak, but you say you're not using the GDI functions. Are you sure about this? Maybe it's not your code but someone else could have added drawing functionality in there you don't know about.
Another idea that comes to mind is if your app opens and closes the dialog but does not properly destroy it whenever it gets closed. In other words, it may look like it's gone, but it remains hidden and the resources are not released.
That's all I can offer. Good luck!
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
These all sound like good suggestions. I have been running some test to see if memory changes significantly, but haven't seen this happen.
On all of the dialogs that are called I do a delete() when I close them. I've check and every page is done this way.
Is a particular area I can look at in the debugger to see what is going on?
Thanks...
|
|
|
|
|
Well, MFC has a built-in mechanism for reporting memory leaks when the app exits from the debugger. In other words, run the app inside the debugger (F5), use it for a while, and the exit out of it. If there are memory leaks, you'll get a listing on the Output window showing you the locations of where memory was allocated which was never freed.
Also, you say you do a delete() when you close your dialog boxes. Why? Can you show some sample code of how you're creating/destroying your dialog boxes?
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Hello,
I posted a question yesterday about loggin a text fle from with in a UI Thread.. Anyway, I started logging all the threads actions all the way up to ExitThread and found no problems at all.. I think my problem is that I create the thread and some times the ResumeThread doesn't really resume the thread. It gets created then it sits there. Which causes a bunch of extra threads that are on my process doing nothing.. Is there anyway to ensure that the thread has resumed and if not just kill it?
Heres an example of how I am starting up the threads...
n = 10;
while(n > 0)
{
CConnectThread* thread = (CConnectThread*)AfxBeginThread(RUNTIME_CLASS(CConnectThread),
THREAD_PRIORITY_NORMAL,
0,
CREATE_SUSPENDED);
thread->m_strMessage = strMessage;
thread->m_strDns = strDns;
thread->m_iPort = iPort;
thread->m_bAutoDelete = TRUE;
thread->ResumeThread();
n --;
}
Thanks,
Rob
|
|
|
|
|
Check the return value from ResumeThread!
DWORD ResumeThread( );
Return Value
The thread’s previous suspend count if successful; 0xFFFFFFFF otherwise. If the return value is zero, the current thread was not suspended. If the return value is one, the thread was suspended, but is now restarted. Any return value greater than one means the thread remains suspended.
van padoea
|
|
|
|
|
Thanks for the fast reply.. I should have looked for a return value before posting..
Thanks again,
Rob
|
|
|
|
|
How can I get the current line of a xml element / node ?
What I mean is the current line of a xml node / element in the xml file, like the get_line() function of the IXMLDOMParseError return.
I read some attributes of a xml node / element and check if they are in the possible range (eg. - 100 < attribute < +100). If the attribute is not in the range I want to display an error with the line, where I read the attribute / node / element!
I am working with the MSXML DOM parser!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
No you cannot do that (or at least I think you cannot). Basically the XML is just a string. It may or may not have carriage returns. Both are valid. The well formatted XML you see in your editor is a display and not necessarily the actual XML text.
So:
<SAMPLE>
<BLAH>jhgjsdgf<BLAH/>
<BLAH2>jhgjsdgf<BLAH2/>
</SAMPLE>
Is the same as
<SAMPLE><BLAH>jhgjsdgf<BLAH/><BLAH2>jhgjsdgf<BLAH2/></SAMPLE>
You can get position() but that will simply tell you the element position within the current collection. If you nodes/elements have any form of an ID then you can log the XPATH. This way a user could use some XML editor and apply the XPATH. Or put line numbers as an attribute to your elements/nodes and then report that attribute.
|
|
|
|
|
i have parent window (CDlg-derived) and 2 child windows, that hold same position inside parent dialog. i need programmaticaly activate one or another child window.
i used BringWindowToTop - to change z-order of child windows, but it doesnt work.
what should i do?
|
|
|
|
|
Use
LRESULT Dlg::OnActivateWindow1(WPARAM, LPARAM)
{
Window1.ShowWindow(SW_SHOW);
Window2.ShowWindow(SW_HIDE);
return 0;
}
LRESULT Dlg::OnActivateWindow2(WPARAM, LPARAM)
{
Window2.ShowWindow(SW_SHOW);
Window1.ShowWindow(SW_HIDE);
return 0;
}
|
|
|
|
|
this wont work, because i need both child windows visible at the same time - they have different HRGN.
|
|
|
|
|
Overlapping Windows is not a good idea. You could use one big window and set later
the region which includes the shapes of both windows. This approach will give
You full freedom over the shape.
|
|
|
|
|
i think its too complicated, because this region are already combined from others regions
and that other regions are made from bitmap with transparency zones.
maybe anyone knows how this algorithm realized in CTabCtrl?
i need almost the same behavior (please, dont suggest to derive my class from CTabCtrl )
|
|
|
|
|
Have you tried SetWindowPos ?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
yes, i've tried - doesnt work too
|
|
|
|
|
After re-installation of Win NT on my PC,I noted that there are 4 options.
System start-up
1) Normal set-up
2) VGA Mode
3) Normal set-up
4) VGA Mode
I know there is a file to change n delete the start-up options, what is the filename and where ??
pls help
|
|
|
|
|
Should be in your boot.ini off of your system drive.
Rob
|
|
|
|
|
Sorry everyone this project is just really getting to me... I have to compute the check book and keep updating the charges....and then apply the charges at the end... What is the best way to do this? I'm just confused and where I'm supposed ot put it?
Thanks in advanced!!
GetSingleTransInfo (transCode, transAmount);
newBalance = 0.0;
while (transCode != 'E')
{
if (transCode == 'C')
{
ProcessCheck(transAmount, balance, currentBalance, charge);
GetSingleTransInfo (transCode, transAmount);
}
if (transCode == 'D')
{
ProcessDeposit(transAmount, balance, currentBalance);
newBalance = currentBalance + newBalance;
GetSingleTransInfo (transCode, transAmount);
}
}
PrintFinalTotals (month, newBalance);
return 0;
}
oid ProcessCheck(/*in*/ float amount, /*in*/ float balance,
/*out*/ float& currBalance, /*out*/ float& charge)
// Purpose: Deduct amount of check from balance....apply charges if balance falls below zero by
// cause of check. Apply charge if balance falls below $500.00.
// Pre:
// Post:
{
bool below500;
currBalance = balance - amount;
below500 = (currBalance < 500.00);
cout << " Check Transaction\n\n\n";
cout << fixed << setprecision (2) << endl;
cout << "Check Amount: " << amount << endl;
cout << "Current Balance: " << currBalance << endl;
cout << "Check Charge: " << CHECK_CHARGE << endl;
if (below500)
{
charge = ONE_TIME_CHARGE;
cout << "One Time Below $500.00 charge: " << charge << endl;
}
currBalance = balance - amount;
system ("pause");
system ("cls");
}
//***************************************************************************************************************
void ProcessDeposit (/*in*/ float amount, /*in*/ float balance,
/*out*/ float& currBalance)
{
currBalance = balance + amount;
cout << " Deposit Transaction\n\n\n";
cout << fixed << setprecision (2) << endl;
cout << "Deposit Amount: " << amount << endl;
cout << "Current Balance: " << currBalance << endl;
cout << "Deposit Charge: " << DEPOSIT_CHARGE << endl;
system ("pause");
system ("cls");
currBalance =
}
Autumn
|
|
|
|
|
Hi,
I want to develop an application which transfer data through telephone lines, using TAPI. Pls help. Is there any article published or a tool(with sourcecode) already available on this. If so, can anyone give me the link to it.
Kindly help.. Thanks in advance.
Regards..........
|
|
|
|
|