|
That's why Carlo said "if you are using MFC/ATL", which is not your case so forget about it.
|
|
|
|
|
Ah no indeed i'm using MFC so it still the case
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Blood_HaZaRd wrote: Ah no indeed i'm using MF
For another project? The posted one looks the classical console application...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You need to include atltime.h header in order to use the CTime class. (In case you are using MFC/ATL).
I see that you have already included time.h so you can use the struct tm[^] from this header. See here[^] for standard date/time functions, macros and types.
|
|
|
|
|
Yup Thank you. I even found another Class zhicgh is CTimeSpan (based on CTime and do operations on time which the most suitable class for now.
Thnak you again and @ Cedric: the errors from VS saying that CTilme t1 is undeclarated was due to a line which end with no ; and now it works i forget to say that i was under MFC so excuse me again we are humains and we do mistakes.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Error 1 error LNK2019: unresolved external symbol _IID_IAMVideoControl referenced in function "public: long __thiscall StillCapture::Connect(struct IPin *)" (?Connect@StillCapture@@QAEJPAUIPin@@@Z) StillCapture.lib 1 DexCam1test
i have method NewStillCapture() in StillCapture.lib. To call NewStillcapture() method IStillCapture.h is used.
I am calling that method in my solution. But its giving the above mentioned Link error.
Please help me to come out of this mess
Thanks in advance
|
|
|
|
|
for IAMVideoControl interface, did u link to Strmiids.lib ?
|
|
|
|
|
strmbasd.lib
StillCapture.lib
baseclasses\STRMBASE.lib
THESE are the only dll's which we are linking
|
|
|
|
|
Try adding Strmiids.lib and Quartz.lib also in additional dependencies. These are the import libraries for most of the codes declared in various headers of DirectShow.
|
|
|
|
|
where can refer those libraries
i mean while adding the lib's through additional dependencies
|
|
|
|
|
If you are using DirectX SDK, then these will be in DXSDK\Lib. If you are using Visual Studio 2005 or later, DirectShow is included in platform sdk and paths would be set in Visual Studio. So simply add the lib names only.
|
|
|
|
|
i am using visual studio 2008
so i added directly Strmiids.lib and Quartz.lib
still same 7 errors
|
|
|
|
|
please post errors.
|
|
|
|
|
Error 1 error LNK2019: unresolved external symbol _IID_IAMVideoControl referenced in function "public: long __thiscall StillCapture::Connect(struct IPin *)" (?Connect@StillCapture@@QAEJPAUIPin@@@Z) c:\Documents and Settings\binsb\Desktop\DexCam1test\DexCam1test\StillCapture.lib 1 DexCam1test
Error 2 error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "public: int __thiscall CAMMsgEvent::WaitMsg(unsigned long)" (?WaitMsg@CAMMsgEvent@@QAEHK@Z) STRMBASE.lib DexCam1test
Error 3 error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A) STRMBASE.lib DexCam1test
Error 4 error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A) STRMBASE.lib DexCam1test
Error 5 error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA) STRMBASE.lib DexCam1test
Error 6 error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA) STRMBASE.lib DexCam1test
Error 7 fatal error LNK1120: 4 unresolved externals C:\Documents and Settings\binsb\Desktop\DexCam1test\Debug\DexCam1test.exe DexCam1test
|
|
|
|
|
these are the seven errors
Error 1 error LNK2019: unresolved external symbol _IID_IAMVideoControl referenced in function "public: long __thiscall StillCapture::Connect(struct IPin *)" (?Connect@StillCapture@@QAEJPAUIPin@@@Z) c:\Documents and Settings\binsb\Desktop\DexCam1test\DexCam1test\StillCapture.lib 1 DexCam1test
Error 2 error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "public: int __thiscall CAMMsgEvent::WaitMsg(unsigned long)" (?WaitMsg@CAMMsgEvent@@QAEHK@Z) STRMBASE.lib DexCam1test
Error 3 error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A) STRMBASE.lib DexCam1test
Error 4 error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A) STRMBASE.lib DexCam1test
Error 5 error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA) STRMBASE.lib DexCam1test
Error 6 error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA) STRMBASE.lib DexCam1test
Error 7 fatal error LNK1120: 4 unresolved externals C:\Documents and Settings\binsb\Desktop\DexCam1test\Debug\DexCam1test.exe DexCam1test
|
|
|
|
|
are you developing filter? so u are not using directx sdk, instead windows sdk (vista or above) only?
|
|
|
|
|
filter ....
we are using only windows sdk
|
|
|
|
|
IBaseFilter is what i can find in my project
|
|
|
|
|
Did you add StillCapture.lib in the "Additional Dependencies" option of your project settings ?
|
|
|
|
|
yeah added.
strmbasd.lib
StillCapture.lib
..\baseclasses\STRMBASE.lib
these are the libraries which we added in additional dependencies
|
|
|
|
|
Hi there,
I have a mysterious bug in a rich edit control one of my programs. It is sporadic and I haven't been able to find any way to duplicate it. It just suddenly happens when mid-edit of the text. You go for days sometimes with no occurrence of the bug, then suddenly without warning it will happen.
The richedit class is
RICHEDIT20A
What happens
Part of the text gets displayed incorrectly formatted. If you click on it to set the caret, then some parts are inaccessible. The caret also sometimes isn't synchronised with the click point so you click in one place in the window and the caret gets set somewhere else, usually at the same y coord, and to the left or the right of the click point.
Manifests in many ways but most often, the visual display of the text changes to show the first character of each line on a separate line of the window. Like this:
This is actual text copied from most recent time it happened:
do a search for ,,
Volume envelope for editable waveform instrument (Ctrl + ) - makes a difference for instruments selected not the editable instrument
Mid edit, this suddenly changed so it was displayed as
|d
o a search for |,,
|V
olume envelope for editable waveform instrument (Ctrl + ) - makes a difference for instruments| selected not the editable instrument
There the | shows the furthest right you can set the caret in each line. So e.g. if you click to the right of the first d, then the caret gets set at the start of the line, not after the 'd' as you would expect.
If you click to the right of instruments in the second line the caret gets set immediately after the s and you can't set it any further to the right than that.
You can highlight text in that "inaccessible" area of the text with click and drag, but the caret doesn't change position when you do that.
The same text displays fine in other rich edit controls
If you copy / paste the text to another rich edit, then it displays fine. If you look at the rich edit source, everything looks fine too. No unusual fonts used, it is usually all one font when it happens.
Clears up if you stream the rich edit source code out and back in again
Display issues clear up on resize, and on switch word wrap on / off. But some of the text may still be inaccessible and the caret positioned incorrectly when you click on the text.
Clears up completely if you edit the rich edit source. In the program then what happens when the user does that is that it uses EM_STREAMOUT and EM_STREAMIN to stream the rich edit contents out to a string, display that string in a plain text edit control, then stream back into the rich edit. So, you do that the issue is fixed until next time it happens.
So seems pretty clear that there is nothing wrong with the actual rich edit source for the control.
Example source code
What the richedit source looks like is like this:
{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fnil\fcharset0 Arial;}}
\viewkind4\uc1\pard\fs20
do a search of source code for ,,\par
\par
...
}
- that's after an EM_STREAMOUT from the problematical richedit control.
I subclass the richedit, but do nothing unusual in the subclassing (just do a bit of extra processing for WM_KEYDOWN etc), and I also added an option to switch off the subclassing - and it still happened with it disabled.
Can't think of anything else unusual I do apart from the EM_STREAMOUT and EM_STREAMIN.
I have been able to duplicate a few times while running the program in the debugger, and was able to break after the bug happened but again everything seemed fine in the code.
Have any of you got any ideas at all about what this might be? Or any lines of investigation that I could follow up.
|
|
|
|
|
Does it happen on multiple computers or just on yours? My first thought is memory corruption, is it somehow possible that you somehow overwrite memory that "belongs" to the rich edit control, like, out-indexing an array or somesuch? Did you try a complete rebuild of the project since you experienced the problem?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers don't kill programs, users kill programs <
> "It doesn't work, fix it" does not qualify as a bug report. <
|
|
|
|
|
It happens on my laptop as well, so two different computers and on my desktop, under Vista and also under Windows 7.
Yes, that definitely sounds like a possibility. I work in C rather than C++ at a low level so have to be very careful about memory corruption, and array overflow etc. I also rather wondered if that might be the cause but hoped it would be something else!
Yes I have done a complete rebuild several times. I have made a fair number of changes in the code and it still happens.
The tricky thing about the bug is that I have made many changes in the code and since it is sporadic and fairly rare in occurrence, I have no idea when it first started as it could have been present and undetected before I noticed it.
So there is no way to know which change in the code introduced the bug (or made it noticeable at least) and no way to "roll back" to a last known "good build".
Anyway looks as if I need to make a careful check for memory corruption.
I generally use Visual C++ 6.0 still, but ran the program in Visual C++ 2010 Express as it sometimes flags memory corruption issues and other issues not noticed by the older compiler. But nothing turned up - was able to reproduce the bug while running it in the debugger, and no issues were reported by it.
Looks like a case for a memory debugger then. So far I've got by without one but this has me stumped, and it's about 15,000 lines of code, possibly more, so it would take a fair while to work through it all looking for the bug.
I'm downloading an evaluation version of Purify for Win just now, and I may try Insure++ as well. Will reply here if it fixes it.
Do say if you have any other recommendations for a good memory debugger for this sort of a bug anyone, preferrably free or low cost as I don't have much of a budget for it.
Thanks,
Robert
|
|
|
|
|
Hey, of course you know that this is just a guess from my side, the problem might be something completely different, i just hope i am not stearing you in the wrong direction. I can't really recommend any good memory debugger...
I'm still thinking what else could cause such an odd occurance, if i can think of something, i will tell you...and please if you find out what caused your problem, do send a post here, i am really curious, thanks in advance.
Ah, and maybe show some code about what your subclassed window proc does, maybe there's something i or someone else here can spot that might cause a problem and it slipped your attention...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers don't kill programs, users kill programs <
> "It doesn't work, fix it" does not qualify as a bug report. <
|
|
|
|
|
Yes that's all right, I understand its a guess. But sounded like a good one to me, the way you put it.
Best lead I've had anyway so far.
I don't think it is the subclassing because I do the same thing in all my other programs with no problems at all, it's a standard thing in my software.
What it does is to trap key down, and mouse move, and if the edit control consists of e.g. just a single number - and the user clicks on a number and then drags the mouse up / down far enough (to next or previous line or out of the field if it is single line), it adjusts the number. Increases it if user drags up, decreases it if user drags down. Can also adjust numbers in multi-line text if you use Ctrl + click & drag up / down on the number.
So - sort of way of changing numbers without needing to use a spin control - easier to do often and also works with text fields without a spin control. The routine itself is fairly simple, about 200 lines of code - but uses PostMessage to other parts of the program in order to actually adjust the numbers (to get e.g. the edit notifications working fine so it is just as if the user themselves entered a new number by hand).
Also I disabled it and still got the bug at least once without this feature - that was long ago, not tested it recently, there is room for a small amount of doubt I suppose that it was the same bug still, but same symptoms.
So anyway I think a bit unlikely that that's what it is and it's rather too much code to post here anyway.
Anyway, I just installed the Purify memory debugger. Something interesting happened, not sure if that's what it is. Will post about that in a separate post.
|
|
|
|