|
|
Yes I used the same one. the popup menu apeared on clicking the tray icon do not disappear if i click on some other window. It remains there, and to make it disappear I have to select something from menu.
I want to hide the popup menu when I click on some other menu or in some other area
Regards.
|
|
|
|
|
MSDN library mentions this problem in the description of ::TrackPopupMenu function. In order to solve it, there is a recomendation to make the window foreground before TrackPopupMenu , and then to post a benign message immediately after TrackPopupMenu :
::SetForegroundWindow(hwnd);
::TrackPopupMenu(...);
::PostMessage(hwnd, WM_NULL, 0, 0);
Or, in case of MFC, inside a member:
SetForegroundWindow();
TrackPopupMenu(...);
PostMessage(WM_NULL);
Hope this will help.
-- modified at 10:11 Friday 2nd June, 2006
|
|
|
|
|
hai all's
whenever i execute the program in VC++(MFC(exe)) project the i have find
the error (could not execut the program:Invalid directory(win 32 error(267)
and this error is always for all my programs .
plz tell me where i am wrong.
mailing me
Yogi
|
|
|
|
|
Giving it just a try....
Its not clear from your posts what context are you working in.
Try and check the settings for the project . May be the path of the exe is not mapping currently. Go to project>settings>Debug>(set the path of the exe manually).
Does this help you?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
I am able to load(AfxLoadLibrary) the libavcodec dll in a VC7 Dialog based application. However I dont know how to call the functions within this DLL to encode/decode video. Has anybody done anything of this sort?
|
|
|
|
|
GetProcAddress for get the address of a function
whitesky
|
|
|
|
|
Ok, the def file says "avcodec_register_all @ 97 ; " so how would I use this with GetProcAddress?
"GetProcAddress(hModule, avcodec_register_all);" ??
Some kinda code snippets would be really helpful
Thanks anyway for replying
|
|
|
|
|
|
I have already had a look at that. But am unsure about the typedef thingy. Plus i am using the AfxLoadLibrary option.
This is what I am trying and it builds and executes fine
HMODULE hmodule;<br />
hmodule = AfxLoadLibrary("libavcodec.dll");<br />
if (!AfxLoadLibrary(_T("libavcodec.dll")))<br />
AfxMessageBox("failed to load");<br />
typedef void * (__stdcall *avcodec_register_all)();<br />
GetProcAddress(hmodule,"avcodec_register_all");<br />
void * objptr= avcodec_register_all();
I know this will sound dumb but if I wanted to encode video, I will have to typedef every function that I call fm the DLL?
-- modified at 4:45 Friday 2nd June, 2006
|
|
|
|
|
i write a sample i hope that helpful to you
<br />
<br />
<br />
typedef BSTR FAR (WINAPI *TESTFUNCTION)(HWND hWnd,TCHAR lpt[50]);<br />
TESTFUNCTION m_TestFunction;<br />
<br />
LibraryDll=LoadLibrary("Testdll.dll");<br />
<br />
m_TestFunction=(TESTFUNCTION)GetProcAddress(LibraryDll,"TestFunction");
<br />
m_TestFunction(pWnd->m_hWnd,NULL);
whitesky
|
|
|
|
|
Thank you for the code
But i am looking for code specific to FFMPEG and the libavcodec dll.
Any takers??
|
|
|
|
|
I write one example for you but i dont know whats your dll(exactly)
whitesky
|
|
|
|
|
You can learn more about FFMPEG from http://ffmpeg.mplayerhq.hu/[^]
Basically its an Audio/Video encoding/decoding thingy (OpenSource).You get dlls when you build ffmpeg and I am trying to use these DLLs in my VC++ application.Unfortunately, since its OpenSource, there isnt much documentation available online. Thanks for all your help though
|
|
|
|
|
Thanks for link but where your dll that has problem(exactly address)
and if you need to decode and encode you can see codeproject examples
whitesky
|
|
|
|
|
My dll has no problem. its in trying to use the functions of the dll that I get stuck . I dont know how to do it
Sorry for not having made that clear sooner.
|
|
|
|
|
ohh yes.ok wheres this dll file and also documets it
whitesky
|
|
|
|
|
You can download FFMPEG from http://ffmpeg.mplayerhq.hu/download.html[^]. It can be built using MINGW and MinSys
Instructions here
http://soenkerohde.com/tutorials/ffmpeg/
Or you can directly download a pre-built version of FFMPEG that has the dlls and the exe ready. The dll also has a def file but that's hardly helped since it mentions what functions are there but not the paramters
|
|
|
|
|
I am stuck in device context trouble.
Right now I am conclusion it will be worth to get directly
desktop dc for generic class.
If any body can suggest me way for passing device context to generic class
through thread function or getting desktop dc directly for drawing in generic class.
Here simulate is generic class and the nextpos function is doing lot of drawing stuff.and it needs device context,I have developed SDI application.
and used CView as base.
UINT CMy5CYLINDERView::ThreadFunc(LPVOID pParam)
{
CWnd *cwnd,*cwnd1;
cwnd1 = cwnd->GetWindow(1);
CDC* pDC = cwnd1->GetDC();
simulate* eng = (simulate*)pParam;
eng->nextpos(pDC);
// eng->nextpos(pszWindow);
return 0;
}
void CMy5CYLINDERView::support()
{
for(int ii = 0;ii <= 3;ii++)
{
x[ii] = AfxBeginThread(ThreadFunc,(LPVOID)&engine[ii]);
}
}.
|| ART OF LIVING ||
|
|
|
|
|
whats value cwnd(initialize)
i guess your problem is cwnd1 = cwnd->GetWindow(1);
whitesky
|
|
|
|
|
I tried solutions you given that day but it didnot worked.
How to get the window
CDC* pDC;// = this->GetDC();
HWND hwnd = ::GetActiveWindow();
HDC hdc = ::GetDC(hwnd);
pDC->SetOutputDC(hdc);
nextpos(pDC);
just now I tried longest path it also didnot worked.
I removed thread still I am able to get and pass the dc.
moment I assign anything to pDC it gives error
|| ART OF LIVING ||
|
|
|
|
|
CDC* pDC without value so you get one error pDC=GetDC();
this line has error pDC->SetOutputDC(hdc);
whitesky
|
|
|
|
|
Thanks friend i got my error.
I was calling this support fuction from the constructor before creation of window.
so it was unable to get the device context.now at least I got the dc.
now i am calling it though onlbuttondoubleclick.
As code for support I written much below the file inwhich I was saying this->getdc(),but the this pointer was not of the window.
|| ART OF LIVING ||
|
|
|
|
|
Hai all's
i have done the setting as givin below yet, i found again same problem
whenever executing the program
Could not execute the program Invalid (win32 error 267)
Check the directory settings from the Menu Tools>Options [Directories tab]
If it is incorrect put the correct value
Plz tell me where i am wrong
mailing me
Yogi
|
|
|
|