|
|
Ryan S Roberts wrote:
You can use directshow to enumerate AV capture devices(If their drivers are WDM complient.)
It also finds VFW Devices
|
|
|
|
|
I am trying to overide some functions in CPropertySheet. I created a CPropertySheet derived class and added it to my project. when I do this in the main program, everything is cool:
//in main.cpp
CMyPropertySheet m_sheet(IDS_CODE);
m_sheet.AddPage(&entry);
m_sheet.AddPage(&approach);
But if I delare the object in the header, like this I get errors:
//in main.h
CMyPropertySheet* m_sheet;
//in main.cpp
m_sheet = new CMyPropertySheet(IDS_CODE);
m_sheet.AddPage(&entry);
m_sheet.AddPage(&approach);
Errors I get are:
error C2228: left of '.AddPage' must have class/struct/union type
I am assuming that the error is in the way I am trying to declare the CMyPropertySheet object, but I cant think of any other way. What am I doing wrong?
Kevin Shaffer
kshaff03@msn.com
|
|
|
|
|
in the first way you use directly an object, and in the second method you use a pointer to an object...
Then your problem should be solved by changing m_sheet.AddPage(&entry); for m_sheet->AddPage(&entry);
it's an usual mistake...
take a look at the error: error C2228: left of '.AddPage' must have class/struct/union type if what is in the left of the member (method, function or variable) is a class, a union or a struct you will need the "." elsewhere you'll need the "->".
hope this helps.
|
|
|
|
|
Got it, thanks!
I learned all of my object-oriented programming in Java, still trying to work out all the subtle differences. Thanks.
Kevin Shaffer
kshaff03@msn.com
|
|
|
|
|
That happens to all of us... subtle differences are evil!
you are welcome!
|
|
|
|
|
This question concerns the VS 6.0 IDE environment.
I am working on a rather large project. One convenient thing is that
a separate (console) project contains several classes that we wish to
use in the larger project. Therefore we are looking for a way to (easily)
import these (console) classes into the larger project (SolverGUI).
Can I create the new project (call it SolverGUI) using the MFC appwizard and then go to Project-Insert Project into Workspace and insert the console project into the SolverGUI project? This is possible, I know, but after doing that, can I use the classes in SolverConsole in SolverGUI? Is it as simple as declaring the header files in SolverGUI where I want to use the console classes, or do I have to add new classes to SolverGUI to use them?
ie: Is communication between projects possible?
|
|
|
|
|
Sounds like you need to wrap the common classes between the console/GUI app into a library or DLL. You can then build this and get your console/GUI versions to link to the lib/dll. This should also keep both projects upto date with the common code base, as changing one, changes the other.
Inserting a project into the current workspace only lets you switch between them. You can set build dependencies so that everything gets built in the right order etc.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
That clarifies things greatly. I think I will take this approach.
Thank you.
|
|
|
|
|
i keep getting this error,, how can I fix it?
I have the follwing function defined as public in the View class.
Void LoadBitmap (CString file);
and I get an error saying : missing storage-class or type specifiers
help me out
Ehsan Behboudi
|
|
|
|
|
Could it be that you've got to write void instead of Void ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
you are THE MAN,,,,
Ehsan Behboudi
|
|
|
|
|
Hi all,
I have a particular UI problem that I am seeking help with. I have a parent window that can be zoomed and scrolled. The parent window has a few child windows. When I scroll the parent window I have to recalculate the new position of the child windows and the I call ::MoveWindow on them. However, there is a slight jump in the child windows during scroll and the movement does not look fluid. Is there any way to eliminate this jumping behavior?
I tried the DeferWindowPos API and did not get any noticable improvement
Thanks for any help you might give me.
Pankaj
Without struggle, there is no progress
|
|
|
|
|
What I have done in the past is to hide the windows, move them, then show them. Only one flicker.
// hide windows
for (...)
{
pWnd->ShowWindow(SW_HIDE);
pWnd->MoveWindow(...);
}
for (...)
pWnd->ShowWindow(SW_SHOW);
|
|
|
|
|
Try modifying you OnEraseBkGnd as follows:
BOOL CSomeView::OnEraseBkgnd(CDC* pDC)
{
CRect clip;
static int dont_erase_indexes[] =
{
IDC_TITLE_PROMPT,
IDC_TITLE,
IDC_TRAY,
IDC_ASSAY
};
pDC->SaveDC();
for (int i = 0; i < sizeof(dont_erase_indexes[) / sizeof(int); i++)
{
CWnd *pWnd = GetDlgItem(dont_erase_indexes[[i]);
if (pWnd && pWnd->IsWindowVisible())
{
pWnd->GetWindowRect(&clip);
ScreenToClient(&clip);
pDC->ExcludeClipRect(&clip);
}
}
pDC->GetClipBox(&clip);
pDC->FillSolidRect(clip, GetSysColor(COLOR_BTNFACE));
pDC->RestoreDC(-1);
return FALSE;
}
I usually fins when a window is re-drawn this solves many flicker problems
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I am working on an MFC MDI project. I used internet explorer rebar as the toolbar option at the beginning of the project.
I added an edit box on the toolbar. Now, I want to get the text entered in this editbox but I could not find how I can do it.
Can anybody help me ?
Thanx...
|
|
|
|
|
Hi,
I used to program in VC++ 6.0 about two years ago, and I'm back in programming except I am using .net
Is there any change in functions and classes between them?
Ehsan Behboudi
|
|
|
|
|
Most of VC.NET is backwards compatible with VC 6.0.
However, they have tried to make it more standards-compliant. You will get warnings about some code that is non-standard and deprecated. For example, they deprecate the use of "old" IOStreams. So if you have code that does this:
#include <iostream.h>
...
cout << "Hey there!";
You will get a warning. You should replace it with the "new" IOStream headers:
#include <iostream>
...
std::cout << "Hey there!";
Also, it is possible (via the Preferences dialog) to force "for" loops to conform to the C++ standard (finally!), for example, you can get this standards-compliant code to compile (in VC 6 it would not):
for(int i = 0; i < somenum; i++)
...
for(int i = 0; i < someothernum; i++)
...
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
I have a program that creates some icons and start menu items. There have been problems in the past about the start menu and desktop not always refreshing, so to make sure everything refreshes properly, we have this code:
DWORD dwTmp;
SendMessageTimeout(HWND_BROADCAST, WM_PAINT, NULL, NULL, SMTO_BLOCK|SMTO_ABORTIFHUNG, 2000, &dwTmp);
Up until now, this has always worked. However, if the Find window in XP is open (you know, the one with the dog), Explorer crashes.
Any ideas? Is there a better way that I can ensure desktop and start menu items appear correctly in XP (I have no moral or ethical problems with doing something along the lines, if(XP) doThis(); else doItTheOldWay();
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
Well I'm not sure about the crash, but if I were you I'd try using SHChangeNotify to notify Explorer of changes. You can probably pass SHCNE_CREATE (to say you created some non-folder items) or SHCNE_UPDATEDIR (to say you changed the contents of a directory) for the flags. I've never tried it though, so I can't guarantee it will work.
Chris Richardson Terrain Software
|
|
|
|
|
I am new to this forum and am unsure how to go about this question. I use:
void CChildGraphFrame::OnPaint()
{
CPaintDC dc(this); // device context for painting
CDC* pDC = &dc;
Render(pDC); //paint structure
}
This procedure paints the image to the screen. What I don't understand is how to save this structure to a file. I also, don't understand if I have a DIB or DDB. If a resource (website, example, etc) can be given to me or atleast a good starting point.
Thank you for your time,
Jim D
|
|
|
|
|
If, after painting, you want the contents of the region that was painted, you could call CDC::GetCurrentBitmap(). This returns the current DC bitmap object. You can then do whatever you wish with the BMP.
|
|
|
|
|
1. Create a memory DC
2. Create a bitmap object and select it into the DC
3. Draw onto the memory DC
4. Save the bitmap to file. You probably need to convert it to DIB for this to work.
There are articles at www.codeguru.com[^] www.codeguru.com written by Zafir Anjum that should help you somewhat.
Hope this helps.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
|
RasEnumEntries() is what you need.
|
|
|
|