|
i didn't download ur code.
i guess the menu ID is not the same as the button ID.
includeh10
|
|
|
|
|
includeh10 wrote:
i guess the menu ID is not the same as the button ID.
no, that is not the problem.
MSN:maxsnts@hotmail.com
|
|
|
|
|
Hello ,
I have one small problem . I have created the DLL file using regular dll with MFC statistcally linked . I am calling the function "Call"
in DLL file by clickin the button in my main dialog based application .
This function creates one mode less dialog box . The mode less dialog works fine with mouse clicking except it doesn't accept any keyboard input i.e I am unble to move bteween the buttons on modeless dialog using tab button . I have to press the button using mouse only . The main dialog works with tab , but only modeless dialog created using dll don't work with the " Tab as well as Enter key " . If I convert the same modeless dialog into Modal dialog then it works with keyboard . Why the problem is with only modeless dialog .
Please suggest the any solutions.
regards,
Bhalchandra
|
|
|
|
|
Hi,
I'm using a client/server application from a software company .
This software allows me to interact with it thanks to a user DLL that I have to implement on the NT side of the communication. This is what they call a "user exit".
So far so good : each time the software sends or receives a buffer, it fires my DLL, pass information to it , retrieves back updated data, and everything's fine.
I have an additional need : I would like to detect in my DLL if inactivity occurs for let's say 10 minutes so that I can take special action. Inactivity means my DLL hasn't been fired for 10 minutes.
I tried to use SetTimer (callback function) / KillTimer in my DLL but as you can imagine, when I call SetTimer in my DLL and then give control back to the main application, the callback application is never called in case of a time-out .
Is there a way to solve that issue ?
Thanks for reading and helping me on this topic.
Marc
|
|
|
|
|
Just spin up a helper thread in which you create an event, then do a WaitForSingleEvent with a timeout of 60000. Every time you have activity, set the event. In the event loop, check whether it was set by a timeout. If not, reenter the wait, if so, have it call your function.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi Joe
That sounds good !!!
I'll try that and let you know.
Thanks a lot!
Marc
|
|
|
|
|
EVERYTHING's FINE ..; It works!!
Thanks a lot Joe, I 've really appreciated your help.
And I think the concept you've explained is simple and efficient.
It was my first program in my life on Win32, I'm more used to develop on mainframe system. I was challenged by my management and thanks to you, I've succeeded.
Un grand merci.
Marc
|
|
|
|
|
Glad it worked.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi,
I am developing a MDI program and I want to have a start button on the toolbar which will send a custom message to the view dialog that currently has focus. I can send windows messages sucessfully, but am unable to send my custom one. The code I have so far is shown below:
#define PM_START WM_APP+1
mainfrm.cpp:
void CMainFrame::OnButtonStart()
{
// CMDIFrameWnd *pFrameWnd = (CMDIFrameWnd *) AfxGetMainWnd();
// HWND hWnd=::GetWindow(pFrameWnd->m_hWndMDIClient, GW_CHILD);
HWND hWnd=GetActiveFrame()->GetSafeHwnd();
::SendMessage(hWnd, PM_START, 0, 0);
}
viewone.h:
// Generated message map functions
//{{AFX_MSG(CViewCrack)
afx_msg void OnStart( WPARAM wParam, LPARAM lParam );
viewone.cpp:
.
.
BEGIN_MESSAGE_MAP(CViewOne, CFormView)
//{{AFX_MSG_MAP(CViewCrack)
ON_MESSAGE(PM_START, OnStart)
.
.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
.
.
void CViewOne::OnStart(WPARAM wParam, LPARAM lParam)
{
AfxMessageBox(_T("Message received"));
}
Any help would be greatfully appreciated,
Mike
There are 10 types of people in the world
Those who understand binary, and those who don't
|
|
|
|
|
override WindowProc() then
switch(message)
{
case PM_START:
//ok here
break;
includeh10
|
|
|
|
|
I have already tried this also, but it made no difference. It's as if the message isnt being sent at all.
Anyone have any other ideas?
There are 10 types of people in the world
Those who understand binary, and those who don't
|
|
|
|
|
If you're trying to send the message to the _view_, then I think you have the handle to the wrong window. The line:
HWND hWnd=GetActiveFrame()->GetSafeHwnd();
returns a handle to the active frame (presumably, a child in an MDI app). You probably need the window returned by GetActiveView().
One way to find out is to use Spy++ and determine the HWND to the target window. Then set a breakpoint inside your code, and see if that's the same HWND that you're sending the message to.
Regards,
Mike
|
|
|
|
|
Thanks for replying ...
I have just seen what I was doing wrong and its going down in the 'Mikes Big Book of Embarrasing Problems'. For anyone else that has the same problem, the solution is as simple as:
<br />
HWND hWnd=::GetWindow(GetActiveFrame()->GetSafeHwnd(), GW_CHILD);<br />
if(hWnd==NULL) return;<br />
<br />
::SendMessage(hWnd, PM_START, 0, 0);<br />
Thanks again.
There are 10 types of people in the world
Those who understand binary, and those who don't
|
|
|
|
|
What is high level abstraction and low level abstraction?
How do you define them? I used to think abstraction is
abstraction. Never thought that they can be defined
High level and low level.
Thanks.
|
|
|
|
|
I've never heard such a distinction mentioned, but it could refer to an "abstraction" which simply wraps an object and one that offers additional functionality beyond that. Of course, by this definition, a low level "abstraction" isn't really an abstraction at all.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
the way i always thought of it is basically higher / lower levels of computing abstraction..
assembly language is a low-level abstraction.
opcodes , etc, are just an abstraction of the movement of electrons thru the hardware going on behind the scenes.
c is a higher level of abstraction than assembly.
html is a higher level of abstraction than c.
etc.
i dont know if this is in the context you are asking of, but is always the context ive heard programmers / cs people, refering to higher / lower levels of abstraction....
todo....
:: insert inspirational text here ::
|
|
|
|
|
Okay, I was not specific. But thank you for your reply.
I was talking about the level of abstraction in C++ of
OOP design. OOP is all about data abstraction, but what
kind of design data abstraction is low level, and high
level?
Thanks.
|
|
|
|
|
I am trying to wrtie a wrapper for the Win32 toolbar. I would like to have a function to dynamically toggle whether the toolbar button text labels are displayed. The only solution I can see is to delete the existing buttons, and add them again with either the iString member of the TBBUTTON struct set to -1, or a valid string index. Is this really the only way or is there some simpler way to do this that I am missing ? I have looked at some of the toolbar articels here and haven't found much yet.
Thanks
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
I think you can send a TB_SETBUTTONINFO message to change the style. In the TBBUTTONINFO struct, set the BTNS_SHOWTEXT bit of the fsStyle member.
I never tried it, but it seems like it should work.
Chris Richardson
|
|
|
|
|
Can someone give me a clue about Wasabi SDK
The first example ( "example1" ) compilate successfuly but the
plugin is not listed in the Thinger and missed in the context menu.
What I missed ?
|
|
|
|
|
No offense, but how about asking in the Nullsoft forums?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
IMediaControl :: GetState() errors in DirectShow???
------------------------------------------------
Hi All,
I want to use GetState() method of IMediaControl. But could not able declare its 2nd argument correctly. Here is my code:
HRESULT hr;
hr = pMC->Run();
if (hr == S_FALSE)
{
FILTER_STATE filterState; // or _FilterState filterState; ????????
hr = pMC->GetState(1000, (FILTER_STATE)filterState);
if (hr == S_OK)
{
...
}
}
It gives following error:
error C2664: 'GetState' : cannot convert parameter 2 from 'enum _FilterState' to 'long *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast.
If I declare a pointer "FILTER_STATE *filterState;", it gives this error:
error C2440: 'type cast' : cannot convert from 'enum _FilterState *' to 'enum _FilterState'.
There is no context in which this conversion is possible.
----------------- More queries --------------------------
1. Run() is returning "S_FALSE". What can be reasons of it? (RenderFile() is returning "VFW_S_AUDIO_NOT_RENDERED").
2. Value of HRESULT is long (262744 in returned by RenderFile()). How can I display its error string (i.e. VFW_S_AUDIO........)?
Thanx in advance.
Regards,
Saurabh
|
|
|
|
|
HRESULT GetState(
LONG msTimeout,
OAFilterState *pfs
);
Parameters
msTimeout
[in] Duration of the time-out, in milliseconds, or INFINITE to specify an infinite time-out.
pfs
[out] Pointer to a variable that receives a member of the FILTER_STATE enumeration.
you have to pass a POINTER as the second parameter...
please read the documentation more carefully before you are posting here!
|
|
|
|
|
This is my code:
<br />
void CUltraShareDlg::pasa_el_foco(CWnd* pWnd)<br />
{<br />
CPoint cursor;<br />
CPoint punto;<br />
CRect rectangulo;<br />
CPoint punto1;<br />
CPoint punto2;<br />
<br />
<br />
for (int i = 0; i < crear_ventana_servidores.m_servidores.GetItemCount(); i++)<br />
{<br />
GetCursorPos(&cursor);<br />
<br />
crear_ventana_servidores.m_servidores.GetSubItemRect( i, 2, LVIR_LABEL, rectangulo);<br />
<br />
if (PtInRect(rectangulo, cursor)!=0)<br />
{<br />
<br />
MessageBox("I did it !!");<br />
}<br />
<br />
}<br />
<br />
pWnd->SetFocus();<br />
<br />
}<br />
The PtInRect() function is never !=0, I don't know how to know if the point is into the rectangle, I'm having lots of problems because of this... please help me...
Thanks in advance.
MaestroProgramador.Com
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
GetCursorPos() is screen coordination.
includeh10
|
|
|
|