|
what error you have previous error can you show your code that how to use to change background color
whitesky
|
|
|
|
|
If you are using VS 2003 or VS 2005, you will found that the definition of SetDialogBkColor function in afxwin2.inl file is:
_AFXWIN_INLINE void CWinApp::SetDialogBkColor(COLORREF , COLORREF )
{
}
Therefore it does nothing. Documentation says that it is obsolete. You should consider other solutions.
|
|
|
|
|
ok... i Understood
instead of calling the ChangeDialogColor from onPaint
call this Function as the first line of OnCtlColor funtion
nave
|
|
|
|
|
No its not working.
Thanks for ur reply.
|
|
|
|
|
ok another way...
forgot every thing done before...Now do as below
1. Create a member variable of CBrush say m_BkBrush
2. Write Function like this
ChangeColor( COLORREF clr_i )
{
if( m_BkBrush.m_hObject )
m_BkBrush.DeleteObject();
m_BkBrush.CreateSolidBrush( clr_i )
Invalidate();
}
3. Call this function in the OnInitDialog and where ever u want to change the color
4. now overide the WM_CTLCOLOR message and inside that write as below
HBRUSH MYDialog::OnCtlColor( CDC* pDC_i, CWnd* pWnd_i, UINT uCtlColor_i )
{
HBRUSH hDefaultBrush = CDialog::OnCtlColor( pDC_i, pWnd_i, uCtlColor_i );
if( CTLCOLOR_DLG == uCtlColor_i )
{
return m_BkBrush;
}
return hDefaultBrush;
}
try and tell me the result..;)
nave
|
|
|
|
|
Sorry, its not working.
|
|
|
|
|
ok yaar..I cannot figure out why its not working....
Well...Where r u working..? I am from India->Kerala..
nave
|
|
|
|
|
Tried using this code for executing insert query,but doesnt work..Is something wrong,or is ther any other method to do dat?
_Commandptr m_pCommand;
_Recordptr pRs;
m_pCommand.CreateInstance(__uuidof(Command));
m_pCommand->ActiveConnection = m_pConnection;
m_pCommand->CommandText = "insert into wcs values('uu',6,8,7,6,8,'hi')";
pRs.CreateInstance(__uuidof(Recordset));
pRs->PutRefSource(m_pCommand);
|
|
|
|
|
What is the error u r getting ??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
query is written in a try block(dont ask me 2 write it elsewhere!)..throws an exception..
|
|
|
|
|
I think the exception is due to some problem in the Insert command.verify it once.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
YES!!
|
|
|
|
|
|
Hi,
I have a dialog box in my ATL exe, I want to use/link a C Library. AFter clicking OK button on the dialog on of C functions should execute .
How to do this. linking the Clibrary and opening the C function.
Can I use the C code direct in ATL module ? how?
marcoslav
|
|
|
|
|
This is not the right forum to post the Question.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
noone answers there in ATL so posted here
|
|
|
|
|
As we know, when we want to shut our computer,
the system pop up a shuting window,
and the screen is locked, that the color lightness is gradually decreased , and the mouse click is invalid.
following is some codes to create this function, and I don't know why it be this way?
////////////////////////////////////////////////////////
byte pbit[16]=
{
0x55, 0, 0xaa, 0x0,
0x55, 0, 0xaa, 0x0,
0x55, 0, 0xaa, 0x0,
0x55, 0, 0xaa, 0x0,
};
HBITMAP hbm=CreateBitmap(8, 8, 1, 1, pbit);
HBRUSH hbr=CreatePatternBrush(hbm);
HDC pdc=::GetDC(0);
SelectObject(pdc, hbr);
PatBlt(pdc, 0, 0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
0xa000c9 //BLACKNESS//DSTINVERT//PATINVERT
);
DeleteObject(hbm);
::ReleaseDC(0, pdc);
//end
1.When I move the window (this cwnd) the screen changed, but the WINDOWSXP doesn't do it , how I do it , on the other hand , how to mask the message that not sent to the current shuting CWnd?
2.Byte Array pBit , what its function?And what 0xa000c9 is ?
If you had some good codes about this , please give me for some references, thank you!
Online waiting for answers!
Just my interest for these common things
|
|
|
|
|
|
ok, thank you very much!
that's what I want!
Just my interest for these common things
|
|
|
|
|
I'm working on an app that needs to work with both ascii and unicode, but I seem to have run into a rather frustrating problem.
It seems that for some reason, whenever I pass a unicode string to COleVariant.SetString(), the bstrVal only contains the unicode string up to the first NULL character in the string(regardless of the VARTYPE parameter). Hence most of the unicode strings are prematurely truncated. If I remember my unicode correctly it requires a double NULL to indicate the end of a unicode string does it not?
Anybody know of why this may be and how I can fix it?
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
While a BSTR can technically contain any data at all, it's most often used to hold a C-style (zero-terminated) UTF-16 string. Many BSTR wrappers also make the same assumption. Step into the COleVariant code and see if it is doing this.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
If no other solution, you can use an alternative approach, based on STL strings: std::wstring for Unicode or std::string for ANSI. This kind of strings allows null character within the string.
For instance:
std::wstring s = L"abc";
s += L'\0';
s += L"def";
size_t length = s.length();
wchar_t c;
c = s[2];
c = s[3];
c = s[4];
const wchar_t * p = s.c_str();
Next, if you need this as OLE variant, I think you can use "safe arrays" for this. For instance, this fragment copies the above string to a safe array:
CComSafeArray< USHORT > sa;
sa.Add(s.length() + 1, (USHORT*)p);
Hope it helps.
-- modified at 3:58 Friday 16th June, 2006
|
|
|
|
|
Thanks for the suggestions. I managed to fix(hack) it. I was already using safe arrays as the task I'm performing must communicate with older COM and OLE objects. The problem seemed to be an error in one of the OLE cpp files in the MSVS directory. It seemed to call a standard strlen function regardless of the input type so I've changed the code to check for unicode and call wcslen if needed.
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
hi,
I got your reply and i follow it and i set up all directories which you mention in mail and ide also. you send me path and i click that path i got the page microsoft and in this page there some resolution and i follow the 2nd resolution in which the spawning error is mention and some process how you eliminate spawning error. but i am not succed in that i properly follow the step but still i got spawning error. tell the region how can i eliminate the spawning vcspawn.exe error.
Thanks
Nitin Dalal.
nitin
|
|
|
|
|
In my view, you should just uninstall visual studio or visual c++ what ever you have installed and reinstall it.
It would take not more then 30 min. Do it and then tell us if problem remains.
Wishing you best of luck...
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|