|
Hi Firends,
I am using the fllowing code to create a meta file
HDC hDCMeta = CreateEnhMetaFile(m_hDC, "D:\\Data.emf", NULL, buf);
m_hDc is handle to printer dc. buf represents the name of application.
after creating the meta file I am drawing some information with m_hDC and at the end closing the metafile.
m_hMeta = CloseEnhMetaFile( hDCMeta );
CloseEnhMetaFile() function fails as it returns NULL but when tring to get the error message using GetLastError its returning ERROR_SUCCESS.
Before calling CloseEnhMetaFile() I prompted a messagebox and checked that the file Data.emf created in D:\ drive with size more than 1 GB. (I am having 1 GB ram).
soon after CloseEnhMetaFile() call fails the file also get delete disk.
Please help.
Sandip
|
|
|
|
|
Hi all,
I have made a static text box in my application. i want to make the text of that static dialog box as BOLD. I dont want to change the font just want to make it as bold....
How could i do so....
Thanks in advance
|
|
|
|
|
Add a control variable to your static control (m_static here) and add a CFont member to your class (myFont here). You could then apply the bold style to the font in your control like this:
CFont *font = m_static.GetFont();
LOGFONT lf;
font->GetLogFont(&lf);
lf.lfWeight = FW_BOLD;
myFont.CreateFontIndirect(&lf);
m_static.SetFont(&myFont);
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I am unable to get which type of variable is myFont
|
|
|
|
|
it's a CFont , I suppose.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I suppose she's going to declare the font object to be function local.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
From my (Italian) point of view your most challenging supposition is about OP gender.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Neha = Indian lady name.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I supposed!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I said it in my previous reply[^] to you:
Rajesh R Subramanian wrote: and add a CFont member to your class (myFont here).
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Also, please make sure that you do NOT have that CFont object (myFont) declared in a local function, but instead as a member of your class. This is to prevent the font object from going out of scope prematurely.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
There's an example in the Extras section of this article.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi all
i am getting warning while build my project.how to remove warning C4996.
|
|
|
|
|
By not using deprecated functions anymore. Check the documentation of these functions, you'll see that there is a new version of them (more safe). You should use those ones instead.
Another alternative to simply disable the warning in the project options (or with a pragma).
|
|
|
|
|
how to disable the warning in the project options
|
|
|
|
|
For VC2005:
Menu 'Project' -> "... Properties" -> "C/C++" -> "Advanced" -> "Disable Specific Warnings". Put 4996 there.
BTW, looking through the project options to see what you can do there is sometimes not a bad idea (unless you start changing everything). You might even learn some interesting stuff.
|
|
|
|
|
thanx a lot Cédric Moonen
|
|
|
|
|
Most of these "deprecated" functions are only deprecated in Microsoft's eyes but NOT according to the C++ standard.
Steve
|
|
|
|
|
Yes I know. But there is a security issue with functions like sprintf and so on... And here, for once, I agree with Microsoft that you should use a more secured version, even if it's not in the C++ standard.
|
|
|
|
|
Dear all,
I have a MFC project which initializes the webcam(if available) and capture video. But i need to use this with a website. So i need to convert this into the ocx application.
Could you anybody help me on how to do this? Plese show me some tutorials or guide me in step by step.
Thanks in advance
|
|
|
|
|
Member 3419253 wrote: or guide me in step by step
do you want guidance in creating an active x control in vc++6.0?
|
|
|
|
|
yes. i need guide lines.
I f you have any sample applications please provide me
|
|
|
|
|
Please help me to convert the Dialog based MFC application into the ocx application in order to provide that into the web site.
Thanks in advance.
|
|
|
|
|
i have 2 files.. want to merge this file...
say the format will be like this
file 1.
how are u
and file 2 contains
doing there?
so the result has to be
how are u doing there?
how can u do this?
|
|
|
|
|
You don't talk about what happens if the file contains multiple lines. How is the resultant file displayed then.
However, can you specify what is the real problem. Here is the algo:
1> read from 1st file
2> read from 2nd file
3> concatenate the data and write it in one go or write it one at a time as soon as you get it [for this use seek()]
4> Close files.
I hope I understood you correctly.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|