|
Dear all,
How to place SDL ( simple Directmedia layer) in MFC application.So that we can view sample movie from the screen
Manjunath S
GESL
Bangalore
|
|
|
|
|
you answer to many quesitons SDL
Is SDL class?
whitesky
|
|
|
|
|
Manjunath S wrote: How to place SDL ( simple Directmedia layer) in MFC application.So that we can view sample movie from the screen
1) Create your MFC application project.
2) Download SDL runtime library (SDL.DLL) from HERE[^].
3) Copy SDL.DLL into your project folder.
4) Read those documents at SDL website, such as THIS[^] and THIS[^] ...
Maxwell Chen
|
|
|
|
|
|
toxcct wrote: are you kidding ??????
Control your Anger buddy, otherwise i have to call FireFighter
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
it's his 4th post ask with the same stupidity...
and after that, one ask me not to call him "idiot" ?!
damn it
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Tox sorry to say this. Yes, *YOU* cannot call him an idiot. Its because you have got *MORE* reputation than what you think you have here. People love you *MORE* than what you know here. David Crow asked you not to call him idiot because he was concerned about your reputation. You have a good intellect and a nice helping mind. May be you don't even know me. How many members are there as of now? *A LOT* know you but. So, as David already pointed out, please ignore such posts. Keep your good job up.
|
|
|
|
|
Aljechin wrote: David Crow asked you not to call him idiot because he was concerned about your reputation. You have a good intellect and a nice helping mind. May be you don't even know me. How many members are there as of now? *A LOT* know you but. So, as David already pointed out, please ignore such posts. Keep your good job up.
Yeap you are 100% right! %thumbs Up%
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
toxcct wrote: damn it
Calm down Buddy, thats my only advice to you!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
toxcct wrote: it's his 4th post ask with the same stupidity...
Yeah I've read his previous posts on this topic. I think he hasn't known how to use those Internets search engines such as Google or Yahoo, and that's why I provided him the link to download SDL.DLL ...
Maxwell Chen
|
|
|
|
|
Hi All,
I am having a request xml (SOAP). It has to be HTML Encoded . In my search i got all URL encoding results.
Can any one help me to do HTML encoding. Is there any separate API for it?
Thanks in advance,
Poornima
|
|
|
|
|
Can somebody please point me what are disadvantages of MultipleInheritance.
|
|
|
|
|
|
Hi,
I have the file named "mobi.avi",
I used fopen() with the prama mode is "w+" to open this file for my checking in my function, but while this file is opening by the orther program as Window Media then the function will show the error is file can not access. But my problem is when I stop play the file with Window Media, the file removed.
So, I want to ask you how can i do with not remove the file when open error,
Please help me!
Thank in advacnce
|
|
|
|
|
<edit>
In general, try MSDN for this kind of problems (and heaps of other information).
http://msdn1.microsoft.com/en-us/default.aspx[^]
From MSDN:
The character string mode specifies the type of access requested for the file, as follows:
"r"
Opens for reading. If the file does not exist or cannot be found, the fopen call fails.
"w"
Opens an empty file for writing. If the given file exists, its contents are destroyed.
"a"
Opens for writing at the end of the file (appending) without removing the EOF marker before writing new data to the file; creates the file first if it doesn’t exist.
"r+"
Opens for both reading and writing. (The file must exist.)
"w+"
Opens an empty file for both reading and writing. If the given file exists, its contents are destroyed.
"a+"
Opens for reading and appending; the appending operation includes the removal of the EOF marker before new data is written to the file and the EOF marker is restored after writing is complete; creates the file first if it doesn’t exist.
When a file is opened with the "a" or "a+" access type, all write operations occur at the end of the file. The file pointer can be repositioned using fseek or rewind, but is always moved back to the end of the file before any write operation is carried out. Thus, existing data cannot be overwritten.
Probably you want to use "r"
|
|
|
|
|
I used "r" param but with this I can not check if the file is opening or not.
When the file is opened by orther app as window media, I want to check this and let user know the error message, but when i close window media then the file is deleted. How way to don't let app delete automatic when use fopen function?
The follow code i tried:
FILE * file = fopen(m_szFileName, "r");
if (NULL != file)
{
if(remove(m_szFileName)){
strcpy(m_szErrorMessage, "SetRecordFileName(): File access error! Please check and try again!");
return (false);
}
}
FILE* file = fopen(m_szFileName, "w");
if (NULL == file)
{
strcpy(m_szErrorMessage, "SetRecordFileName(): File access error! Please check and try again!");
return (false);
}
|
|
|
|
|
OK, then I got your problem.
You might consider to use the Win32-function CreateFile instead. And set share mode for exclusive access, like this:
CreateFile("TheFile"
GENERIC_READ, // access (read-write) mode
0, // share mode (exclusive access)
NULL, // pointer to security attributes
OPEN_EXISTING, // how to create
FILE_ATTRIBUTE_NORMAL, // file attributes
NULL // handle to file with attributes to copy
);
Then you should get an error if the file is opened by someone else, since th file cannot be opened for exclusive access.
|
|
|
|
|
I used at below but it still delete the file after show the error message and close the Window media, this seem to the same above problem:
Can you help again?
--------------------
HANDLE hFile =CreateFile(m_szFileName,GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if(INVALID_HANDLE_VALUE == hFile){
strcpy(m_szErrorMessage, "SetRecordFileName(): File access error! Please check and try again!");
return (false);
}else{
CloseHandle(hFile);
}
|
|
|
|
|
The file is opened for reading (only), this CreateFile call can never delete the file as long as you use GENERIC_READ.
But I do suggest you to:
1.
Use OPEN_EXISTING instead of OPEN_ALWAYS. (The file already exists, doesn't it?)
2.
Use share mode 0 for exclusive access.
|
|
|
|
|
If I used OPEN_EXISTING and share mode 0, but I can not create a new file if the file have not existed,
My function is record a file avi,
if the file have not existed then create new one,
if the file existed and have not opened by orther app then over write this,
if the file existed and opened by orther app then give the user error is can not access and do nothing.
Any help again?
Thanks again!
|
|
|
|
|
That's a different story!
I suggetst you to do like this:
Open the file for reading, exclusive access. Then you will know two things:
A.
The file exists.
B.
The file is not opened by some other application.
Close the file, if it's open.
If you get an error, then examine the error. If you get ERROR_ACCESS_VIOLATION (?) then the file exists but is opened by some other application. Show user error and terminate the function.
If you get an error meaning that the file doesn't exist, then create a new file. (CreateFile, GENERIC_WRITE, maybe exclusive access).
I think that should do it.
|
|
|
|
|
Hi,
HANDLE hFile =CreateFile(m_szFileName,GENERIC_READ, // access (read-write) mode
0, // share mode (exclusive access)
NULL, // pointer to security attributes
OPEN_EXISTING, // how to create
FILE_ATTRIBUTE_NORMAL, // file attributes
NULL // handle to file with attributes to copy
);
I can not get the case as above(A and B), the hFile HANDLE always is 0xffffff when the file not existed and the file opened by orther function (always is INVALID_HANDLE_VALUE for tow case),
the constant ERROR_ACCESS_VIOLATION had not defined.
How way to recognize what the error happends with CreatFile function?
Any help again?
|
|
|
|
|
|
Hi,
I still have problem with deleting file.
I did as below:
HANDLE hFile =CreateFile(m_szFileName,GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
DWORD lerr =0;
lerr=GetLastError();
if(INVALID_HANDLE_VALUE == hFile){
if(lerr==ERROR_ACCESS_DENIED){
fclose(logFile);
strcpy(m_szErrorMessage, "SetRecordFileName(): File access error! Please check and try again!");
return (false);
}
}else{
}
This show the error when the file opened by orther appp but it still be deleted when the app close.
Any help again??
Many thank!
|
|
|
|
|
Hi,
I resolved my problem,
Many thank for help.
|
|
|
|