|
Hi Mark,
I think I am understanding..., let me see if I have this right, so basically I override InActive and Active, I dont have to write anything in there. By overriding them they wont be able to trigger the thread to start and stop, so then in my callback I go in and pretty much do what the DoBufferProcessingLoop is doing and once I get IMediaSample *pSample I just populate it with the image data I have and we are ready to go?
Did I get that right?
Once again thanks
|
|
|
|
|
I have a class derived from CMultiDocTemplate and using constructor with parameters:
CMyTemplate::CMyTemplate(UINT nIDResource, CRuntimeClass* pDocClass,
CRuntimeClass* pFrameClass, CRuntimeClass* pViewClass)
: CMultiDocTemplate(nIDResource, pDocClass, pFrameClass, pViewClass)
{
.....
}
Now the VC++ 6.0 compiler complains that it needs a default constructor.
I have added one and now the linker complains:
Linking...
CMyTemplate.obj : error LNK2001: unresolved external symbol "public: __thiscall CMultiDocTemplate::CMultiDocTemplate(void)" (??0CMultiDocTemplate@@QAE@XZ)
Debug/0_IRA_GL_MFC.exe : fatal error LNK1120: 1 unresolved externals
The linker cannot find the base class default constructor?
What am I missing?
Thanks for you help.
Vaclav
|
|
|
|
|
It seems the problem is in your creation of an object of type CMyTemplate, not in the class
definition itself.
The DocTemplate classes don't have default constructors - they are meant to be created with
parameters.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi
How did you create your object ?
This could help you,
class Base
{
public:
Base(int k)
{
value = k;
}
private :
int value;
};
class Derived:public Base
{
public:
Derived(int k):Base(k)
{
}
private:
char s;
};
int main(int argc, char* argv[])
{
Derived object(10); // and not Derived object; This will give those
return 0; //errors as you mentioned.
}
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Thanks for your replies.
I am not sure what I did wrong but after deleting the default constructor it compiles and links without errors. I think my object instantiation was wrong. Unfortunately I did not have VSS running at this time so I cannot backtrack my code. Sorry.
Thanks again.
Vaclav
|
|
|
|
|
I need to receive in matrix, the image data of a USB camera. Is there some built in VC++ function or some API/SDK for this purpose.
Regards
|
|
|
|
|
Check this article, it may be a good starting point.
http://www.codeproject.com/audio/avicapwrp.asp
|
|
|
|
|
|
My program is going to either save, or have access to notepad edited text files that I can rely on to be in a certain format, N rows of header info (in CSV format mainly), and then rows of data. I could include a "datarows=" field in, but think I'd prefer a more elegant way to be able to read past the header (I'll worry about that later), but then be able to just read in a line from the file, check if it's data, and do something with it, but if it's an empty line or end of file, to stop
Not sure how to correctly process .getline properly on my fstream object to do that even though it seems obvious I want
assume file checked for existence
read in (use/dont use) N lines of header
while(some return condition that isn't end of file)
{
get a line - put in CString?
process the line
make sure it was valid data, or end the reading
}
A nudge in the right direction would be appreciated
|
|
|
|
|
ldsdbomber wrote: Not sure how to correctly process .getline properly on my fstream object to do that even though it seems obvious I want
One possibility:
ifstream in("");
string strLine;
while (getline(in, strLine))
{
} For a more complete, and C++, solution, see here and here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hello,
I do not want to use LoadFrame in the application class and instead use Create() to create the frame window and set menu afterwards.
But don't know how to proceed.
I want to delete the IDR_MAINFRAME from Menu resource.But if I delete IDR_MAINFRAME from the menu resource I get unhandled exception .
Prithaa
|
|
|
|
|
prithaa wrote: I do not want to use LoadFrame in the application class and instead use Create() to create the frame window and set menu afterwards.
What have you done till now? Posting the code should help.
|
|
|
|
|
Hello,
You answered my question last time.But I was not able to create the frame window without removing
if (!pFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
What I have done is this in the application class's
InitInstance()
if(!CMDIFrameWnd::Create(NULL, "MyFrame",WS_VISIBLE,
CRect(0,0,0,0),NULL, NULL))
pFrame->SetMenu(&mymenu);
Prithaa
|
|
|
|
|
i keep getting this window that pops up with something like "the wireless mouse battery is low..."
and I don't know what to do!
Is there an API or..?
I hope this is the right board
-- modified at 13:07 Tuesday 29th May, 2007
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Did you try replacing the battery in your wireless mouse?
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Turn the mouse over. The battery juice keeps settling to the bottom.
BTW, do you have a Microsoft Laser Mouse 6000?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Ha! Worked like a charm!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
damn it, you got me... didn't noticed the author of that marvelous question until i read David's answer !
come on Mark, don't you have anything better to do ? lol
|
|
|
|
|
toxcct wrote: come on Mark, don't you have anything better to do ?
Yes but I don't want to do it
It's amazing how long I'll put up with that dialog popping up before I reach all the way over to
the drawer next to me for batteries
Update: Mouse battery status is now critically low
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
Could u give some pointers on how to create a window that would look like MSN live messenger ? I am referring to those funky adornments and decorations that are found on MSN Live Messenger ? Things like gradients, tiny bitmap buttons, flyout controls - its like they have used HTML rendering for this.
Your help is highly appreciated as I am suppose to give my thoughts on how to create a similar gui for an application.
Eraj
|
|
|
|
|
Something like that would be very complex and would require a lot of drawing functions, and a LOT of owner-drawn controls - you would have to owner draw pretty much everything, which although having a nice end product, is very laborious and time-consuming. Note also that although it looks funky, it does slow the application down significantly, especially if transparency and other complex graphical renderings are used, one of the reasons why I believe that Windows Live Messenger is quite slow :@. You could think about creating simple owner-drawn items, such as buttons and menus, which are relatively simple to do, and then you could have some decorative bitmap images kept in a resource file which could be painted onto the background or something using the WM_PAINT command. You could also use transparency to make the application look more futuristic - take a look at this sourcecode here (Note the copyright notice).
Also, if you are using Visual Studio, take a look at the GDI+ documentation on MSDN for some more information. GDI+ is a good API as it is redistributable, under the copyright notices (look at the legal information on MSDN), and it allows for some basic image manipulation and reading of common file formats such as .jpg, .gif and .png, aswell as some nice text functions.
It also depends whether you want to use classes and MFC or not. I'm sure that there are a lot of classes out there for this sort of stuff, but as a straight-C programmer I am not familiar with any of these.
If you specify what you are trying to aim for further, I may be able to help you out a bit more.
Hope this helps!
--PerspX
|
|
|
|
|
Hi all.
I cant say type of my problem, but I have some case thet one class work in Visual C++.NET and dont work in Visual C++ 6.0
can help?
|
|
|
|
|
i'm not astonished at all that some code works on VS7.1 but doesn't work on VC6.
but i can't tell you more if you don't provide information... hey, it's you to give infos so that we can help you, not the opposite !
|
|
|
|
|
david bagaturia wrote: can help?
Yes. Change that one thing to the other.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How we can help you when you cant say anything about your program!?
|
|
|
|