|
Ah, I found the problem.
If I didn't pass the button's window handle in the lParam,
then the CWnd's OnCommand handler, zeros the nCode
parameter, effectively making everything into a BN_CLICKED.
So I need to do:
GetParent()->SendMessage(WM_COMMAND,(WPARAM)(BN_PUSHED<<16|nID),hBtn);
Should I have known that?
(i.e. what purpose does that zeroing serve in OnCommand?)
|
|
|
|
|
Hi!
I have 3 Apps in my project. I would like to create a dialog with 3 buttons so that if I click on the first button the first app is launched. If I click on the second button, the second app is launched...
How can I do this?
thanks for helping..
Regards
Everything's beautiful if you look at it long enough...
|
|
|
|
|
1. find the path to each of your EXEs
2. use CreateProcess, spawn or WinExec to launch them
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
You Again!!
Well it seems that you are always there to answer my questions...;)
Thanks!!
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Hiya how do I check the contents of the recv function in window sockets??
I want to check the contents of the string, char by char.
This is my code so far:
int ret;
CString text;
for( int nReceivedBytes = 0;nReceivedBytes < 255; )
{
ret = recv( sock_Accept,text,255, 0 );
if( ret > 0 )
{
nReceivedBytes += ret;
}
}
Thanks,
grahamoj.
|
|
|
|
|
What do you mean check the contents of the string? Given that your code stores the incoming data into variable text, one solution is to check the CString object via [] operator.
Kuphryn
|
|
|
|
|
Hey all,
I want to get a list of exported DLL functions from a DLL (like Dependency Walker does) - along with each function's entry point.
How do I do that?
Thanks!
|
|
|
|
|
I may be wrong, but isn't the code for the Dependency Walker part of the examples shipped with Visual Studio?
Regards,
Alvaro
There are no stupid questions, but there are a lot of inquisitive idiots. -- despair.com
|
|
|
|
|
As far as I know - no...
I also looked for it on MSDN and couldn't find it.
Any other ideas? :-/
|
|
|
|
|
find some articles about the PE file format(it's the file format of exe and dll ... files).
i found a very nice tutorial at http://spiff.tripnet.se/~iczelion/tutorials.html
have a look at these tutorials, then u just have to code
have fun
|
|
|
|
|
Hey all,
I want to get a list of exported DLL functions from a DLL (like Dependency Walker does) - along with each function's entry point.
How do I do that?
Thanks!
|
|
|
|
|
Hello there
I would like to be able to open files from the left frames (I use Windows Explorer's TreeView style and a RichEditView app)
How could people open files from the tree when they double-click it?
Or how could I create a permanent (not included in each new window) tree control that could be used to open files faster?
|
|
|
|
|
Your question has more to do with design than technique. One solution is add a double mouseclick handler for the tree control. Open the file if applicable.
Kuphryn
|
|
|
|
|
Use a dialog bar for the tree (there are many examples around here), and the sole CRichEditView as an MDI child view.
Regards,
BB
|
|
|
|
|
It crashes in afxwin2,. saying for the postmessage that(IsWindow) isnt true.
Here is my code:
void CTrio::OnClose()
{
<code>
m_pParentWnd->PostMessage(UDM_PHOTO_CLOSED,WPARAM(this),0);
}
CDialog::OnClose();
DestroyWindow();
}
If I add the commented out if., it never goes into it to post.
AFXWIN_INLINE BOOL CWnd::PostMessage(UINT message, WPARAM wParam, LPARAM lParam)
{ ASSERT(::IsWindow(m_hWnd)); return ::PostMessage(m_hWnd, message, wParam, lParam); }
#
Appreciate your help,
ns
|
|
|
|
|
You have your "if (IsWindow" line commented out.
Regards.
Alvaro
There are no stupid questions, but there are a lot of inquisitive idiots. -- despair.com
|
|
|
|
|
I know....but if I put the if in, the messgae NEVER gets posted!! I need to post it!
Appreciate your help,
ns
yet I've posted to the parent successfully with the same pointer elsewhere.....
|
|
|
|
|
Is your parent window still around at this point? If so, use the debugger to check that the value of your member variable is still valid. Perhaps it's getting changed somewhere.
Also, if your parent is going away before the dialog box, and that's OK with you, you may consider moving the code in your message handler to the dialog's class. Another option is to write code in the parent window to close the dialog box before going away.
Regards,
Alvaro
There are no stupid questions, but there are a lot of inquisitive idiots. -- despair.com
|
|
|
|
|
My parent is not going away at all!!!! not before and not after! I'll check the debugger. Thanks.
Appreciate your help,
ns
|
|
|
|
|
This is bizaare, but I had so many classes where I used the parentWnd that in this one I didnt even retrieve it from the CReate() function where it came in as a 'this'. Fine. I see my carelessness that the debugger promptly showed me (thanks A M )
BUT my code compiled with this m_pPArentWnd variable being used but never declared anywhere in the class!!!! I checked several times but I do NOT have an m_pParentWnd defined in this class!!!
Appreciate your help,
ns
|
|
|
|
|
m_pParentWnd is a protected member of the CDialog class. Any class derived from CDialog will have access to this member variable.
See file AfxWin.h line 2639.
HTH
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks!!! I was really puzzled, and when I looked inb MSDN under CWNd there was no such member. Guess I should have searched for it in the MFC folder....
Appreciate your help,
ns
|
|
|
|
|
ns,
I recommend you get acquainted with the F12 key. It takes you to where things are defined. If you had put the cursor on the variable and pressed F12, it would have taken you straight to where it's defined inside the CWnd source code!
All that's required is for you to add "Browse Info" to the project, which it will prompt you to do the first time you press F12. It's a really handy shortcut -- it's also part of the "right-click" menu.
Regards,
Alvaro
There are no stupid questions, but there are a lot of inquisitive idiots. -- despair.com
|
|
|
|
|
I didnt know about F12! Many thanks!
Appreciate your help,
ns
|
|
|
|
|
Hi guys,
I have a dialog with a slider control. I can use ON_WM_HSCROLL() and the OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) function to catch my slider. But what can I do if a have more than one slider?
I think that the fourth parameter "CScrollBar* pScrollBar" is supposed to be used to identify witch slider has been used. But i dont know how to used it?
help me please.
Regards
Everything's beautiful if you look at it long enough...
|
|
|
|