|
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
|
|
|
|
|
Hello,
Anyone can point me working a find string / replace function written in C (ANSI C).
Thanks.
|
|
|
|
|
Find a string in where?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Sorry,
I have an initial string, in which I have to find a substring and replace it with a diffrent one. Like Replace() from CString.
Thanks,
|
|
|
|
|
Check out the MFC source for CString?
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
micutzu wrote: I have an initial string, in which I have to find a substring...
Have you looked at strstr() or strchr() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Dear friends,
I want ot change look and feel of the basic screen to XP look and feel.
Please help me.
Megha
|
|
|
|
|
Are you looking for this[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You can create an XML file with the following content:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <br />
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><br />
<assemblyIdentity processorArchitecture="x86" version="5.1.0.0" type="win32" name="XPLooks" /> <br />
<description>Test Application</description> <br />
<dependency><br />
<dependentAssembly><br />
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="x86" /> <br />
</dependentAssembly><br />
</dependency><br />
</assembly>
Save the file as, for example, xptheme.xml
Then go to ResourceView and import this file. In Custom Resource Type, fill in "24" in Resource type. Finally, set the ID to "1".
-Houari
|
|
|
|
|
Hi,
I need to handle del key for a dialog based appliation.what should I do??
I did as shown below .
void C3DColorCardDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
AfxMessageBox(_T("C3DColorCardDlg OnKeyDown"));
if (nChar == VK_DELETE)
{
}
CEFCBaseDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}
The problem is I am not getting the Message box on pressing a char or Del key.
Any Suggestions would be helpful.
Thanks
Satya
-- modified at 6:28 Friday 6th April, 2007
Today is a gift, that's why it is called the present.
|
|
|
|
|
Look here[^]
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Do you have any control on the forum?
|
|
|
|
|
Hi Folks,
why is MSVCP71D.dll being used? Regardless of release mode in the project settings it still link to this debug version DLL. I verified the additional dependencies and found no explicit link to this DLL.
i used dependency walker and found my release version DLL linking to this debug version DLL(MSVCP71D.dll)
Can anyone pls help me out of it ?
Hariharan.T
|
|
|
|
|
are you using some other debug library which uses this one ?
|
|
|
|
|
No.. all other dependencies are third party release versions DLL's and libraries, I verified.
Thanks,
Hariharan
|
|
|
|
|
Hariharan.T wrote: ...my release version DLL linking to this debug version DLL(MSVCP71D.dll)
Directly or indirectly?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It got fixed.. Thanks a lot for your suggestions.
The problem is the preprocessor settings pointed to _DEBUG, now i changed it to _NDEBUG. This solved the problem.
Hariharan.T
|
|
|
|
|
how to get DNS server address usin wmi
|
|
|
|
|
|
IWbemServices *pService = NULL;
IEnumWbemClassObject *pEnum = NULL;
...
HRESULT hr = pService->CreateInstanceEnum(_bstr_t("Win32_NetworkAdapterConfiguration"),
WBEM_FLAG_RETURN_IMMEDIATELY | WBEM_FLAG_FORWARD_ONLY,
NULL, &pEnum);
if (WBEM_S_NO_ERROR == hr)
{
IWbemClassObject *pClass = NULL;
ULONG ulReturned;
hr = pEnum->Next(WBEM_INFINITE, 1, &pClass, &ulReturned);
if (WBEM_S_NO_ERROR == hr)
{
_variant_t v;
hr = pClass->Get(L"DNSServerSearchOrder", 0, &v, NULL, NULL);
if (VT_NULL != v.vt)
{
LONG lBound;
BSTR Value;
SafeArrayGetUBound(V_ARRAY(&v), 1, &lBound);
while (lBound >= 0)
{
SafeArrayGetElement(V_ARRAY(&v), &lBound, &Value);
TRACE("DNSServerSearchOrder[%u] = %S\n", lBound, Value);
lBound--;
}
}
}
}
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
hi all
i am developing my own WAV toMP3 converter.i have seen method for mp3 conversion and they say that particular frequency range of sound data should be eliminated.
i wanted to know how to do that?as there is no field in WAVE header from where i can know the frequencies.
thanks i advance
|
|
|
|