|
I want to customize the header of a listview, so in NM_CUSTOMDARW i have
Test = (LPNMLVCCUSTOMDARW)Lp <<lparam
(Test->nmcd.hdc) which for the listview without the header, i tried using
Test = (LPNMCUSTOMDARW)Lp <<lparam
and then
Test->hdr.hwndFrom
so
if(Test->hdr.hwndFrom == listview_getheader(LIST))
but it does not work, the listview_getheader(LIST) gives the right hwnd, but how about Test->hdr.hwndFrom, it seems i missed something...
|
|
|
|
|
JoneLe86 wrote:
Test = (LPNMCUSTOMDARW)Lp <<lparam What is Test and what is its value, and that of lp , after this statement?
Use the best guess
|
|
|
|
|
LPNMCUSTOMDARW Test = (LPNMCUSTOMDARW)lp
I was in the wrong way, Jochen Arndt explained that I should subclass the header first...
Thanks
|
|
|
|
|
|
hmm I wonder why Everything need to be subclassed, thanks for this information it did help....
|
|
|
|
|
The AviSplitter Filter's input pin, according to the MSDN is accepting the following mediatype
MEDIATYPE_Stream, <br />
MEDIASUBTYPE_Avi
While my own async filter is trying to connect with this filter in the method (located in amfilter.cpp file)
HRESULT CBasePin::TryMediaTypes(IPin *pReceivePin, __in_opt const CMediaType *pmt, IEnumMediaTypes *pEnum)
at the following statement that it supposed to receive the AVISplitter input pin, mediatype,
hr = pEnum->Next(1, (AM_MEDIA_TYPE**)&pMediaType,&ulMediaCount);
it retuns FALSE.
Why is that happens ?
sdancer75
|
|
|
|
|
|
Thanks,
It seems that AVISplitter does not suggest any mediatype but my mediatype fails at
hr = pReceivePin->ReceiveConnection((IPin *)this, pmt);
with error code 0x8004022f
Do you have any idea ?
Regards,
sdancer75
|
|
|
|
|
And what does that error code tell you?
Use the best guess
|
|
|
|
|
Debugging the dshow library, the first error internal decription is
0x8004022f error code<br />
VFW_E_INVALID_FILE_FORMAT
but the same dshow method returns to the caller, the following description
VFW_E_NO_ACCEPTABLE_TYPES<br />
0x8004022f
I think that something wrong is going on with my code in my async filter.
HRESULT result = m_pIo->SyncRead(llPosition, lLength, pBuffer);
It reads the first 0x18 bytes and after that, it returns the error. Other tests I did, it continues to read or parsing the avi file, but my code fails.
If its not a read error, then something wrong went with the AVI header parse or the MediaType templates declaration.
Note that the AVI is fine and is tested successfuly with other 3rd party players.
Regards,
sdancer75
|
|
|
|
|
Ok Solved.
My mistake was a command in the
CAsyncFilter::Load(LPCOLESTR lpwszFileName, const AM_MEDIA_TYPE *pmt)
function that is changing the absolute offset inside the file !!! I added that, for debugging purposes and I forgot to delete it when I reloaded the project a few days later.
So it was a read error !
Thank you.
PS : I was looking for that error one month now ! Oh God !!!
sdancer75
|
|
|
|
|
I have a process that some how fail at Initialization
it is a MFC C++ app so I inserted a __debugbreak at the first possible instance
which would be CWinAPP constructer the code starts but never seems to reach that point
(probably something to do with the build)
When I run this app from task manager I see it start and then it disappears
The Program when Initialized display a Main Window
I originally started this program using CreateProcess I get a return code 1 inidicating sucesss
but like I said it dies at initialization
When I run this program using "Start Debugging" from the Visual Studio IDE it seems to performs
properly
I am thinking That I use CreatePrcess with the DEBUG_PROCESS flag to get a better handle on
The problem
I appreciate any help
Thank you
|
|
|
|
|
Try to log the startup sequence by some log mechanism, like OuputDebugString() or File write.
Is there any chance to have code which will run in Release mode?
Any code which is written by compiler directive like #ifndef.
#ifndef _DEBUG
..
#endif
The following link may help you to find out this issue.
http://forums.codeguru.com/showthread.php?269905-Visual-C-Debugging-Why-does-program-work-in-debug-mode-but-fail-in-release-mode
In the debug build, if you have incorrect message handler signatures this doesnt cause any problems.
But MFC does a couple of naughty type casts in the message map macros. So when you build the same code in release mode, you are guranteed to run into trouble.
|
|
|
|
|
Let me clarify I run the VC debugger from
The release mode code along with the .pdb I am able to see what's going on
|
|
|
|
|
Yes it is possible to debug in release mode.
Details are given in the following link.
If an application works in a debug build, but fails in a release build, one of the compiler optimizations may be exposing a defect in the source code. To isolate the problem, disable selected optimizations for each source code file until you locate the file and the optimization that is causing the problem. (To expedite the process, you can divide the files into two groups, disable optimization on one group, and when you find a problem in a group, continue dividing until you isolate the problem file.)
http://msdn.microsoft.com/en-us/library/fsk896zz.aspx
|
|
|
|
|
Somewhere between the initlization and the CWinApp constructer the code
dies
I think using DEBUG_PROCESS flags will send events at everypoint till
the process is created
|
|
|
|
|
I have a client system, to create a CMainFrame object, but I am afraid that there will be memory leak about CMainFrame object.After step in, I cannot find where the m_pMainWnd pointer is deleted. Will I delete this pointer in the function
ExitInstance()?
BOOL CApp::InitInstance()
{
CMainFrame* pMainFrame = new CMainFrame();
if (!pMainFrame) return FALSE;
pMainFrame->LoadFrame(IDR_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
m_pMainWnd = pMainFrame;
m_pMainWnd->UpdateWindow();
return TRUE;
}
int CApp::ExitInstance()
{
return CWinApp::ExitInstance();
}
|
|
|
|
|
yu-jian wrote: After step in, I cannot find where the m_pMainWnd pointer is deleted. It's handled automatically by the framework.
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Oh, sorry, I do not use the .net.
This is the unmanaged C++. I cannot see where the system delete this pointer in file appcore.cpp.
|
|
|
|
|
yu-jian wrote: Oh, sorry, I do not use the .net. What does that have to do with anything?
yu-jian wrote: This is the unmanaged C++. If you mean this is the unmanaged C++ forum, of course it is. Did something indicate otherwise?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
It is is deleted inside CFrameWnd::PostNcDestroy() (see winfrm.cpp) which is called by CWnd::OnNcDestroy which is the last member function called when the Windows window is destroyed.
|
|
|
|
|
Hello everyone,
I am trying to implement zero copy mechanism i.e. a contrary function to the TransmitFile() API.
But I don't know how to register buffers in kernel.Below are the details what I want to do to implement zero copy:
1.we will receive a large data from the server in our client buffer, i have a doubt here also that weather data will come to socket buffer(client's) or first it will come into NIC buffer,please clear this doubt also.
2.now from socket buufer i want to copy the data directly to the kernel buffer and then to file in the disc without going for read and write system calls i.e without switching contexts.
3.Data has to be moved directly to kernel buffer within kernel space only.
Is there any API or some method???? any suggestions???
|
|
|
|
|
|
So you want to take data direct over a network and write it to disk without going through huser mode.
Why, are you that concerned about performance? If you do it in massive chunks you wont be that badly affected.
If you really want to write a minifilter driver that can intercept the data intended for your socket and and have it do a ZwWriteFile then you are going to have to learn an awful lot of kernel stuff.
Of course I could do it in a day or so, since I know an awful lot of kernel stuff, but I wont tell you because it will take you about a year to get working and will cost you a lot of time and money.
Of course if you want it doing properly and relatively cheaply hire someone who knows.
|
|
|
|
|
sorry buddy....thankx for the hint(ZwWritefile).as I am a beginner its a little tough task to understand and implement it.I hope I got the hint correct,I mean i need to study zwwritefile?isn't it?
|
|
|
|