|
SamPrem wrote: Sleep(10);
You have ket delay of 10 ms. Thats the reson, you are able to recognize last character displayed. Your code is setting text 0-25 to edit box. But, you are not able to see i, because it happens in very short time. May be, you can try setting dealy of 2 sec(2000ms).
|
|
|
|
|
SamPrem wrote: how do i go abt it???
No need to call UpdateData() .
Change your for loop variable to an int , as a double makes no sense for what you are doing.
Change m_d1 from a CString to CEdit instead.
Update the edit control with m_d1.ReplaceSel() instead.
Using a different 'sleep' value is irrelevant.
SamPrem wrote: the above code gives me an output of 25
Of course it does, since you are overwriting the contents of the edit control each time through the for loop.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In your for loop, you use the UpdataData (and that's OK), then sleep, but stay in the loop.
The UpdateData actually updates the data, and posts a message for the window to update, however, the message can't be processed until you leave this loop - that's why you only see the last number.
You can modify your code as follows to see each value. (and as noted, your loop control variable should be an int instead of a double).
void CEditDlg::OnButtonOK()
{ UpdateData();
for(int i=0;i<=25;i++){
m_d1=i;
UpdateData(false);
GetDlgItem(IDC_YOUR_EDIT_BOX_ID)->UpdateWindow();
Sleep(10);
}
}
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
|
|
|
|
|
|
IMediaSeeking is a COM interface. You can query the filter graph manager to obtain a pointer
to the interface (saves you the trouble of finding a certain pin to get the interface on!):
IMediaSeeking *pSeeking = 0;
hr = pGraphMgr->QueryInterface(IID_IMediaSeeking, reinterpret_cast<void**>(&pSeeking));
Note that not all filters support seeking. See Seeking the Filter Graph[^]
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Actually I found out that I can not use seeking for the AVC decoder (by using GetCapabilities). So, I think maybe it is possible to use seeking directly to the demux filter. Is it possible?
-Houari
|
|
|
|
|
houari_id wrote: I think maybe it is possible to use seeking directly to the demux filter. Is it possible?
Have you tried to obtain the IMediaSeeking interface from the filter?
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi
Could any one please tell what api I should call to display chm help files ?
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Zainu wrote: Could any one please tell what api I should call to display chm help files ?
Have you tried ShellExecute() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Hi All,
Is there any way to generate DTD of XML file using VC++?
Any APIs?
Thanks.
--------------------------------------
Sorry, if u have read weird question..
|
|
|
|
|
|
|
|
I would be inclined to use:
void CMyClass::OnUnload()
{
CInternetSession m_Inet;
CFtpConnection* pConnection = NULL;
try
{
pConnection = m_Inet.GetFtpConnection(sServer, m_sUsername, m_sPassword));
...
}
catch (CInternetException e)
{
TCHAR szCause[255];
e.GetErrorMessage(szCause, sizeof(szCause));
AfxMessageBox(szCause, MB_ICONERROR);
}
if (pConnection != NULL)
pConnection->Close();
delete pConnection;
}
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
(Thanks for your answer.)
"CInternetSession m_Inet;" is declared as a class member but not initialized.
The "AfxMessageBox()" declared in the "catch" statement is not displayed.
The "GetFtpConnection()" function displays the following error messsage:
"220 NET+OS 6.3 FTP server ready"
"530 Not logged in"
and then it makes my function exit.
When I set some breakpoints with VS6, the debugger does not stop on them.
The end of my function is never reached!
Any more ideas, please?
Pascal
Thanks and regards
Pascal
|
|
|
|
|
Pascal Pinchauret-Lamothe wrote: "CInternetSession m_Inet;" is declared as a class member
Which would seem problematic since you also have one declared in the OnUnload() method.
Pascal Pinchauret-Lamothe wrote: The "GetFtpConnection()" function displays the following error messsage:
Where? In a window, or at a command prompt?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
i have to create windows explorer style mfc application. like file right click and windows right click how to do this. i am having a listcontrol to display files.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Do you want to show popup menu on the listctrl
|
|
|
|
|
Your answer was provided (twice) here.
"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 an application which shows map of a city. The picture is stored as EMF. The application has zoom in and zoom out facility.
I need to hide detailed texts and lines when zoom out to small, for better clarity of the city map. The text and lines will have different sizes. The small sized objects need to be hidden.
I am trying to use EnumEnhMetaFile for this purpose. But I dont know how to identify the size of text and lines in the EnhMetaFileProc with the current size of the image.
Could anybody help me?
Thank you.
- NS -
|
|
|
|
|
NS17 wrote: I need to hide detailed texts and lines when zoom out to small, for better clarity of the city map.
i might be wrong, but i don't think you can do conditional drawing inside EMFs. at least, you can't save the condition - of course you can draw based on whatever logic you want, you just can't save the app logic along with the GDI commands.
|
|
|
|
|
Ofcourse I did some logic inside my app for this. Let me show some code snippet that I did experimentally.
int CALLBACK EnhMetaFileProc( ...... )
{
static bool bTextout = true;
if( lpEMFR->iType == EMR_SELECTOBJECT )
{
PEMRSELECTOBJECT p = (PEMRSELECTOBJECT)lpEMFR;
LOGFONT lf = { 0 };
if( sizeof(lf) == ::GetObject( lpHTable->objectHandle[p->ihObject], sizeof( lf ), &lf ))
{
if( lf.lfHeight >= -35 )
bTextout = false;
else
bTextout = true;
}
}
if(( lpEMFR->iType == EMR_EXTTEXTOUTW ) || ( lpEMFR->iType == EMR_EXTTEXTOUTA ))
{
if( !bTextout )
return TRUE;
}
::PlayEnhMetaFileRecord( hDC, lpHTable, lpEMFR, nObj );
return TRUE;
}
My problem is that I dont know how to identify the scaling. For example, how can I identify the following inside the EnhMetaFileProc...
EnumEnhMetaFile( dc, m_hEMF, EnhMetaFileProc, 0, CRect( 0, 0, 100, 100 ));
EnumEnhMetaFile( dc, m_hEMF, EnhMetaFileProc, 0, CRect( 0, 0, 500, 500 ));
Also I am not sure whether this is the correct method to do.
I did not get any details about this yet from MSDN or from net...
- NS -
|
|
|
|
|
Hi
I have worked with some nice apps like Remind! 5.45 and Macro Toolsworks 6.31. Many crackers have reported that such apps are not easy to crack.
Any guess, how they would have implemented crack-protection. If any one has idea or experience how to implement such crack-protection.
I need to implement similar crack protection in our VC++/MFC App. The idea is to make it more dificult to crack (i.e. with some check for anti-debugging, anti-cracking and anti-softice etc.)
I truly appreciate any help/ideas/reference links.
Thanks
Ana
-- modified at 8:28 Friday 6th April, 2007
|
|
|
|