|
http://www.develop.com/essentialcom/[^]
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I am trying to create a visualization for WMP that uses a webcam in it. For the moment i just want to preview the webcam in the visualization but im finding it hard to do so.
Can anyone help me out here?
|
|
|
|
|
Hi all,
Can anyone please tell me , where can I get GDI+ in VC++ 6.0 for download.
Thanks
George
-- modified at 8:39 Tuesday 7th November, 2006
|
|
|
|
|
Search for the latest Platform SDK install. Even though it technically no longer supports VC++ 6.0(!), you should be able to get the redistributes necessary to build under VC++ 6.0.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
class A
{
public:
void print()
{
printf("print A");
}
virtual void write()
{
printf("write A");
}
};
class B: public A
{
public:
void print()
{
printf(" print B");
}
virtual void write()
{
printf("write B");
std::cout<<"try";
}
};
int main()
{
// A *pA = new A;
// pA->print();
// pA->write();
A *pB = new B;
pB->print();
pB->write();
return 0;
}
Thanks & Regards
rakesh baldha
|
|
|
|
|
A virtual table is a table containing the addresses of all the virtual functions of the class that was instancied (so that the call can be redirected to the correct derived class function). In your example, print was not declared as virtual so it is not in the vtable but write is virtual (so it is in the vtable).
So in this statement:
A *pB = new B;
pB was declared as a pointer to an object A and was instancied as a pointer to an object B. So, the virtual table contain one virtual function (the write function) that is redirected to the write function of the B class. For the compiler pB has been declared as a pointer to A so if you call print, it will call print from the class A (the call is not redirected because the function is not in the vtable). When you call write, the call will be redirected to write of the B class because of the vtable.
I hope this is clear...
|
|
|
|
|
thank you very much.
Thanks & Regards
rakesh baldha
|
|
|
|
|
You're welcome.
Please next time use the pre or code tags and indent your code correctly so it will be more readable.
|
|
|
|
|
Hello,
I have a problem with static variable into MFC dll .
In header I have a static variable:
static UINT OPC_SERVER_TYPE;
In source I have :
UINT OPCServer::OPC_SERVER_TYPE=20;
When I compil my project were I use the lib and dll and I compil the project with "Use MFC in a Static Library" I get those error:
GMMSoftware_V04.00b.obj : error LNK2001: unresolved external symbol "public: static unsigned int OPCServer::OPC_SERVER_TYPE" (?OPC_SERVER_TYPE@OPCServer@@2IA)
When I compil my project with "Use MFC in a Shared DLL" it work good!
What can I change in my class into MFC dll project to fix the problem ?
Thank you!
AutreChien
|
|
|
|
|
If you are using MFC in a DLL and in an application (EXE) you may want to take a look at this:
Extension DLLs[^]
|
|
|
|
|
Hi,
I am making a dialog based application on VC7 using MFC.
At run time I am creating a ListCtrl on this dialog box.
But Horz/Vert Scroll Bar are not showing in my ListCtrl.
Reply soon,
Thanks,
|
|
|
|
|
They will not be shown unless, no. of items in listctrl are more that maximum possible visible items in your control.
|
|
|
|
|
The number of items are more but the scroll bars are not shown. While if i do the same in VC6 then they are shown. I have tried to set WS_VSCROLL and ShowScrollBar(WS_VERT,TRUE)
but no success.
-------//-----
// //
//-----
____// \\
---// \\AKESH
|
|
|
|
|
What type you have set to view(list, report , icon etc.)?
Have you set No Scroll property to false ?
|
|
|
|
|
Get_Rakesh wrote: At run time I am creating a ListCtrl...
Is this something that cannot be created at design time?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I need to create an application that controls a USB storage device just plugged in.
When I use WM_DEVICECHANGE notification, I am able to get the details of plugged in device like any other applications registered for a notification.
Instead of being one such application that handles notification, I want to take charge of the USB device from the moment it is plugged in.
(I guess it need some driver programming)
Kindly provide a solution for the same.
Biju Raman K
|
|
|
|
|
Biju Raman wrote: Instead of being one such application that handles notification, I want to take charge of the USB device from the moment it is plugged in.
What do you mean by taking charge of it ? It is a storage device so you can access it like a standard 'hard-drive' if you want to read or write files.
What's the problem exactly ? What are you trying to do ?
|
|
|
|
|
Dear Cedric Moonen,
Thanks for your prompt reply!, and of course sorry for my delay!
Actually, I am writing a program that need to taking charge of the USB drives being plugged in and authorizing it.
When a drive is being plugged in, I could use the wm_devicechange message handler.
LRESULT CMyDialog::OnMyDeviceChange(WPARAM wParam, LPARAM lParam)
{
EnumUSBDevices();
CString strDrive;
for(int i=0; i<m_list.GetItemCount(); i++)
{
strDrive=m_list.GetItemText(0, i);
if(IsAuthorizedDrive(strDrive))
{
//Allow device
}
else
{
BlockDeviceUsage(strDrive);
}
}
}
In essence, I need to write BlockDeviceUsage(); to disallow the user from using the drive. (other than by unmounting the drive).
I should be able to "take charge" of whether the drive should be allowed to work in the machine.
Expecting your reply...
Biju Raman K
|
|
|
|
|
I can't BitBlt from HDC create using CreateDC() to screen
code:
HDC hdc = CreateCompatibleDC(CreateDC(TEXT("DISPLAY"),0,0,0));
RECT r;
r.bottom=100; r.left=0; r.right=500; r.top=0;
::DrawText(hdc, "zcxvzxcvcv", 10, &r, DT_LEFT);
::BitBlt(::GetDC(this->m_hWnd), 0, 0, 500, 500, hdc, 0, 0, SRCCOPY);
Nothing appear on my dialog box, normally, text "zcxvzxcvcv" will appear
|
|
|
|
|
Out of interest, why
HDC hdc = CreateCompatibleDC(CreateDC(TEXT("DISPLAY"),0,0,0));
instead of
HDC hdc = CreateCompatibleDC( your-window-dc-here )
Incidentally, your use of GetDC and CreateDC will make it very difficult to tidy up afterwards...
Oh, and before I forget, when you create a compatible DC, you get a default monochrome bitmap as the drawing surface, which is 1x1 in size, which should answer your question.
Steve S
Developer for hire
|
|
|
|
|
I want to make an overlay, so I save image in another dc, when the dialog redraw, this dc will be draw on dialog
|
|
|
|
|
If you want to create a memory DC to keep the image in, you need to do something like this:
HDC wDC = ::GetDC(m_hWnd);
HDC memDC = ::CreateCompatibleDC(wDC);
HBITMAP hBMP = ::CreateCompatibleBitmap(wDC, 500,500); // or whichever size
hBmp = (HBITMAP)SelectObject(memDC, hBMP);
// Now do your drawing to your memory DC
// Now do your BitBlt
// And tidy up..
ReleaseDC(m_hWnd, wDC);
// To clean up memory DC
hBMP = (HBITMAP)SelectObject(memDC, hBMP); // Restore 1x1 bitmap
DeleteObject(hBMP);
DeleteDC(memDC);
The DC is a precious resource. Using CreateDC("DISPLAY",..) just to get a DC to create a screen-compatible DC when you have a window is wasteful, your code did not have a way to delete the DC you created in this way. If you don't clean up, you'll run out of DCs. Maybe not today, maybe not tomorrow, but soon.
You probably want to make the bitmap and memory dc handles member variables for the dialog object class.
HTH
Steve S
Developer for hire
|
|
|
|
|
Thank you very much for the snippet
|
|
|
|
|
Can you explain why you use of this code HDC hdc = CreateCompatibleDC(CreateDC(TEXT("DISPLAY"),0,0,0)); ,please
|
|
|
|
|
[fx: telepathy mode on]
Because "CreateDC(TEXT("DISPLAY"),0,0,0)" gives me a display device context, which is what I want to be compatible with.
[fx: telepathy mode off, removes sarcasm extraction filter]
which of course, ignores the fact that there's a perfectly good display DC associated with the window, has total disregard for the need to delete the created DC, and has all the hallmarks of not having studied the Win32 API in any detail.
Remember the quote about an infinite number of monkeys with an infinite number of typewriters? Left long enough, they would produce the complete works of Shakespeare.
Well, think of these forums as a beta test for that project...
Steve S
Developer for hire
|
|
|
|