|
Stephen Hewitt wrote: Some people erroneously believe that only release builds can be built with debugging information, but this simply isn't the case.
Umm... Surely, you wanted to say 'debug builds' instead?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Yeah, that's what I meant. Steve
|
|
|
|
|
Could you give me some advices to solving the problem,thanks very much!
|
|
|
|
|
I thought I did. I'll reiterate: Firstly ensure that the release build is built with debugging information. Then run the program under a debugger, break execution when the problem occurs and get a stack trace. Pick the thread that's displaying the runtime error message. Which part of this are you having problems with? Steve
|
|
|
|
|
Dear All,
I am working on Exporting different compressed format(Mjpeg,H264,Mpeg4)files into AVI container.
I have included vfw.h and vfw32.lib.And,using AVIFileCreateStream,AVIStreamWrite to create and write into AVI container.
Here,AVIStreamWrite method returns E_UNEXPECTED.
Im not able to proceed further.Also,i could not find the reason for this error.
I have searched in google.Many samples which do the export from BMP to AVI are available.
Could any one of u help me ?
I am new to this video and audio format..
Thanks,
Gomathy L.
|
|
|
|
|
Hi
Im having the same problem as you where having with AVIStreamWrite. Im trying to write MJPG frames from an IP camera into a AVI container. Did you ever solve your problem?
Thanx
|
|
|
|
|
Hi,
Yes.I have solved that problem and now I have implemented AVIStreamWrite for Mjpg,mpeg4,H264…
Actually,If that returns E_UNEXPECTED means,the codec which we r using is not correct.
I have followed this link. http://www.morgan-multimedia.com/download/codec.c
Pls,go thro it.
Regards,
Gomathy L.
|
|
|
|
|
|
I think my problem is that im not specifying the correct format of the incoming MJPG stream and therefore when I create the avi I either get an error or a black video depending on the codec I use.
|
|
|
|
|
Yes..Obviously.
AVISTREAMINFO streamInfo;
memset(&streamInfo, 0, sizeof(streamInfo));
streamInfo.fccType = streamtypeVIDEO;
streamInfo.fccHandler = mmioFOURCC('M', 'J', 'P', 'G');
streamInfo.dwScale = 1001;
streamInfo.dwRate = 30000;
streamInfo.dwSampleSize = 1;//0;
streamInfo.dwSuggestedBufferSize = 0 ;
SetRect(&streamInfo.rcFrame, 0, 0,frameInfo.m_width,frameInfo.m_height);
try this..
|
|
|
|
|
Brilliant!! It worked
One more thing, What number do I need to use for dwRate to change the frame rate to 25 fps?
Thank you.
|
|
|
|
|
Just give dwRate as 1..hope it will work..
|
|
|
|
|
Hi all,
I have one project which should done in vC++.
We need to Implement An activex component in vc++.
if ur interested we can discuss on that by mail.
Thansk
Kishore
|
|
|
|
|
You should try it in the job offers section[^].Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hi,
I have a simple VS2008 C++ MFC application that shows a FormView in which a "Microsoft Office Spreadsheet 10.0" has been inserted. At this point when the program is runing I can manually manipulate -but ONLY with the keyboard! the spreadsheet cells like a usual Excel one.
Now I would like to do the same programatically but I don't know how!
I have added a variable to the component and this variable seems to let me control the spreadsheet through a LPDISPATCH pointer.
This is the instruction that VS2008 automatically put in the DODataExchange() function:
DDX_Control(pDX, IDC_SPREADSHEET1, in_grid);
in_grid is name of the variable added to "SPREADSHEET1" component.
Later in the code I have this instruction:
LPDISPATCH lpd_grid = in_grid.get_ActiveSheet();
Most of functions avalable through in_grid return this type LPDISPATCH. But I have not undestood how I can use this pointer to Write/Read the cell's value.
In so many exemples found here and there LPDISPATCH lpd_grid would be used in this way:
Excel::_WorksheetPtr xlWs = in_grid.AttachDispatch(lpd_grid);
but in the present case the later instruction above would lead to a compiler error.
Does anybody ever used this "Microsoft Office Spreadsheet 10.0" ?
Regards
Bernard
|
|
|
|
|
I need some hint / help in troubleshooting this error.
It gets retruned by both WriteFile and ReadFile when writting to or reading from file opened for asynchronous ( COM port ) access.
The file is created using
m_hCOM = ::CreateFile(lpszDevice, // COMx
GENERIC_READ|GENERIC_WRITE,
0, // exclusive
0, // security irrelevant
OPEN_EXISTING, // it has to be there
FILE_FLAG_OVERLAPPED, // asynchronous
0); // template file
And this is wherw it fails
// write to comm port
iResult = WriteFile(m_hCOM, (char*) data, dwSize, &dwWritten, &osWrite);
with this cryptic error message
"Invalid access to memory location"
DCB, mask and timeouts are properly configured.
At this time I am wiriting single (dwSize = 1) null '0' character and the OVERLAPPED structure event is set.
I am obviously missing something.
Any constructive help as always is appreciated. Suggestions to copy someone else code are not necessary. Been there - done that.
Vaclav
-- Modified Monday, March 1, 2010 11:06 PM
|
|
|
|
|
What is data?
How is it defined? How is a value associated with it?
From what you posted, it seems likely that there is something wrong with your use of (char*) data . Of course, there isn't enough in your post to say for sure.Please do not read this signature.
|
|
|
|
|
Thanks for reply. I must have had something wrong with the setup parameters, I have rebuild my code using defaults and this problem went away. Even if I set the data entry to NULL, the WriteFile still works without his access memory error. It returns zero characters written as expected.
Now I need to find out why the WriteFile fails - return 0, but the last error is not ERROR_IO_PENDING as expected, but no error whatsoever. For now I will work on that.
Thanks again for your helpfull suggestion.
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: Even if I set the data entry to NULL, the WriteFile still works...
But only if dwSize is equal to 0 . Otherwise it would be trying to dereference a NULL pointer."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
David, if you are reffering to the length of the data going to WriteFile I used (for test) a string of 12 characters and set the buffer to NULL.
The WriteFile returned 0, which it should.
What is weird GetLastError gets 998 and the message attached is "operation completed succesfully". But the access memory error I was getting before is gone.
Please do not spend any more time on this, I need to figure this out by myself and it is getting late.
Vaclav
PS I did not check my initial post - we are talking about the same parameter - size / length of the data.
|
|
|
|
|
Pardon me for jumping back in.
Huh? The buffer contains the string, so a string of 12 characters and set the buffer to NULL are contradictory.
For an ASCII build, I would expect something like:
char data[] = "Test";
iResult = WriteFile(m_hCOM, data, strlen(data), &dwWritten, &osWrite);
except that since you are doing this asynchronously, the crude way I just provided a buffer will not work, since its lifetime is almost certainly too short. You have to arrange a buffer ( and out parameters ) that will remain valid "long enough".
When you said I set the data entry to NULL, I understood that as meaning you did this:
iResult = WriteFile(m_hCOM, NULL, 0, &dwWritten, &osWrite); Please do not read this signature.
|
|
|
|
|
Avi,
do not apologize, I think you just give me an idea what is going on.
I know it sound crazy, but during troubleshooting this mess I just changed the data to NULL and left the rest intact - just like this:
lResult = WriteFile(m_hFile, NULL /*&pData*/ , iLen, pdwWritten,lpOverlapped);
I know it is a mess , I just keep jumping from one code to another.
Anyway, I think I need to look at the "persistence" of things, as you pointed out. I did noticed that the pdwWritten does not get immediately filled when the WriteFile returns (with correct data of course). Only after the WaitFor... event is done.
And that is the way it should work.
My priority is now on the missing ERROR_IO_PENDING "error " message.
I do not have correct setup between CreateFile and OVERLLAPED structure and even when WriteFile fails ( with 0 return) I get "Operation completed sucessfully" in GetLastError.
The irony of it is - I should be happy, but I am stubborn and want to see ERROR_IO_PENDING.
Good night
Vaclav
|
|
|
|
|
You may or may not have fixed your problem by now, but...
You use:
&pData
Now, pData sounds like a pointer to data to me... so you probably don't want the address of your pointer?
Iain.I have now moved to Sweden for love (awwww).
|
|
|
|
|
Vaclav_Sal wrote: David, if you are reffering to the length of the data going to WriteFile I used (for test) a string of 12 characters and set the buffer to NULL.
The WriteFile returned 0, which it should.
What is weird GetLastError gets 998...
When I tried your code snippet:
DWORD dwBytesWritten;
HANDLE hFile = CreateFile("c:\\file.dat", GENERIC_WRITE, 0, 0,CREATE_ALWAYS, 0, 0);
if (! WriteFile(hFile, NULL, 12, &dwBytesWritten, NULL))
DWORD dwError = GetLastError();
GetLastError() returned ERROR_INVALID_USER_BUFFER . I would expect this as I told WriteFile() to write 12 bytes but did not provide those 12 bytes."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I've written a MFC application with toolbars.
I've added the text to the toolbar and dynamically sized the toolbar to the length of the label.
I used (CBRS_TOOLTIPS | CBRS_FLYBY| CBRS_SIZE_DYNAMIC)
I set the text with the following code:
if ( !strButtonText.IsEmpty() )
{
SetButtonText( nIndex, strButtonText );
}
Where nIndex is the button's position and strButtonText is the desired text.
I've tried both the above method (commented out) where the messagebox displayed the expected result but the button on the toolbar just appears to have dropped the space i'm assuming this is because CToolBar ignores the return character.
I've also tried to //strTemp += strButtonText.left(10) + "\n" +strButtonText.mid(10, strButtonText.getLength())
With the same result("\n" is ignored).
"\r\n" also has the same result as "\n" so it would appear to not be as easy as a "\n".
So as I'm sure you've guessed by now the question is...Does anyone know a method of wrapping the label text on a CToolBar?
I would greatly appreciate any guidance.
|
|
|
|
|