|
I use the Class CDAORecordset in my program, and it can run correctly on the computer whith VC++ Installed, But it can't Run on the computer whithout VC++ Installed.
Isn't the lack of the DLL files?
VCBeginer
|
|
|
|
|
Yes you need the DAO dll's. Can't remember the names of them. Most decent install software will determine this for you.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
I want to create a player for play OGG file.
I decide to use DirectShow to play it. But I don't know how to use the Vorbis Decoder filter.
I have download OggVorbis DirectShow Filters from http://tobias.everwicked.com/download.php?OggDS0995.exe .
It includes four filters. I want to use Vorbis Decoder.
What I have to do to use this filter to play OGG file?
|
|
|
|
|
Launch the FilterGraphManager, that's one of the .exe provided.
Then Insert this filter in the client area, and right-click Render on its output pin. This should auto-build the necessary filter graph.
That was the get-your-hands-on-it phase.
Now to do it by code, just take any sample movie player in the SDK, and do just this :
HRESULT CPlayerDoc::AddNewVideoRendererToGraph()
{
HRESULT hr ;
IBaseFilter *pFilter=NULL;
hr = CoCreateInstance(CLSID_ARST_VIDEORenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (LPVOID *)&pFilter) ;
if (FAILED(hr))
{
switch (hr)
{
case E_INVALIDARG : TRACE("INVALID_ARG\n");break;
case REGDB_E_CLASSNOTREG : TRACE ("REGDB_E_CLASSNOTREG\n");break;
case CLASS_E_NOAGGREGATION : TRACE ("CLASS_E_NOAGGREGATION\n");break;
default:break;
}
return E_FAIL ;
}
hr = m_pGraph->AddFilter(pFilter, L"ARST VIDEO RENDERER") ;
if (FAILED(hr))
{
pFilter->Release();
return E_FAIL ;
}
return S_OK ;
}
And for the rendering part :
BOOL CPlayerDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
WCHAR wPath[MAX_PATH];
DeleteContents();
if ( !CreateFilterGraph() )
{
AfxMessageBox(IDS_CANT_INIT_QUARTZ);
return FALSE;
}
::MultiByteToWideChar( CP_ACP, 0, lpszPathName,
-1, wPath, MAX_PATH );
AddNewVideoRendererToGraph();
if (FAILED( m_pGraph->RenderFile(wPath, NULL) ))
{
AfxMessageBox(IDS_CANT_RENDER_FILE);
return FALSE;
}
How low can you go ? (MS rant)
|
|
|
|
|
i am reading a code from a text book:
long WINAPI WaitToEat(long lParam)
{
CPhilosopher* pPhilo = (CPhilosopher*)lParam;
DWORD dwEatTime = 1000 + GetCurrentThreadId();
_tprintf(_T("Philosopher %d is alive!\n"), pPhilo->m_nID);
while(g_fDone == FALSE)
{
// Wait for my two chopsticks.
WaitForMultipleObjects(2,
pPhilo->m_hSticks,
TRUE,
INFINITE);
//
// Wait satisfied - I have both chopsticks
SayEat(pPhilo);
Sleep(dwEatTime);
SayThink(pPhilo->m_nID);
// Release both chopsticks.
ReleaseMutex(pPhilo->m_hSticks[1]);
ReleaseMutex(pPhilo->m_hSticks[0]);
}
return 0;
}
My QUESTION is:
is the mutex locked between WaitForMultipleObjects and ReleaseMutex??
I dont see any method that looks similar to:
pPhilo->m_hSticks[0].LockMutex()
I presume as soon as WaitForMultipleObjects returns, "WaitForMultipleObjects" also lock the mutex for "this" thread??
Thanks
norm
|
|
|
|
|
Yes. The mutex is "owned" via the wait function.
All others will have to wait until you release it
and it becomes signaled again. (signaled state
indicates availability)
|
|
|
|
|
thanks. i did a very simple test that launch two threads, the first thread did NOT release the mutex, so the second thread was blocked. It reconfirmed the hypothesis.
norm
|
|
|
|
|
Is there a quick way to check if a server socket has closed unexpectedly, such as when the power on the machine is turned off? I find that the client socket eventually gets a WSAECONNRESET error but it takes up to a minute.
|
|
|
|
|
At last,how do you solve that question?I also encountered that question,can you help me?
|
|
|
|
|
Hi...
I want to some item in the list box...i have tried all the sample in this side...but somehow i don't know it not work...I using the EVC++ 3.0 for win CE...
Someone please help......
Rgds
;);P ((
:_Rocket_:
|
|
|
|
|
hi,
How to use lParam and wParam to send values to message queue?
Examples are welcomed.
Thank u in advance.
Extreme programming. Do the No.1
|
|
|
|
|
I believe wParam and lParam are both 32 bit types. To use them you can cast any data type that is 32 bits or smaller to either lParam or wParam and past them as arguments to the ::PostMessage() function.
Example:
<br />
CObject *pObj = new CObject();
<br />
::PostMessage(hWnd,MESSAGE_ID,(WPARAM)pObj,NULL);<br />
Then handle the message in the window that recievies it by declaring it in the message map and writing a function to handle the message.
<br />
ON_MESSAGE(MESSAGE_ID,OnMessage)<br />
<br />
LRESULT CSomeClass::OnMessage(WPARAM wParam, LPARAM lParam) {<br />
CObject *pObj = (CObject *)wParam;<br />
}<br />
Note: none of the code is tested and written off the top of my head.
- Anatari
|
|
|
|
|
As Anatari said, you can cast any 32-bit value that you would like to fit inside of wParam and lParam. However there are a few things to be aware of.
If you are posting a message to the message queue, then you cannot use objects that were created on the stack. That is because these objects will most likely be destroyed before the posted message is processed. Instead you will need to create a mechanism to allocate the object on the heap, and destroy the object after the message has been processed.
If your item is being sent to the message queue, it will be safe to pass items that are located on the stack.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
stack vs heap
good point =)
norm
|
|
|
|
|
I am writing a MFC MDI application. At a particular point I am displaying a Dialog in a separate thread that contains a progress meter. I am using the AfxBeginThread function supplying the CRuntimeClass of the progress meter dialog. Then when the progress meter is no longer needed I call the dialog's EndDialog function and then call WaitForSingleObject to wait until the thread is terminated.
All well and good...It works just fine under Win98.
It doesn't work under Win2K
It seems that under NT in order to use WaitForSingleObject, the SYNCHRONIZE permission has to be set...which is also accomplished by setting PROCESS_ALL_ACCESS permissions.
Finally, my question. How do you set the SYNCHRONIZE or PROCESS_ALL_ACCESS permissions for the process in a MFC MDI app?
Gary Kirkham
A working Program is one that has only unobserved bugs
|
|
|
|
|
I strongly doubt that your problem has to do with events permissions. More likely it stems from the fact that you're calling EndDialog in a strange fashion (maybe directly from the main thread). The proper way to close the dialog is by sending a WM_CLOSE message: try this, maybe your problem goes away.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks that did the trick
Gary Kirkham
A working Program is one that has only unobserved bugs
|
|
|
|
|
Sometime some pages is very nice, but I want comment it. Can I write some tools just paint on IE or web control ? Pz give some hints . THX.
|
|
|
|
|
Use dhtml edit controls. (separate SDK from the platform SDK, or CHtmlEditView added in MFC7/VC7).
How low can you go ? (MS rant)
|
|
|
|
|
Thx very much.....
I will try dhtml edit controls. Do you have some examples for me? Thx again.
|
|
|
|
|
I have seen at least one on CP. Use the search engine (CHtmlEditCtrl, CHtmlEditView, CDHtmlDialog).
And you have two samples along with the VC++.NET DVD : dhtmlexplore, and htmledit. May be those are available online as well, I haven't checked.
Strongly suggested is a lookup in MSDN mag archive. Pretty sure you'll have decent listings (esposito and other guys are fond of that).
How low can you go ? (MS rant)
|
|
|
|
|
O... I use VC6. So I have no .NET DVD. I find all examples are for VC7. When I use DHTML Edit Control, it always show office 2000 install message? Why ?
|
|
|
|
|
The Office message is because 2 years ago the dhtml edit component was installed along with all MS products, so i guess you have some registry keys out there attaching it to Office (you should know that the Office installer is a total mess by the way).
More info about the component here[^].
As the documentation says, MS regards it now as legacy as they are willing to sell VC7 and .NET stuff. It is obvious there are dollars here, than with just a tiny stand-alone SDK. Business as usual...
How low can you go ? (MS rant)
|
|
|
|
|
How do i display filenames and their icons in a Listbox?
Right now my app has all CListbox but let me know if I should change them to CListCrtl if it would be easier to display.
I tried searching for this information but I could not find. I understand people have created Classes out there to do this but I would like to just to it using CListbox or CListCtrl, unless it would be easier using an easily "plugable" Class.
I only need the code for the creation of the Listbox or control since I have the code to get the filename and their paths already finished.
Thanks,
Joe
www.joeswammi.com
|
|
|
|
|
A Listctrl would be a better choice since it supports images while CListBox doesn't. You can get the image of a file by using SHGetFileInfo - this can return the icon of the given file. Remember to use the flag SHGFI_USEFILEATTRIBUTES if the file in question isn't an executable file to avoid hitting the disk for each file displayed.
PJ Naughter has an excellent demo at http://www.naughter.com/filetreectrl.html[^] - you might want to use it as a base for your code.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|