|
yes my question was messed up i meant adding controls thanks for the help
|
|
|
|
|
Come on, Mark. Put your double-quote fingers up when you ask those questions:
You want to create "dialogs" that look like "buttons?"
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I DID!
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
For make a dialog you can use of CreateDialog it makes a modeless dialog box.
|
|
|
|
|
error lnk2001: unresolved external symbol _IID_IMediaEventEx<br />
error lnk2001: unresolved external symbol _IID_IMediaControl<br />
error lnk2001: unresolved external symbol _CLSID_FilterGraph<br />
error lnk2001: unresolved external symbol _IID_IGraphBuilder <br />
error lnk2001: unresolved external symbol _IID_IVMRWindowlessControl <br />
error lnk2001: unresolved external symbol _IID_IVMRFilterConfig <br />
error lnk2001: unresolved external symbol _CLSID_VideoMixingRenderer <br />
error lnk2001: unresolved external symbol _IID_IBaseFilter <br />
error lnk2001: unresolved external symbol _CLSID_VideoInputDeviceCategory <br />
error lnk2001: unresolved external symbol _CLSID_SystemDeviceEnum<br />
error lnk2001: unresolved external symbol _IID_ICreateDevEnum <br />
error lnk2001: unresolved external symbol _IID_IAMStreamConfig <br />
error lnk2001: unresolved external symbol _FORMAT_VideoInfo <br />
fatal error lnk1120: 13 unresolved external symbols
but there is no such errors in VC6
|
|
|
|
|
VS is unable to locate the DirectShow library, probably Strmiids.lib
See my reply about setting up your build environment properly below
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
I have a project using DShow.It works well in VC6.
But when I convert it to VC2005,some errors occur.
Especially,a error like this:
1>d:\program files\microsoft visual studio .net\vc\platformsdk\include\winnt.h(222) : error C2146: syntax error : missing ';' before identifier 'PVOID64'
I thinks there is some wrong in the configuration of the DirectX(9.0b).
Someone would tell me how to config it and correct such error?
Thanks
|
|
|
|
|
The error has been resloved.
But another error occured.
It said that could not find such external :
_CLSID_VideoInputDeviceCategory
error LNK2001: _CLSID_SystemDeviceEnum
error LNK2001: _IID_ICreateDevEnum
How to resolve it?
Thanks
|
|
|
|
|
When you install the DirectX SDK, it updates the directories in your VS2005 settings
automatically. You may need to do this manually.
The errors you show look DirectShow-related. For DirectShow, you need the platform SDK as well,
unless you're using an old DirectX SDK.
Regardless, in VS 2005, go to Tools/Options Projects and Solutions/VC++ Directories and make sure
you have valid paths to the directX and DirectShow include and library directories in the
appropriate lists. These should be added at the top so they are searched before the include/lib
directories in the VS installation.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
its a linker error you need to import a lib file to your project.
|
|
|
|
|
I need a browse dialog that can select files that have file paths longer then _MAX_PATH(260).
I've tried using GetOpenFileName, but I get a "File name is invalid" error when I select a file with a name longer then 260 (_MAX_PATH) characters.
Does anyone have a method or know of an existing library/project that can display a browse dialog which can select file names longer then 260 characters?
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
Windows not support files longer than 259.
TCHAR lpstrFilename[MAX_PATH]="";
OPENFILENAME ofn;
CString pathname;
CString filename;
int nTerm=0;
char stemp[255]={0};
TCHAR *p;
memset(&ofn,0,sizeof(OPENFILENAME));
ofn.lStructSize=sizeof(OPENFILENAME);
ofn.lpstrFile=lpstrFilename;
ofn.hwndOwner=m_hWnd;
ofn.nMaxFile=MAX_PATH*2;
ofn.lpstrFilter="All files(*.*)\0*.*\0";
if(WINVER >= 0x0400)
ofn.Flags=OFN_ALLOWMULTISELECT|OFN_EXPLORER|OFN_LONGNAMES|OFN_FILEMUSTEXIST;
else ofn.Flags=OFN_FILEMUSTEXIST;
ofn.lpstrTitle="GetOpenFileName";
ofn.nFilterIndex=0;
if(GetOpenFileName(&ofn))
{
pathname=lpstrFilename;
if(pathname.Right(1)!="\\")pathname+="\\";
for(int i=0;;i++)
{
if(lpstrFilename[i]==0)
{
nTerm++;
if(lpstrFilename[i+1]==0)
{
if(nTerm==1)
m_FileList.AddString(lpstrFilename);
break;
}
else
{
p=&(lpstrFilename[i+1]);
strcpy(stemp,p);
m_FileList.AddString(pathname+stemp);
}
}
}
}
|
|
|
|
|
Windows does support files longer then 259 characters, but you have to use a different syntax.
You have to use prefix "\\?\" with the file name, and use CreateFile.
For more information, look at CreateFile in MSDN.
I've already tried using GetOpenFileName, and I gave it required buffer size which was greater then MAX_PATH, but it still failed.
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
As KevinXli pointed out, make sure you pass large enough buffers and set the nMaxFilexxx members
of the OPENFILENAME struct accordingly.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
I've already tried using GetOpenFileName, and I gave it required buffer size which was greater then MAX_PATH, but it still failed.
Here's example code:
void TestLongFileBrowse()
{
TCHAR acPath[2048] = _T("\0");
OPENFILENAME ofn;
ZeroMemory(&ofn,sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.nMaxFile = 2048;
ofn.lpstrFile = acPath;
if (GetOpenFileName(&ofn)) {
printf("Path length: %d\n", _tcslen(ofn.lpstrFile));
printf("Path: %S\n", ofn.lpstrFile);
} else printf("CommDlgExtendedError(): %d\n");
}
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
Are you using the Unicode version of GetOpenFileName() ? Only the Unicode APIs support full paths longer than MAX_PATH
|
|
|
|
|
I've tried it with both UNICODE and ANSI.
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
Axter wrote: http://www.experts-exchange.com/Cplusplus
Non-existent page.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Axter wrote: I've tried using GetOpenFileName, but I get a "File name is invalid" error...
Which is different than FNERR_BUFFERTOOSMALL .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Will the following code get rid of any exception that might be thrown in a destructor
Session::~Session()
{ try {
logDestruction(this);
}
catch (...) { }
}
What are the scenarios in which a destructor is likely to riase an exception?
I have not seen in any prodution code with a destrcutor having a try/catch clause like above?
Comments
|
|
|
|
|
Throwing exceptions from constructors or destructors is a bad idea.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
That is what I thought. Isn't there something in the C++ standards about this?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
John Simmons / outlaw programmer wrote: Throwing exceptions from constructors or destructors is a bad idea
I don't think so.
BTW the OP snipped doesn't show an exception thrown from the contructor, it shows an exception handled inside it.
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.
|
|
|
|
|
John Simmons / outlaw programmer wrote: Throwing exceptions from constructors or destructors is a bad idea.
Huh? ;)
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
It's just something I don't do.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|