|
DirectShow
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hm. Interesting...
Can it be used for both encoding and decoding, or is it for decoding only?
|
|
|
|
|
I suspect both, but I've only used it to decode, to give me specs on mp3's.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Very interesting. I think this is about as close as I can get to what I need... who would've thought Microsoft would do something right, eh? (Er... wrong forum for this kind of remark I guess. Oops )
Anyway, thanks for your help.
M.C.
|
|
|
|
|
Dear developers,
I am a newbie in visual C++ and windows programming. I need to make an application that run as a background process and probaly there is no GUI involved. Anybody can give me some pointers?
And also I would like to know, how you make an application that stays in Windows task bar? (at the right side of windows task bar, like yahoo messenger, msn messenger, etc.)
Many thanks,
Wayut
|
|
|
|
|
pointer 1) Use the "Search button at CodeProject and http://msdn.microsoft.com
pointer 2) For background process research "NT Service"
pointer 3) For Tray Icon in task bar research Shell_NotifyIcon()
-pete
|
|
|
|
|
This is the exact information I'm looking for.
Thank you,
Wayut
|
|
|
|
|
|
probably the easiest way to do run it as a process is this one:
for a win32 api.
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
while (true)
{
}
return 0;
}
to hide it to tray you have to make more steps:
NOTIFYICONDATA niData;
HINSTANCE hInst;
#define SWM_ENABLED WM_APP + 1 //
#define SWM_EXIT WM_APP + 2 // close the window
BOOL bEnabled = FALSE;
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow);
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow)) return FALSE;
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int) msg.wParam;
return 0;
}
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
// store instance handle and create dialog
hInst = hInstance;
HWND hWnd = CreateDialog( hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC)fereastra );
if (!hWnd) return FALSE;
// Fill the NOTIFYICONDATA structure and call Shell_NotifyIcon
ZeroMemory(&niData,sizeof(NOTIFYICONDATA));
niData.cbSize = sizeof(NOTIFYICONDATA);
niData.uID = 1;
niData.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
niData.hIcon = (HICON)LoadImage(hInstance,MAKEINTRESOURCE(IDI_ICON1),
IMAGE_ICON, GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON),LR_DEFAULTCOLOR);
strcpy(niData.szTip, "Tray Icon");
niData.hWnd = hWnd;
niData.uCallbackMessage = WM_APP;
// Add icon to tray
Shell_NotifyIcon(NIM_ADD, &niData);
// free icon handle
if(niData.hIcon && DestroyIcon(niData.hIcon))
{
niData.hIcon = NULL;
}
return TRUE;
}
gabby
|
|
|
|
|
I am curious if the following procedure is either not possible or if I am doing it wrong.
I have the following declaration for a list
<br />
CList<CEraCls, CEraCls&> m_List;<br />
in my implementation class I run the following command
<br />
CEraCls pEra = FindEra(EraString);<br />
m_List.Find(pEra);<br />
I get a compile errror in <afxtempl.h> warning me about this function
<br />
template<class TYPE, class ARG_TYPE><br />
BOOL AFXAPI CompareElements(const TYPE* pElement1, const ARG_TYPE* pElement2)<br />
{<br />
ASSERT(AfxIsValidAddress(pElement1, sizeof(TYPE), FALSE));<br />
ASSERT(AfxIsValidAddress(pElement2, sizeof(ARG_TYPE), FALSE));<br />
<br />
return *pElement1 == *pElement2;<br />
}<br />
where the return statement at the end has an issue
binary '==' : no operator defined which takes a left-hand operand of type 'const class CEraCls(or there is no acceptable conversion)
Does anyone see what the issue might be? I thought I could use Find in this fashion. Is this not correct?
Thanks!
|
|
|
|
|
You'll have to overload the "==" operator for your class CEraCls, which does the comparing. After you overloaded the operator, the code should compile just fine.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
overloading with the following code produced no change in compile results.
bool CErasCls::operator ==(const CErasCls &Array)
{
if( m_Code == Array.m_Code &&
m_Description == Array.m_Description &&
m_Synopsis == Array.m_Synopsis)
return true;
else
return false;
}
|
|
|
|
|
the operator== takes 2 parameters:
<br />
bool operator==(const CEraCls &lhs, const CEraCls &rhs)<br />
{<br />
}<br />
And the overloadeded operator doesn't need to be a member of the class (I don't think it does matter though).
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
I thought of that and that didn't work either , however the following solution DID work.
<br />
bool operator==(const CEraCls &pCopy) const<br />
{<br />
}<br />
go figure.
thanks for the tip though.
|
|
|
|
|
hi,
can someone please explain me with simple words whats the diffrence between CxxxDoc and CxxxView?
Help please...
Avi.
|
|
|
|
|
The class CxxxDoc contains information used by CxxxView.
The CxxxView (often called just "view" or GUI) is the window that a user can actual see.
The CxxxDoc (often called "document") is the class where the data is stored. The document class is also used for serialisation.
If you want to know more about the MFC Doc/View architecture, I suggest you read some articles about it.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
ok, i read and understood the architechture...
but now i have more complicated question (plz help...) -
if i want to query a table from a DB,
should the query operation be at the CxxxDoc and the query results should be shown by the CxxxView?
thanks again, Avi.
|
|
|
|
|
Yes, that's the best solution .
|
|
|
|
|
how do i transfer data from CxxxDoc to CxxxView?
Avi
|
|
|
|
|
From the document, to obtain a pointer to the view:
<br />
POSITION Pos = GetFirstViewPosition();<br />
if (Pos)<br />
{<br />
CXXXView* pView = (CXXXView*)GetNextView(Pos);<br />
pView->DoSomething();<br />
.... <br />
Do something with the pointer<br />
}<br />
From the view, to obtain a pointer to the document:
<br />
CXXXDoc* pDoc = GetDocument();<br />
if (pDoc)<br />
pDoc->DoSomething();<br />
|
|
|
|
|
Has anyone creates a project in Visual Studio 6 for building a 64-bit DLL? Thanks
|
|
|
|
|
Hi!,
I want to know how to make a service that will automatically restart every 3 hours or make windows 2000 server to reboot every 3 hours.
What happend is one of my services has very serious memory leak problem? To found there are bugs could take long time. So before a solution is found, we decide to restart a servier every 3 hours or make windows 2000 server to reboot itself every 3 hours.
|
|
|
|
|
Configure the service to automatically restart in the Recovery tab of the Service Properties.
Then use a TimerQueueTimer set to 3 hours and have the Service Stop itself and exit normally when the timer event fires.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I can not able to configure out how to make TimerQueueTimer work. Any exmaple. Thanks.
|
|
|
|
|