|
yogeshs wrote: Any Ideas ? Yes, but unlessyou show us the code that is not working it is unlikely that we can guess what is going wrong.
Use the best guess
|
|
|
|
|
Here is the Class that i Sublasses from CFileDialog with setting last parameter in CFileDialog bVistaStyle to FALSE.
FileDialogTemplate::FileDialogTemplate(const LPCSTR caption, BOOL bOpenFile,
LPCSTR lpszDefExt, LPCSTR lpszFileName, DWORD dwFlags, LPCSTR lpszFilter,
CWnd* pParentWnd, int idx, BOOL pain, BOOL sav7, char* DefDir, int typ,
BOOL ivrit, int ver, int nVersion, BOOL multy, LPFNDLL_SWITCHREAD pSwitchRead)
: CFileDialog(bOpenFile, bOpenFile ? lpszDefExt : NULL,
alignFileName(lpszFileName),
(typ == sf_spec) ?
((dwFlags != 0) ? dwFlags : OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT) :
(typ == sf_bmp || typ == sf_fpf) ?
(OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |
OFN_NOCHANGEDIR | OFN_ENABLETEMPLATE | OFN_EXPLORER) :
(typ == sf_dsn_dir) ?
(OFN_HIDEREADONLY | OFN_NOVALIDATE | OFN_ENABLETEMPLATE | OFN_EXPLORER) :
(typ == sf_dsn || typ == sf_dsp || typ == sf_rul) ?
(OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |
OFN_ENABLETEMPLATE | OFN_EXPLORER) :
(typ == sf_log) ?
(OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_EXPLORER) :
(OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_EXPLORER),
lpszFilter, pParentWnd,0UL,FALSE)
{
m_pSwitchRead = pSwitchRead;
m_DefExt = (bOpenFile || lpszDefExt == NULL) ? "" : lpszDefExt;
m_Multy = multy && bOpenFile;
HMODULE hResourceOld = ::AfxGetResourceHandle();
::AfxSetResourceHandle(SHARED_RES_MODULE);
ivrit_eng = ivrit;
m_ver = (typ == sf_dsn_dir ||
typ == sf_dsn || typ == sf_dsp || typ == sf_rul) ? ver : 0;
rul_num = rul_size_num = 0;
bOpenFileDialog = bOpenFile;
sv7 = FALSE;
paint = (pain &&
(typ == sf_dsn_dir || typ == sf_dsn || typ == sf_dsp || typ == sf_bmp ||
typ == sf_rul || typ == sf_fpf || typ == sf_spec));
type = typ;
save7 = 0;
m_pImage = NULL;
m_Bitmap = NULL;
m_IsModulateFile = FALSE;
m_SizeSel = 0;
m_ofn.hInstance = SHARED_RES_MODULE;
title = new char[_MAX_PATH];
title[0] = '\0';
m_ofn.lpstrFileTitle = title;
m_ofn.nMaxFileTitle = _MAX_PATH;
int buf_size = 65536;
file_buf = new char[buf_size];
file_buf[0] = '\0';
file_buf[buf_size-1] = '\0';
if ( lpszFileName != NULL )
lstrcpyn(file_buf, lpszFileName, buf_size-1);
m_ofn.lpstrFile = file_buf;
m_ofn.nMaxFile = buf_size - 1;
if ( caption != NULL ) {
m_ofn.lpstrTitle = caption;
} else
m_ofn.lpstrTitle = title;
LPCSTR DefExt = lpszDefExt;
char un[8];
if ( idx != 0 && lpszFilter != NULL ) {
m_ofn.nFilterIndex = (DWORD)idx;
int ii = idx + idx - 1, in = 0;
const char* p = lpszFilter;
while ( ii > 0 ) {
if ( *p == '|' )
ii--;
p++;
}
p += 2;
while ( *p != '|' && in < 4 )
un[in++] = *p++;
un[in] = (char)0;
DefExt = un;
}
lstrcpyn(str, ::TGetIniString("ExtPath", DefExt), _MAX_PATH);
m_ofn.lpstrInitialDir = (DefDir == NULL) ? str : DefDir;
m_ofn.lpTemplateName = MAKEINTRESOURCE(
(ver == 0) ? IDD_OPENSAVE_TEMPLATE : IDD_OPENSAVE_TEMPLATE_NEW);
if ( !bOpenFile && typ != sf_dsn_dir )
m_ofn.Flags |= OFN_FILEMUSTEXIST;
NOVALIDATE_flag = ((m_ofn.Flags & OFN_NOVALIDATE) != 0);
if ( !NOVALIDATE_flag && typ != sf_dsn_dir )
m_ofn.Flags |= OFN_NOVALIDATE;
if ( m_Multy )
m_ofn.Flags |= OFN_ALLOWMULTISELECT;
m_view_mode = -1;
::AfxSetResourceHandle(hResourceOld);
}
Regards
Y
|
|
|
|
|
Sorry, but I cannot make head or tail of the above code. I would suggest you do some testing with basic CFileDialog templates to try and see what differences are happening.
Use the best guess
|
|
|
|
|
ok, I will try that way.
Thanks.
Regards
Y
|
|
|
|
|
I want to change my system IP, subnet mask, host name etc. using win32 VC++.
I've tried AddIPAddress function but that's not persistent.
I want to change it that it should be change without rebooting system and should be there after restarting the system.
Thanks!
|
|
|
|
|
|
Hi,
I am working on a project in which I have a Property Sheet and 3 Property Pages. I have some controls on Property pages. I want to make my project DPI independent, SO whenever I'll change the position of any control, the control at the bottom will get hidden. The control will be moved to the bottom but will get hidden. Say If I change the position of the control from rc.top to rc.top + 20, it will move down but will get slashed off from the bottom.
Is it possible that the size of the Property sheet is fixed.?
How to change the the size of Property Sheet or Property Pages in MFC.
Any help will be appreciated.
Regards,
Mbatra
|
|
|
|
|
mbatra31 wrote: Is it possible that the size of the Property sheet is fixed.? It assumes the size of the largest property page.
mbatra31 wrote: How to change the the size of Property Sheet or Property Pages in MFC. Change the size of any window using SetWindowPos() and MoveWindow() .
"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
|
|
|
|
|
In scenario like this, I've putted pseudo function GetRTTI().
How can I detect in the runtime the actual(derived) class type?
class the_base
{
};
class A : public the_base
{
};
class B : public the_base
{
};
class C : public the_base
{
};
...
the_base* pList[] = { new A(), new B(), new C());
C* pTarget = nullptr;
if(pList[2]->GetRTTI("C"))//detecting the actual type
{
pTarget = dynamic_cast< C* >(pList[2]);//casting to the type
}
//using pTarget
...
|
|
|
|
|
The class type or the class name? Is typeid() of any help?
"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
|
|
|
|
|
Class name would be good.
But indeed doesnt matter, I have to somehow detect the actual class for the further casting.
Thanks.
|
|
|
|
|
I think that at runtime, you will have to use the (slow) dynamic_cast or have the classes know their types via a ID of some sort.
Nihil obstat
|
|
|
|
|
This is my first code using DirestShow and could use some help with this linker issue.
The “problem “ is that the second usage of CoCreateInstance with CLSID parameter of CLSID_VideoMixingRenderer fails to link.
Here is “standard” linker error:
VMR_Capture.obj : error LNK2001: unresolved external symbol _CLSID_VideoMixingRenderer
Debug/OpenCamera.exe : fatal error LNK1120: 1 unresolved externals
I have included Microsoft SDKs\Windows\v7.1\Include\uuids.h and both of these CLSID are defined there.
Here is the failing code snippet
….
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void **)&m_pGB); // links fine
if(SUCCEEDED(hr))
{
hr = InitializeWindowlessVMR(hWnd);
…..
hr = CoCreateInstance(CLSID_VideoMixingRenderer, NULL,
CLSCTX_INPROC, IID_IBaseFilter, (void**)&pVmr);
// fails to link
I would appreciate any help/ suggestions on how to troubleshoot this.
Thanks for your time.
Vaclav
|
|
|
|
|
From the error message above it appears that this CLSID is not defined properly in the header. Check back and see what value it generates.
Use the best guess
|
|
|
|
|
Richard,
thanks for your advise.
I have replaced ( in uuids.h) failing CLSID with working one , same linker error.
Since I do not know squat about this I guess I need to find out what it should be to make this troubleshooting more effective.
// VMR GUIDS
// -------------------------------------------------------------------------
#pragma message ("CLSID_VideoMixingRenderer")
// {B87BEB7B-8D29-423f-AE4D-6582C10175AC}
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer,
//0xB87BEB7B, 0x8D29, 0x423f, 0xAE, 0x4D, 0x65, 0x82, 0xC1, 0x01, 0x75, 0xAC)
0xe436ebb3, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
Addendum
Just changed the CLSID to CLSID_VideoRendererDefault and getting same linker error.
|
|
|
|
|
I think you need to include the Strmiids.lib library as described on this MSDN page[^].
Use the best guess
|
|
|
|
|
The library is inluded. That is why I am lost since one of the CLSID works and the other does not.
Maybe I should look for #ifdefs in the uudis.h, but the compiler "reported" the #pragma message I stuck in front of the "bad" CLSID.
Go figure.
|
|
|
|
|
Vaclav_Sal wrote: one of the CLSID works and the other does not. Then the chances are that there is another missing library. Unfortunately I have no experience of this package and only found the answer by searching through the documentation. I am afraid you will have to do the same.
Use the best guess
|
|
|
|
|
It seems that I need correct Strmiids.lib version.
I have changed the path to the latest Strmiids.lib
Mine is in C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib
Now I am getting this error:
strmiids.lib(strmiids.obj) : fatal error LNK1103: debugging information corrupt; recompile module
Error executing link.exe.
Do I have to rebuild the Strmiids.lib
using my VC6.0 from scratch?
It would make it easier to step thru if I have a "source" anyway.
|
|
|
|
|
I am afraid I have some bad news for you. Windows SDK 7.1 is not compatible with VC6. Please see the reply to this question: http://social.msdn.microsoft.com/Forums/en/windowssecurity/thread/18990fc3-94c4-41da-bedc-40b9237b8ba0[^]
I can understand if you are trying to stay with VC6 for financial reasons, but I have to echo the last line of the response "You should really think about upgrading to a more recent version of the IDE."
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
|
Don't worry, I will not give you a whole lecture about upgrading, just suggest it. I am using VS2010 and I don't have problems with Windows SDK 7.1, I think .
From what I have heard, VS2010 is slower than VS2012, so you might be even more disappointed should you switch to that.
I recalled reading a post a few weeks ago in the Lounge by Marc Clifton where he said VS2008 was the last usable IDE put out by Microsoft. I hunted the post down for you in case you are interested: I would have to say...[^]
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Soren,
I truly appreciate you sparing me from lecturing how cool MS stuff is.
I was once interviewed by MS “experts” only to find out that the development “teams” do not maintain any records from one release to another – in their own words “ we do it from scratch because we have new “teams”. I was actually glad they did not hire me.
I also believe the other reason their stuff so boated and full of holes need fixing is they are actually hardware company – pushing for more memory, larger HDD and even “developed” CD because loading OS using couple of dozen floppies was ridiculous.
I wish I could figure out why the VFW is so flaky and skip the Direct whatever for now.
If the DirectShow sample posted ( written with VC6.0) here worked for me I suspect I would find out that it also have problems to display the captured video.
Actually that is the root of my current linker problem – the CVMRCaputre class posted here does not link either, I get same linker undefined symbol. Unfortunately the author is no longer active – so I got double trouble.
Makes one wonder why so many authors of video capture programs posted here disappear from the scene fast. I guess the only stalwart is CxImage stuff.
Sorry for the rant, going on my morning walk now.
Cheers and have great day.
Vaclav
|
|
|
|
|
Unless I can find a source code ( just dreaming) for this stinking stream id library to build my own - what are my alternative(s) to do RELIABLE video capture besides ( expletive deleted ) DirectShow?
I really do not want to switch to Linux and start over.
No more cheers from me on this one.
Vaclav
|
|
|
|
|
how to make a simple link list and template and impletation of linklink or how to make libray
|
|
|
|