|
Does anybody know how to access OLE Object data members in access with CRecordSets.
I want to store a larnge array of numbers as OLE Object data type in MS Access and than store and update the data from CDaoRecordset derived classes. How can I do that... Hints?
Thanks
|
|
|
|
|
I am trying to use a CTreeCtrl in a CDialog box.
I want to set the background colour of the tree control to the same colour as the dialog. I have tried using setBKColor(COLORREF clr), however this didn't work, I also tried getting the CDC from the CTreeCtrl and seting the color that way and it still didn't work.
Any ideas on why?
do I need so set some special property to enable me to change the background?
cheers
Andy
|
|
|
|
|
CTreeCtrl::SetBkColor works perfectly for me. The method is implemented with TVM_SETBKCOLOR, which is available on Win98, Win2000 or on systems with IE4 or later installed. Maybe you're using some ancient Windows version?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Yep it appears you are right.
What i was trying to do was get the colour of the dialog that the tree control was on, and set the background of the tree control to that colour. It appears that the setting of the tree control background was working fine, but getting the colour from the dialog was not working, it was always returning white, when I want the dodgy windows grey colour!
any ideas how to get the real background colour of the dialog.
cheers
Andy
|
|
|
|
|
::GetSysColor(COLOR_3DFACE);
And if words were wisdom, I'd be talking even more. The Offspring, I Choose
|
|
|
|
|
|
You want this:?
const int d = 100;
int var[d];
for (int i = 0; i < d; ++i)
var[i] = 0;
cout << var[5];
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Not really, even though that is the most logical way to do it. I am curious to know whether in C it is possible to substitute a piece of a variable name with something like a string. e.g:
int variable = 7;
char c[] = "able";
cout << vari%c;//no problem here b/c I'm using a placeholder or such.
ralf.riedel@usm.edu
|
|
|
|
|
RalfPeter wrote:
I am curious to know whether in C it is possible to substitute a piece of a variable name with something like a string.
No, compiled languages like C and C++ do not retain 'variable names' in generated code. Constructs like yours are generally used in scripts.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Your looking for enum() kind of functionality, as found in high level languages such as Perl and SQL. Obviously this isn't possible with a compiled language, because you'd have to ship the compiler with the application!!!
Sorry (again) thomas, but you did say you liked mail.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hi,
How can get the free space available in a drive?
Thanks
Neha
|
|
|
|
|
GetDiskFreeSpace() ought to do the trick.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
BOOL GetDiskFreeSpaceEx(a,b,c,d);
a = "c:\directory" or NULL. If NULL, function returns space in drive where function resides.
b = pointer to variable to receive free bytes available to user of the calling thread.
c = ditto for available (free+used) bytes.
d = pointer to variable to receive total bytes on disk.
ralf.riedel@usm.edu
|
|
|
|
|
I found a smaple code from MS. And here is the link:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q231497
|
|
|
|
|
I do some works on WM_PAINT:
//////////////////////////////////////////////////////////////////////////
CDC* pDC = GetDC();
CDC cacheDC;
cacheDC.CreateCompatibleDC( pDC );
if( m_pBitmap == NULL )
{
m_pBitmap = new CBitmap;
m_pBitmap->CreateCompatibleBitmap( &cacheDC, m_ClientRect.Width(), m_ClientRect.Height() );
}
CBitmap* pOldBmp = cacheDC.SelectObject( m_pBitmap );
cacheDC->SetTextColor( RGB(0, 0, 255 ) ); //color blue
cacheDC->TextOut( "hello world" );
pDC->BitBlt( m_ClientRect.left,
m_ClientRect.top,
m_ClientRect.Width(),
m_ClientRect.Height(),
&cacheDC, 0, 0, SRCCOPY );
cacheDC.SelectObject(pOldFont);
cacheDC.SelectObject( pOldBmp );
cacheDC.DeleteDC();
//////////////////////////////////////////////////////////////////////////
But the text out is still black, what's the matter? May be I forget some steps?
I'm amumu, and you?
|
|
|
|
|
Your bitmap is monochrome. Change the 1st parameter in CreateCompatibleBitmap to pDC.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Aprt from what Tomas said, you should also be calling SaveDC() and RestoreDC(-1) on your cacheDC object. Although you select back in the original font/bitmap, you shold also restore the original text colour.
DC's should always be returned to the system in the exact state you got them. Thats why SaveDC() / RestoreDC() is so good for you in this situation.
CDC* pDC = GetDC();
CDC cacheDC;
cacheDC.CreateCompatibleDC( pDC );
if( m_pBitmap == NULL )
{
m_pBitmap = new CBitmap;
m_pBitmap->CreateCompatibleBitmap( &cacheDC, m_ClientRect.Width(), m_ClientRect.Height() );
}
caccheDC.SaveDC() ;
cacheDC.SelectObject( m_pBitmap );
cacheDC->SetTextColor( RGB(0, 0, 255 ) );
cacheDC->TextOut( "hello world" );
pDC->BitBlt( m_ClientRect.left,
m_ClientRect.top,
m_ClientRect.Width(),
m_ClientRect.Height(),
&cacheDC, 0, 0, SRCCOPY );
cacheDC.RestoreDC(-1) ;
cacheDC.DeleteDC();
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
|
|
|
|
|
I'm working on a project that uses multiprocessor computer. I want to use multithread teachnique for this and assign a specific thread to a specific CPU. I'm searching materials for my project. Please show me some if you know about this field.
Thanks a lot.
dxKy
|
|
|
|
|
Dang Xuan Ky wrote:
I want to use multithread teachnique for this and assign a specific thread to a specific CPU.
SetThreadAffinityMask does that.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Be careful though, the OS is pretty good at dividing your threads up between CPU's, and if you start trying to force a thread to a cpu, you may well in fact decrease your application's performance.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Jon is correct. You really shouldn't be assigning threads to a CPU. Unless you really have a very strong grasp of the ramifications, you are likely to degrade performance.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Maybe you guys should answer to the original poster? He'll get email notification, etc.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
We thought you'd like the email!!! personally, i *love* getting mail that i don't care about
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Jon Hulatt wrote:
We thought you'd like the email!!!
I do I'm just worried about our multi-threaded programmer who can be totally unaware about this discussion
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I think that I can use SetProcessAffinityMask. For a process I assign it to one CPU and the other to another CPU. The two process can communicate through share memory. That's all what I think but now I try to find a sample to demonstrate the using of SetProcessAffinityMask. I read it a lot in MSDN but nothing is found. If you have the code, please show me. Thanks everybody.
|
|
|
|