|
There was no need to repost. It could be spamming. I suggest you read the existing responses carefully before going any further. They may be from members who know something.
Peter Wasser
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." - Bertrand Russell
|
|
|
|
|
I am trying to change the filter properties (Ezrgb24). I can read the property page – using IspecifyPropertyPages. I get all tabs of the property page, but getting “memory could not be written “error when I try to update it. I am working on that.
SOLVED
The filter .ax file was not being updated in System32 during debugging. Added to Post build proccess.
I have noticed when I access the property page using GrapEdit it is missing the first tab – only the input and output pins tabs are there. It is same on another DirectShow base filter.
I did not have this issue, I could read all tabs on unconnected Ezrgb24.
But I could not get the property page when the filter was connected in graph and running until I registered proppage.dll.
It sure looks as a problem with proppage.dll.(I'll look for a different version ).
Anybody have a knowledge about this issue?
I sure would like to know what is going on.
UNRESOLVED still cannot access Options sheet, only pin properties sheet. Since using GraphEdit for debugging only it does not effect application.
Thanks for reading.
Cheers
Vaclav
-- modified 25-Mar-14 22:15pm.
|
|
|
|
|
You need to post your property page initalisation code for us to be able to help you.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
Thanks for reply.
I did not specify which issue I need help with. Sorry.
As I said, I'll figure out the update "problem".
I feel the property sheet dialog should do the update just fine.
But I am just curious why the difference between GraphEdit using "off the shelf" filters both Ezrgb24 and Color Conversion Filter.
I did some search and found some discussions to the effect that GraphEdit does some extra work when displaying property sheet.
I think I found my problem, but it will take some undooing to fix it.
For safety reasons I did make copies of both filters and compiled them.
For so far unknown reason the options tab page in property sheet is gone, only the pins pages
are there. I assume this page code is external to the filter code.
That is why it works when filters are added manually in GraphEdit - it uses the original source.
-- modified 25-Mar-14 15:22pm.
|
|
|
|
|
Can anyone help what is wrong in the following code snippet.
free (Filelist[i]); fails with access violation error.
Thanks in advance.
int _tmain(int argc, TCHAR *argv[])
{
int i =0;
char ** Filelist;
int iFileCountInFolder=0;
int iFileSize = 0;
_tcscpy(szDirpath,_T("C:\\BMPread_W\\TransitionEffects\\Images"));
FileCountInDir(szDirpath,&iFileCountInFolder,&iFileSize);
Filelist = (char**)malloc(iFileCountInFolder * sizeof(char *));
if(Filelist == NULL)
{
fprintf(stderr, "out of memory\n");
return;
}
for(i = 0; i < iFileCountInFolder; i++)
{
Filelist[i] = (char*)malloc((iFileSize * sizeof(char))+1);
if(Filelist[i] == NULL)
{
fprintf(stderr, "out of memory\n");
return;
}
}
FindFilesInDirectory(szDirpath, Filelist, &iFileCountInFolder);
if (Filelist != NULL) {
for ( i = 0; i < iFileCountInFolder ; i++)
free (Filelist[i]);
free (Filelist);
}
return 0;
}
modified 24-Mar-14 19:50pm.
|
|
|
|
|
First, put your code between <pre></pre> tags so that it's readable.
Second, the code you cite as causing the error is not even in the snippet you show.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
The mallocs and frees are fine in concept the issue is deeper
I suspect this is the problem
Filelist[i] = (char*)malloc((iFileSize * sizeof(char))+1);
iFileSize is initially set to zero and then passed in as a parameter to FileCountInDir which I guess is supposed to fill it in.
But I find it really strange because that function is counting the directory entries from it's function name.
Really the string space allocation should be the length of each individual directory entry name so I am not sure it should be a single value.
For example a file "fred.bmp" should allocate 9 bytes (8+asciiz 0) while "afred.bmp" should allocate 10 bytes (9+asciiz 0)
I fail to see how you are allocating them all as iFileSize unless that is the largest filename in the directory.
And that leads to the answer for your fail that iFilesize must be coming back from FileCountInDir as -1 and that means you are allocating -1+1 = 0 bytes of memory which will fail in malloc returning NULL.
Hence Filelist[i] would indeed be carrying NULL
You can put protection to stop the error by doing this
if (FileList[i] != 0) free (Filelist[i]);
But as discussed I think you have serious issues with iFileSize
|
|
|
|
|
I think you are on to it as the mallocs and frees seem OK. Unfortunately not enough information provided.
Peter Wasser
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." - Bertrand Russell
|
|
|
|
|
malloc()-ing 0 bytes doesn't return NULL when I test.
This appears to be implementation dependent.
Peter Wasser
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." - Bertrand Russell
|
|
|
|
|
If you are posting a lump of code a compile ready snippet helps everybody.
Peter Wasser
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." - Bertrand Russell
modified 24-Mar-14 21:28pm.
|
|
|
|
|
I am posting compiled code. As stated above Freelist[i] fails. Highlighted the statement causing error.
#include <<windows.h>> // remove extra angle bracket for compilation
#include <<tchar.h>>
#include <<stdio.h>>
#include <<strsafe.h>>
void FreeMemory(char** myArray, int row);
void FileCountInDir(const TCHAR* dirpath, int * filescount, int* filesize);
void FindFilesInDirectory(const TCHAR* dirpath, char** filelist);
int _tmain(int argc, TCHAR *argv[])
{
int i =0;
TCHAR szDirpath[MAX_PATH];
//TCHAR Filelist[100][MAX_PATH];
char ** Filelist;
int iFileCountInFolder=0;
int iFileSize = 0;
_tcscpy(szDirpath,_T("C:\\BMPread_W\\TransitionEffects\\Images"));
FileCountInDir(szDirpath,&iFileCountInFolder,&iFileSize);
Filelist = (char**)malloc(iFileCountInFolder * sizeof(char *));
if(Filelist == NULL)
{
fprintf(stderr, "out of memory\n");
return 0;
}
for(i = 0; i < iFileCountInFolder; i++)
{
Filelist[i] = (char*)malloc((iFileSize * sizeof(char))+1);
if(Filelist[i] == NULL)
{
fprintf(stderr, "out of memory\n");
return 0;
}
}
FindFilesInDirectory(szDirpath, Filelist);
for(i =0;i<ifilecountinfolder;i++)
{
="" _tprintf(text("%s\n"),filelist[i]);
="" }
="" freememory(filelist,ifilecountinfolder);
="" return="" 0;
}
void="" findfilesindirectory(const="" tchar*="" dirpath,="" char**="" filelist)
{
="" list="" all="" the="" files="" in="" directory="" with="" some="" info="" about="" them.
="" win32_find_data="" ffd;
="" tchar="" szdir[max_path];
="" szfilefullpath[max_path]="{0};
" int="" filenumber="0;
" handle="" hfind="INVALID_HANDLE_VALUE;
" dword="" dwerror="0;
" _tcscpy(szdir,="" dirpath);
="" _tcscat(szdir,_t("\\*"));
="" &ffd);
="" if="" (invalid_handle_value="=" hfind)=""
="" ;
="" }="" do
="" (ffd.dwfileattributes="" &="" file_attribute_directory)
="" do="" nothing
="" else
="" _tcscpy(szfilefullpath,dirpath);
="" _tcscat(szfilefullpath,_t("\\"));
="" _tcscat(szfilefullpath,ffd.cfilename);
="" memcpy(filelist[filenumber],="" ffd.cfilename,="" sizeof(ffd.cfilename));
="" filenumber++;
="" while="" (findnextfile(hfind,="" &ffd)="" !="0);
" findclose(hfind);
}
void="" filecountindir(const="" *="" filescount,="" int*="" filesize)
{
="" szfilefullpath="{0};
" &ffd);
="" (*filescount)++;
="" if(="" ((*filesize)="=" 0)="" &&="" (_tcslen(ffd.cfilename)=""> 0)|| ((*filesize) < _tcslen(ffd.cFileName)))
{
(*filesize) = _tcslen(ffd.cFileName);
}
}
}
while (FindNextFile(hFind, &ffd) != 0);
FindClose(hFind);
}
void FreeMemory(char** myArray, int row)
{
int i;
if(myArray != NULL)
{
for (i = 0; i < row; i++){
free (myArray[i]);
}
}
|
|
|
|
|
Firstly you should employ assert() to help you. This is a classic situation where many asserts can assist.
By the look of your code iFileCountInFolder can change during execution. If it does get bigger on the free than on the malloc then "poof".
Peter Wasser
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." - Bertrand Russell
|
|
|
|
|
iFileCountInFolder is always fixed, since the files in a folder are fixed , means no files are added at run time.
I did not understand why the Free statement is failing.
|
|
|
|
|
There are many options to define values for flags, here is a list of known by me:
- Hexadecimal: 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, ...
- Decimal: 1, 2, 4, 8, 16, 32, 64, 128, ...
- Bit Shifting of 1: 1<<0, 1<<1, 1<<2, 1<<3, 1<<4, ...
- 2 * previous a=1, b=a*2, c=b*2, d=c*2, e=d*2, ...
Do you know any other?
Which do you consider as the best, and why?
Do you define (give it a name) an empty member (0) in flags?
|
|
|
|
|
- Any other is just a variation of the above, which are all basically the same. The only 'difference' is the visual representation.
- Hexadecimal is best as it makes it obvious what each bit represents, and is easy to visualise when flags are used in combination.
- Only define a zero value if it has any specific meaning.
|
|
|
|
|
I mostly use hex flags, I think that's the most common method. It's probably because it's a lot clearer which bits are actually set (for that same reason, I don't think I've ever seen decimal used for flags since the conversion isn't as neat).
Empty flags have a definition if they have a meaning (i.e. not necessary but could be labeled for clarity).
|
|
|
|
|
Dear all:
I try to use WH_CALLWNDPROC and PT_TOUCH in dll to get the global touch event. But I get some problems. My code lists as below:
#pragma data_seg (".SHARED")
HHOOK g_hPreviousMouseHook = 0;
HINSTANCE g_hInstance = 0;
#pragma data_seg()
#pragma comment(linker, "/SECTION:.SHARED,RWS")
BOOL CSoundDllApp::InitInstance()
{
CWinApp::InitInstance();
g_hInstance = AfxGetInstanceHandle();
return TRUE;
}
BOOL InstallWinHook()
{
BOOL bReturn = TRUE;
g_hPreviousMouseHook = SetWindowsHookEx(WH_CALLWNDPROC,
&WinHookProcedure, g_hInstance, 0);
if(NULL == g_hPreviousMouseHook)
{
bReturn = FALSE;
}
return bReturn;
}
BOOL UnInstallWinHook()
{
BOOL bReturn = TRUE;
if(UnhookWindowsHookEx(g_hPreviousMouseHook) == FALSE)
{
bReturn = FALSE;
}
return bReturn;
}
LRESULT CALLBACK WinHookProcedure(int nCode, WPARAM wParam, LPARAM lParam)
{
if(0 > nCode)
return CallNextHookEx(g_hPreviousMouseHook, nCode,
wParam, lParam);
UINT32 pointerId = GET_POINTERID_WPARAM(wParam);
POINTER_INPUT_TYPE pointerType;
if(GetPointerType(pointerId, &pointerType))
{
}
return CallNextHookEx(g_hPreviousMouseHook, nCode, wParam,
lParam);
}
When I disable the GetPointerType(pointerId, &pointerType) in
WinHookProcedure, it will load the dll success. When I enable the
GetPointerType(pointerId, &pointerType) in WinHookProcedure, it
will load the dll failed. what happened? Could someone tell me
please?
Thanks for your help, Victor
|
|
|
|
|
Hi All,
Kindly provide these below details.
Where i can get the license and setup for visual studio 6.0 enterprise edition for visual c++ 6.0 And
Plz let me know, any service pack required for Visual studio 6.0 to install on windows 7 Operating system.
Thanks & Regards,
TV Krishna Rayalu
|
|
|
|
|
You can try to buy it somewhere (e.g. from Ebay or Amazon).
I don't think that it can be used without problems with Windows 7. It may even fail to install. You should install it using the XP mode of Windows 7.
The VS 6 service packs are no longer present on the Microsoft web sites. When buying a used version you may ask the seller if he still has the service packs. The service packs are not related to the OS version where VS 6 is installed but contain fixes for VS 6 itself.
|
|
|
|
|
I successfully installed VS6 on a Windows 7 SP1 machine a few years back. The only trouble I ran into was with MDAC, since Windows 7 had a newer version. Make sure to install it as Administrator.
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Building / compiling DirectShow DLL
I am still not sure how this “empty DLL” is being compiled.
Here is an example of DirctShow sample (Synth ) direct from SDK 8.1.
I am using #pragma message to see the flow of compilation.
I compiles / links just fine , but the commonly used $ifndef / #define preprocessed flag does not stop multiple passes thru the source files.
Here is the build output.
<pre lang="c++">Compiling resources...
Compiling...
dynsrc.cpp
synth.cpp
Compiling D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\dynsrc.cpp
Last modified on Sun Mar 23 10:23:52 2014
File: DynSrc.cpp
implements CDynamicSource, which is a Quartz source filter
#include <streams.h>
#include <streams.h>
#include DynSrc.h
File: DynSrc.h
DirectShow sample code - defines classes to simplify creation of
ActiveX source filters that support continuous generation of data
Compiling D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\DynSrc.h
Last modified on Sun Mar 23 09:52:24 2014
#define __CDYNAMICSOURCE__ START
define CDynamicSource class
define CDynamicSourceStream class
#define __CDYNAMICSOURCE__ END
#include DynSrc.h
synthprp.cpp
Compiling ***MODIFIED***C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\initguid.h
Last modified on Sun Mar 2 13:48:42 2014
Definitions for controlling GUID initialization
File: DynSrc.h
DirectShow sample code - defines classes to simplify creation of
ActiveX source filters that support continuous generation of data
Compiling D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\DynSrc.h
Last modified on Sun Mar 23 09:52:24 2014
#define __CDYNAMICSOURCE__ START
define CDynamicSource class
define CDynamicSourceStream class
#define __CDYNAMICSOURCE__ END
A_Test.cpp
Generating Code...
Compiling D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\A_Test.cpp
Last modified on Sun Mar 23 09:40:08 2014
Linking...
Creating library Debug/synth.lib and object Debug/synth.exp
synth.ax - 0 error(s), 0 warning(s)
<pre>
Here is a sceond issue, probably related to first one.
So I tried to stop the compilation using #error. It gives expected output , but does not stop the compilation. Here is the output.
<pre lang="c++">Compiling resources...
Compiling...
dynsrc.cpp
Compiling D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\dynsrc.cpp
Last modified on Sun Mar 23 10:37:23 2014
File: DynSrc.cpp
implements CDynamicSource, which is a Quartz source filter
D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\dynsrc.cpp(19) : fatal error C1189: #error : STOP
synth.cpp
synthprp.cpp
Compiling ***MODIFIED***C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\initguid.h
Last modified on Sun Mar 2 13:48:42 2014
Definitions for controlling GUID initialization
File: DynSrc.h
DirectShow sample code - defines classes to simplify creation of
ActiveX source filters that support continuous generation of data
Compiling D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\DynSrc.h
Last modified on Sun Mar 23 09:52:24 2014
#define __CDYNAMICSOURCE__ START
define CDynamicSource class
define CDynamicSourceStream class
#define __CDYNAMICSOURCE__ END
A_Test.cpp
Generating Code...
Compiling D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\A_Test.cpp
Last modified on Sun Mar 23 09:40:08 2014
Error executing cl.exe.
synth.ax - 1 error(s), 0 warning(s)
<pre>
So I did #define DEBUG, and got this build output. It complained about DEBUG redefinition. It still did not stopped the compilation, but used the #idndef / #define flags correctly.
<pre lang="c++">Compiling resources...
Compiling...
dynsrc.cpp
Compiling D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\dynsrc.cpp
Last modified on Sun Mar 23 10:40:57 2014
D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\dynsrc.cpp(13) : warning C4005: 'DEBUG' : macro redefinition
unknown(0) : see previous definition of 'DEBUG'
File: DynSrc.cpp
implements CDynamicSource, which is a Quartz source filter
D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\dynsrc.cpp(19) : fatal error C1189: #error : STOP
synth.cpp
synthprp.cpp
Compiling ***MODIFIED***C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\initguid.h
Last modified on Sun Mar 2 13:48:42 2014
Definitions for controlling GUID initialization
File: DynSrc.h
DirectShow sample code - defines classes to simplify creation of
ActiveX source filters that support continuous generation of data
Compiling D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\DynSrc.h
Last modified on Sun Mar 23 09:52:24 2014
#define __CDYNAMICSOURCE__ START
define CDynamicSource class
define CDynamicSourceStream class
#define __CDYNAMICSOURCE__ END
A_Test.cpp
Generating Code...
Compiling D:\00\0 SDK\DirectShow SDK 8.1 new\DXF\DXSDK\samples\Multimedia\DirectShow\Filters\Filter_Base\A_Test.cpp
Last modified on Sun Mar 23 09:40:08 2014
Error executing cl.exe.
synth.ax - 1 error(s), 1 warning(s)
</pre>
I would like to hear from somebody familiar with building DirectShow filters from scratch.
I really do not need another lecture on how preprocessor works.
I did read the samples posted here, but they really do not explain the build process, especially the compilation.
Thanks in advance.
Cheers
Vaclav
PS If this post looks goofy as far as text and code goes, sorry I could not get preview to work.
|
|
|
|
|
Vaclav_Sal wrote: If this post looks goofy as far as text and code goes, sorry I could not get preview to work. You need to clear the checkbox below the edit window titled "Treat my content as plain text, not as HTML".
|
|
|
|
|
In a WinCE MFC program, OnInitDialog(), I changed font of a Static text, but, it shows messy characters. same logic in my PC, I wrote a test MFC program. it works well.
Please help me to analyze the reason.
BOOL CTestDlg::OnInitDialog()
{
CDashApp *pApp ;
CDialog::OnInitDialog();
pApp = (CDashApp *) AfxGetApp();
ShowCursor( FALSE ) ;
InitConfigurationFile();
LoadDtcFile( pApp->g_PanelSettings.language );
if ( NULL != AddFontResource(TEXT("\\FlashDisk\\Startup\\FZYTK.TTF")) ) {
::SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0);
}
DrawDash( BKG_DRAW ) ;
RefreshMainScreen( );
pApp->m_ActiveDlg = ACTIVE_DLG_TEST ;
LOGFONT lf;
CStatic *pEdit2 = new CStatic;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfQuality = CLEARTYPE_QUALITY;
lf.lfWidth = 0;
WCHAR lffn[] = TEXT("FZYaoTi(OpenType)");
wcscpy(lf.lfFaceName,lffn);
lf.lfCharSet = GB2312_CHARSET;
if (m_Font1.m_hObject) {
m_Font1.DeleteObject();
}
m_Font1.CreateFontIndirect(&lf);
pEdit2 = (CStatic*)GetDlgItem( IDC_INFO_TOP);
GetDlgItem( IDC_INFO_TOP)->SetFont(&m_Font1,1);
pEdit2->SetWindowTextW(_T("??"));
return TRUE; }
|
|
|
|
|
Is the font installed on the target machine ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|