|
I installed both 2003 and 2005 in my computer.
I guess some envriment variable has been set ambiguously.
Dilly
|
|
|
|
|
I think you are right, I find another .lib file built by 2003 which the project need to use.
Thanks a lot.
Dilly
|
|
|
|
|
Hi,
I have taken dialog based application.When i run the application the dialog is displayed in default color.I want to change the Background color of the dialog to RED color .
thanks in before
jamesrocky
|
|
|
|
|
Handle WM_ERASEBKGND .
BOOL CDlg::OnEraseBkgnd(CDC* pDC)
{
CBrush backBrush(RGB(255, 0, 0));
CBrush* pOldBrush = pDC->SelectObject(&backBrush);
CRect rect;
pDC->GetClipBox(&rect);
pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(),
PATCOPY);
pDC->SelectObject(pOldBrush);
return TRUE;
}
Nibu thomas
Software Developer
|
|
|
|
|
Sorry its not working, can be more clear..
thanks in before
Jamesrocky
|
|
|
|
|
Add a message map entry
BEGIN_MESSAGE_MAP(...,...)
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
//just add the rest of the code here...
Nibu thomas
Software Developer
|
|
|
|
|
I think you can use WM_CTLCOLOR and declare a variable CBrush
|
|
|
|
|
You can call the SetDialogBkColor() . You can have a look at this.[^]
Thanks,
Vini
|
|
|
|
|
Hi
USe this in WM_CTLCOLOR
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
hbr = CreateSolidBrush(RGB(134,179,174));
pDC->SetBkColor(RGB(255,0,255)); // Pass the RGB of RED color
return hbr;
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Hello, everyone!
I encounter a strange question.
I defined a singleton class like this:
static CMySocket& GetMySocket();
CMySocket& CMySocket::GetMySocket()
{
static CMySocket temp;
return temp;
}
In single thread, it works properly, but in Multi-thread, (I can ensure
in main thread, invoke CMySocket::GetMySocket first), when invoke GetMySocket
I get different instance , who can tell me , why?
Thanks a lot and best regards.
|
|
|
|
|
As i recall u need to declare a certain macro for a singleton class both when using it in a single threaded and apartment. try to look in the MSDN for DECLARE_CLASSFACTORY_SINGLETON macro.
hope this helps you
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote: try to look in the MSDN for DECLARE_CLASSFACTORY_SINGLETON macro.
that use to make COM Class SingleTon!
|
|
|
|
|
right!
if he isn't using COM, i suggest he use a protection (critical section) because if in multithreaded application both threads recquire an instance to the class, one should acquire a real one while the other acquire a false one.....
hope this helps
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
hi all,
is there a simple way to get as an input an english string i.e. "hello world" and then result a translated string say in russian/chinees/hebrew?
What I am looking for is that component for translating....? i know there are many programs that translates complete sites...just wondering what those program use?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote: i know there are many programs that translates complete sites...just wondering what those program use?
I very large word list!
Did you ever download one of those Translation applications? Didn't you ever wonder why it was so large?
If you are thinking of creating such a program there are many resources scattered over the internet. Try searching for word list and open source dictionaries. I recently developed an English/Chinese dictionary for a new PDA company in China. I used the open source CEDICT, with a few modifications I managed to create a reasonable app with 'enough' words at just under 3mb.
|
|
|
|
|
thanks for the reply.
i will search for word list as you suggested, chinese is very popular hopefully i will find my lingo as well
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hello everyone,
I have some questions about the keyword "__cdecl",
1. What is the function of this keyword? I read through the MSDN document, but still confused. Could anyone give me some brief and clear descriptions which are better than Microsoft?
2. If I am porting the source codes from Windows to Linux, does on Linux platform exist similar (or the same) keyword like __cdecl? How should I port source codes which has __cdecl keyword?
thanks in advance,
George
|
|
|
|
|
George_George wrote: Could anyone give me some brief and clear descriptions which are better than Microsoft?
This[^] should do.
Nibu thomas
Software Developer
|
|
|
|
|
Cool stuff! Thank you Nibu!
Do you have any ideas of how to deal with such keyword when porting to Linux?
regards,
George
|
|
|
|
|
George_George wrote: Do you have any ideas of how to deal with such keyword when porting to Linux?
I don't think it should make a difference. It will work the same way in Linux too. Well these are standard calling conventions hence porting it to Linux shouldn't cause problems.
But the bottom line is that these are implemented by compilers so the makers will make sure they implement the standard conventions.
__cdecl should behave the same way.
Note: This is my personal opinion. I cannot say how correct these are.
Nibu thomas
Software Developer
|
|
|
|
|
Thanks Nibu!
What means "But the bottom line is that these are implemented by compilers so the makers will make sure they implement the standard conventions"? Do you mean some compiler vendor does not implement this option?
Another question is that, how could I verify that __cdecl works and works the same approach as that under Windows?
regards,
George
|
|
|
|
|
1. In fact you have several calling conventions. A calling convention define which part, from the caller or the callee, will clean the stack when the function return. You have the standard convention and the C calling convention. Typically, cleaning the stack means: when you call a function and supply parameters to this function, these parameters are pushed onto the stack. These parameters needs then to be pulled off the stack when returning from the function. The calling convention defines which part will clean the stack (sorry, but I don't remember for __cdecl which part clean the stack).
2. Sorry, no idea about that
|
|
|
|
|
Thank you Cedric!
Great answer!
regards,
George
|
|
|
|
|
George_George wrote: 2. If I am porting the source codes from Windows to Linux, does on Linux platform exist similar (or the same) keyword like __cdecl? How should I port source codes which has __cdecl keyword?
The GCC compiler has function attribute cdecl which appears to be similar in meaning, but the syntax is different:
http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Function-Attributes.html[^]
|
|
|
|
|
Thanks markkuk,
I found the attribute name is the same -- cdecl. Why do you say that the syntax is different?
regards,
George
|
|
|
|