|
Try:
CMyButton::CMyButton()
{
LOGFONT lf = {0};
_tcscpy(lf.lfFaceName, _T("MS Sans Serif"));
lf.lfHeight = 28;
lf.lfWeight = FW_BOLD;
m_font.CreateFontIndirect(&lf);
}
void CMyButton::PreSubclassWindow()
{
SetFont(&m_font);
CButton::PreSubclassWindow();
}
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
my msdn didn't find the proper article, can u send me a url to the online article please?
thanks
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Why did you not just Goggle for it?
Q179378
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
thanks works like a charm
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: is there a way to open the folder dir selection in a specified folder?
This requires a callback.
A quick search in the forum showed e.g. this article[^] as an answer to this all-time-favorite question.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
thanks!!!
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Hallo ,
I have the following problem: in a simple windows application "DynamicLoad.exe" a dll "DefExported.dll" is loaded. If I quit
the dll in InitInstance() with return FALSE instead of return TRUE,
I get memory leaks in the debugger at the end. Is it possible to change this?
Detected memory leaks!
Dumping objects ->
{96} client block at 0x0035A150, subtype c0, 64 bytes long.
a CDynLinkLibrary object at $0035A150, 64 bytes long
Object dump complete.
The program '[444] DynamicLoad.exe: Native' has exited with code 2 (0x2).
(Remark: FreeLibrary( hClcltr ) does not change anything, because return False results in 0 for HINSTANCE hClcltr=LoadLibrary("DefExported.dll").)
The problem is independent of the Microsoft Visual Studio Version (e.g. 6,7,8). The code to try out this, you can look at the page of "DLLs
are Simple! Part 3 By Mahmood Komeily" on this forum.
Just add in DefExported.cpp:
BOOL CDefExportedApp::InitInstance()
{
CWinApp::InitInstance();
return FALSE;
//return TRUE;
}
And in DefExported.h:
class CDefExportedApp : public CWinApp
{
public:
int Multiply(int ParOne,int ParTwo);
CDefExportedApp();
virtual BOOL InitInstance();
...
}
|
|
|
|
|
Check the dynamically allocated memory
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Thank yor for the fast answer.
I myself haven't forgotten to delete again new allocated memory.
Some memory allocations in the Microsoft code causes the leaks.
Maybe there exist work arounds: it's not necessary to quit the dll in
InitInstance(), it could be elsewhere. But in the dll it should be
decided that a loadlibrary-call returns with zero.
I thougth that this could be done best in InitInstance.
|
|
|
|
|
Is it possible to use unmanaged MFC classes from C#?
|
|
|
|
|
|
No just exported mfc classes.
|
|
|
|
|
Hi friends,
We are trying to Install Delegate, to be working alongwith the Vnc.
At the time of installing, we are encountering error.
Error is "cannot load Z".
We are executing 5LoavesSvc.exe on the remote machine which is running vnc server,but it vanishes from the Task manager,
Can Anybody help us out in sorting the problem.
With Rgds
Girish
Software Developer
|
|
|
|
|
Hello everybody
I want to start to programming a C++ chat small application. It my project.
Now I want to know what should I know? From to start? How to start? what I need?
All what I have now is visual C++ express and little c++ langauge experience. I know also that I have to make server code and client code.
Any one could guid me to some site where I might get help regarding my project?
Tahnks alot
Ajmi
|
|
|
|
|
moloza wrote: All what I have now is visual C++ express and little c++ langauge experience.
Which is a big indicator that you should probably start with something a little less ambitious. It's not my intention to burst your bubble, or thwart your desire to learn, but going about this project without even knowing where to start is akin to going up to the plate with two strikes against you (baseball analogy). It's going to be hard to pull it off.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: plate with two strikes against you (baseball analogy).
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
DavidCrow wrote: (baseball analogy)
Somewhat incomplete though. More like going to the plate "for the first time ever" already having two strikes.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
My program needs two same-model webcams , but when I connect them to my
computer, one of them that connected second , doesn't work and in device
manager in second device status this apears :
"This device cannot start. (Code 10)"
I need help to solve it
thank you
note : I dont want to solve it in my code,I just want to use two same-model webcams
-- modified at 9:33 Monday 8th May, 2006
|
|
|
|
|
Does the driver support two devices/cameras simultaneously?
My guess is a driver problem. Check the manufacturers web site.
|
|
|
|
|
no , it wasn't a problem of driver , I installed another driver ... nothing , and I know that another person solved it .
|
|
|
|
|
|
Can we write functions in a structure (struct) in C language. In C++, its possible. I have heard that we can write functions in C language using Function Pointers.. If anyone knows regarding this, please tell me.
|
|
|
|
|
|
C++-classes are really just structs with their members being private by default.
C-functions are not nested within structs.
But a C-struct can easily hold a function pointer - to a fuction defined and declared elsewhere.
In fact, this is very similar to what the C++-compiler does behind your back: Convert all functions of a class to global ones taking a first 'this' parameter defining all that distinguishes the instance from others of the same class.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
can any1 show me a code snippet for this?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|