|
There are some examples of video capture here[^] as to the detection is this motion or shape? This is more specialist so maybe searching MDSN will help. If not, a careful Google search is next.
Elaine
The tigress is here
|
|
|
|
|
hi..
I'm using MySQL and c++.
I used CDatabase and CRecordSet to access database.
I am trying to get the columns names from the given tables.
I look at the sql code and found
--> show columns from tableName; gives all the column names, type (int or memo..etc) etc.
----------------------------
column1 | column2 | column3 |
----------------------------
data1 | data2 | data3 |
----------------------------
In c++ using CRecordSet .. how am I going to get column names?
which are column1, column2, column3.
|
|
|
|
|
CRecordset has a GetODBCFieldInfo function that you can use to get the information on the fields such as the name of the field (column).
If a wizard fails to cast an enchantment correctly, is that a mis-spelling?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
|
Hello,
I have a CBitmap and load it.
CBitmap mybmp;
mybmp.Load(IDB_TEST);
However, my listbox overlaps the CBitmap.
How can i make CBitmap on top of other
controls?
Thanks a lot.
|
|
|
|
|
NewVCbie wrote:
How can i make CBitmap on top of other
controls?
What are you doing after mybmp.Load(IDB_TEST); with your bitmap ? Can you post some code ? Which listbox are you talking about ?
~RaGE();
|
|
|
|
|
actually i create a class CMyBitmap derived from CBitmap,
void DrawTransparent (CDC* pDC, int x, int y, COLORREF clrTransparency);
void Draw (CDC* pDC, int x, int y);
The actual call is
CMyBitmap bmpheader;
bmpheader.LoadBitmap(IDB_LISTHHISTORY);
bmpheader.DrawTransparent(GetDC(),24,85,RGB(255,0,255));
My bitmap is long and it hit some area where listbox is, but what happens is that the hit area appears that my bitmap is behind the listbox, i wanted the opposite. I wanted my bitmap to be on top of whatever control it encounter on its area..
Thanks...
Below is the Code:
void CDTGBitmap::Draw(CDC *pDC, int x, int y)
{
BITMAP bm;
GetBitmap (&bm);
CPoint size (bm.bmWidth, bm.bmHeight);
pDC->DPtoLP (&size);
CPoint org (0, 0);
pDC->DPtoLP (&org);
CDC dcMem;
dcMem.CreateCompatibleDC (pDC);
CBitmap* pOldBitmap = dcMem.SelectObject (this);
pDC->BitBlt (x, y, size.x, size.y, &dcMem, org.x, org.y, SRCCOPY);
dcMem.SelectObject (pOldBitmap);
}
void CDTGBitmap::DrawTransparent(CDC *pDC, int x, int y, COLORREF clrTransparency)
{
BITMAP bm;
GetBitmap (&bm);
CPoint size (bm.bmWidth, bm.bmHeight);
pDC->DPtoLP (&size);
CPoint org (0, 0);
pDC->DPtoLP (&org);
CDC dcImage;
dcImage.CreateCompatibleDC (pDC);
CBitmap* pOldBitmapImage = dcImage.SelectObject (this);
CDC dcAnd;
dcAnd.CreateCompatibleDC (pDC);
CBitmap bitmapAnd;
bitmapAnd.CreateBitmap (bm.bmWidth, bm.bmHeight, 1, 1, NULL);
CBitmap* pOldBitmapAnd = dcAnd.SelectObject (&bitmapAnd);
dcImage.SetBkColor (clrTransparency);
dcAnd.BitBlt (org.x, org.y, size.x, size.y, &dcImage, org.x, org.y, SRCCOPY);
CDC dcXor;
dcXor.CreateCompatibleDC (pDC);
CBitmap bitmapXor;
bitmapXor.CreateCompatibleBitmap (&dcImage, bm.bmWidth, bm.bmHeight);
CBitmap* pOldBitmapXor = dcXor.SelectObject (&bitmapXor);
dcXor.BitBlt (org.x, org.y, size.x, size.y, &dcImage, org.x, org.y,
SRCCOPY);
dcXor.BitBlt (org.x, org.y, size.x, size.y, &dcAnd, org.x, org.y,
0x220326);
CDC dcTemp;
dcTemp.CreateCompatibleDC (pDC);
CBitmap bitmapTemp;
bitmapTemp.CreateCompatibleBitmap (&dcImage, bm.bmWidth, bm.bmHeight);
CBitmap* pOldBitmapTemp = dcTemp.SelectObject (&bitmapTemp);
dcTemp.BitBlt (org.x, org.y, size.x, size.y, pDC, x, y, SRCCOPY);
dcTemp.BitBlt (org.x, org.y, size.x, size.y, &dcAnd, org.x, org.y,SRCAND);
dcTemp.BitBlt (org.x, org.y, size.x, size.y, &dcXor, org.x, org.y,SRCINVERT);
pDC->BitBlt (x, y, size.x, size.y, &dcTemp, org.x, org.y, SRCCOPY);
dcTemp.SelectObject (pOldBitmapTemp);
dcXor.SelectObject (pOldBitmapXor);
dcAnd.SelectObject (pOldBitmapAnd);
dcImage.SelectObject (pOldBitmapImage);
}
|
|
|
|
|
It seems like you are just drawing the bitmap in the parent window, so any child control (e.g., the listbox) will be drawn on top of it. I suggest creating a static control with the SS_OWNERDRAW style. Put this control at the top of the children z-order and use CDTGBitmap to do the drawing in the parent's handler for the WM_DRAWITEM message.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi everybody. I got an MFC related question. I am using some Radio Buttons, but I cannot add them as Control-type variables (in the Member Variables section of the Class Wizard). I don't know why. It's pretty strange. For example when I drag and drop buttons, checkboxes or edit boxes, I can use the Class Wizard to set them a control variable so that I can work with those variables in the code to do enabling, disabling of the control etc). Unfortunately, when I drag and drop a radio button, nothing appears in the Class Wizard's Member Variables section. I guess I could add those Radio Buttons in the Header file of my Dialogue, but I don't know what's their class name. Like buttons have CButton... what do radio buttons have?
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
I think, you didn't set the "Group" property of the radio button while describing the properties. Once you say that they are in a group, then you would be able to see in the Class Wizards. Other way is that at run time use GetDlgItem() and pass the radio button's ID, then you would be able to get the CWnd type and then you can parse as CButton also.
Radio buttons are type of CButton only.
If the replies helps you, then rate them.
|
|
|
|
|
Yeap, that was the problem. Thanks Neelesh, Rage & David Crow ::- D.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
A radio button is indeed ... a CButton . And it is actually possible to map a member variable to radio button, check it again : drop your radio buton, change its name in the properties, and recheck your class wizard.
You may notice that CButton has member functions such as CButton::SetCheck , CButton::GetCheck , which are indeed very useful when it comes to radio buttons...
~RaGE();
|
|
|
|
|
Read here for a quick excerpt on why radio buttons behave the way they do.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi, everyone:
I plotted a BMP picture in the OnDraw( ) inside a CView class. Everything seems ok.
The problem is whenever I dragged the main window partially out of screen, then dragged back, the View did not redraw it automatically as it should be and messed up the view area. So I have to refresh the view window manually.
looks like a simple question. Any idea to solve it?
Thanks in advance.
Tracy
|
|
|
|
|
I think you have plot the BMP picture in OnPaint() message handler instead of OnDraw(); Other wise call UpdateAllViews() member function.
If the replies helps you, then rate them.
|
|
|
|
|
i just tried this code..i didnt put any of WM_PAINT or WM_ERASEBKGROUD
but still it works fine
/////////////////////////////////////////////////////////////////////////////
// CTesttestdeleteView drawing
void CTesttestdeleteView::OnDraw(CDC* pDC)
{
TesttestdeleteDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
CDC memDc;
memDc.CreateCompatibleDC(pDC);
memDc.SelectObject(&bitmap);
pDC->BitBlt(10,10,50,50,&memDc,0,0,SRCCOPY);
}
ths workd absolutely fine
|
|
|
|
|
Have a look in onerasebackground as well.
-prakash
|
|
|
|
|
Try using
Invalidate(TRUE);
Ash
|
|
|
|
|
for some reason, that I cannot find why my application crashes when quitting, I can step right through ( spelling please ) CWinApp::ExitInstance and seems to crash just in :
exit(mainret); in WinMainCRTStartup ( which ever the right name is depending on the different defines ) in crt0.c
unfortunatly, VC does not give a call stack or anything that could help.
Anyone using boundschecker 7.2 with VS.net 2003 ?
some of my memory allocation get reported as "Allocation Conflict", allocated by new ( eventually by _malloc_dbg_ in the MS files ) but freed by delete; seems Boundschecker is all mixed up when used with MFC and there are other problems else where.
also, still with boundschecker, in a really simple project ( multi-threaded debug statically linked MFC wizard generated project ) I try to open ( and close ) a simple text file like this :
FILE *myFile;
myFile = ::fopen("tata.txt", "r" );
if (!mdpFile)
{
ASSERT ( 0 );
}
::fclose( myFile );
myFile = NULL;
and it gives a couple of memory leaks related to multithreaded within stream.c ( and mlock.c )
any ideas, hints, suggestions, pressure valves ?
Thanks.
Max.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Well, This is not going to be an answer to you,
Generally If i am quite sure that I have take care of memory leaks, and the leak is somewhere in Core dlls,
I ignore them.
May be Microsoft will post a new patch tht takes care of this mem leak.
-prakash
|
|
|
|
|
I'm trying to interface a DLL parameter with .Net String variable.
How do I convert the .net String type to LPSTR used on DLL parameter ?
Like this:
LPSTR sUser = this->edtUser->ToString();
but this cause the following error :
error C2440: 'initializing' : cannot convert from 'System::String __gc *' to 'LPSTR'
Fernando Oliveira
|
|
|
|
|
|
A quick glance in MSDN shows that the String class has a method called ToCharArray . Have you tried that?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hello.
I keep getting the following messages in my output windown when I start my debugger. Do the messages below indicate that I need to install more files. By the way I am using Visual Studio Enterprise Developer:
'OIRP Test.exe': Loaded 'C:\Documents and Settings\user\My Documents\Software Development and Utilization\C Programming\OIRP Test\Debug\OIRP Test.exe', Symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\NTDLL.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\mfc71d.dll', Symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\msvcr71d.dll', Symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\KERNEL32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\GDI32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\USER32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\SHLWAPI.DLL', No symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\ADVAPI32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\rpcrt4.dll', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\msvcrt.dll', No symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\comctl32.dll', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\OLEAUT32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\OLE32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\MFC71ENU.DLL', No symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\MSCTF.DLL', No symbols loaded.
The program '[1552] OIRP Test.exe: Native' has exited with code 0 (0x0).
Thanks for any help you can provide.
Thanks for your answers.
|
|
|
|
|
|