|
I think you've performed the necessary steps. Is the menu item enabled or it remains grayed?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Ofcourse it is enabled!!!!
|
|
|
|
|
Go into the class wizard for the view class, click on the ID_FILELISTEN item and then tell me if COMMAND or UPDATE_COMMAND_UI is in bold ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Yes COMMAND is in bold...with the Member function
OnFileListen (ON_ID_FILE_LISTEN:COMMAND)
|
|
|
|
|
Then there is no reason in the world for it not to work. Have you done any manual editing to the files in the command handler area EVER ? Because if you have, it's possible you've confused the Class Wizard. What references to ID_FILE_LISTEN are there in the .h and .cpp file ?
Oh, it's generally good not to ask the same question over and over, especially when two people are already helping you.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
I am sorry, but this is really annoying. Apparently I've done everything right.
I had to implement it in a real project, but since it was creating complications, I tried this on an empty (new) project.
I just created a new project, added an item to the menu bar, then used the Class wizard to create a message handling function. Inside the function that the Class wizard created, I just added one line
AfxMessageBox("Code Reachable");
That's it!
But it just does not seem to work!
|
|
|
|
|
I understand what you've done, I want to know if you search all files for the ID_FILE_LISTEN, what comes up. You should have al ine like this in the header:
afx_msg void OnFileListen();
and in your .cpp file
BEGIN_MESSAGE_MAP(CMyView, CView)
ON_COMMAND(ID_FILE_LISTEN, OnFileListen)
END_MESSAGE_MAP()
These are what links the message to the command, are they there ?
As to being frustrated, I can appreciate that, but I'm right here trying to help, and Tomasz also seems to be online, so there is no reason to keep asking while you wait for our replies, it only clogs up the forum with the same question over and over. If I ask a question and don't get an answer, I usually wait at least a day to ask again.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Ok I searched all the files for ID_FILE_LISTEN
Here is what I got
Searching for 'ID_FILE_LISTEN'...
C:\Sockets Programming\111\111.rc(82): MENUITEM "Listen Port", ID_FILE_LISTEN
C:\Sockets Programming\111\111View.cpp(23): ON_COMMAND(ID_FILE_LISTEN, OnFileListen)
C:\Sockets Programming\111\resource.h(5):#define ID_FILE_LISTEN 0
3 occurrence(s) have been found.
Then I searched all the files for OnFileListen and here is what I got
Searching for 'OnFileListen'...
C:\Sockets Programming\111\111View.cpp(23): ON_COMMAND(ID_FILE_LISTEN, OnFileListen)
C:\Sockets Programming\111\111View.cpp(105):void CMy111View::OnFileListen()
C:\Sockets Programming\111\111View.h(51): afx_msg void OnFileListen();
3 occurrence(s) have been found.
|
|
|
|
|
I think I may have it. Is your app an MDI application ? Because if it is, you need to click File:New in order to have an instance of your view class to execute.
Have you tried putting a breakpoint in your message handler and tracing to see if it somehow gets there but fails to show a dialog ?
Apart from that, I'd be overriding WM_COMMAND and doing something like this
if (LOWORD(wParam)== ID_FILE_LISTEN)
{
AfxMessageBox("You clicked ID_FILE_LISTEN");
}
I'd also try adding the handler to the CMainFrame class, or adding them for other handlers not in the ID_FILE_ domain, just to try and narrow down where it's going wrong.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
I think I know the problem.
Change the menu ID to something nonzero (in C:\Sockets Programming\111\resource.h(5))
#define ID_FILE_LISTEN 32771
Hope this helps.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
How do you know my project is in c:\Sockets Programming\111???
|
|
|
|
|
Because you posted it when you posted the results of your search.
He's right, I should have looked closer at the post, but I wasn't thinking along those lines.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
How can i detect and count two blank circles on a bitmap?
My project is to mark quiz MCQs.
|
|
|
|
|
What form do your bitmaps take - have they been scanned ? What does MCQ stand for ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
MCQ = Multiple Choice Questions
|
|
|
|
|
I'm in the process of developing an application that has two dialog windows open at one time.
I would like to update both of these windows every x seconds, but can only seem to do this when the user clicks a button.
Any idea on how I might get this to update without intervention from the user?
Later I'm going to add in a socket and get data from there to update the windows.
Thanks for any help
|
|
|
|
|
|
Are you using MFC?
Is this a dialog-based application, or does it have a parent froame window (SDI/MDI)?
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
If you are using a MDI or SDI application you can use the Run function. Stopping every x seconds.
If you are in a Dialog App, you can use the SetTimer function....
Best Regards...
Chau!!!
Carlos Antollini.
|
|
|
|
|
Thanks for the replies.
I just finished trying the Timer function and now I see that is what you reccomended. So I guess I'm on the right track.
No we'll see if I can do some communication with another computer and display this info in both dialog boxes.
Thanks again,
Jim
|
|
|
|
|
Has anyone had any experience creating hands or fingers in OpenGL? My plan of attack so far is to user 3 cylinders for each finger and work it out from there. I'm still relatively new to OpenGL so I'm finding this task a little daunting... any ideas?
|
|
|
|
|
first sorry for my poor english.
I use the Visual C++ 6.0 in win2000 server(not installed the win2000 platform SDK) to develope application.Today when a complier a application that use some API function only run under win2000.I get a complier error:
Linking...
SetTransPlusDlg.obj : error LNK2001: unresolved external symbol __imp__SetLayeredWindowAttributes@16
Release/SetTransPlus.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
It seemed that i have not the correlative lib file.somebody told me that i need to install the win2000 SDK in my computer to let the visual c++ support this function.My internet connection speed is slowly and don't want to download the SDK (250M).
fortunate,i have installed the visul studio.NET(beta 2)in my computer,I think the Visual Stuido.NET should included these lib file.
how i use these lib file in my visual C++?
thanks
|
|
|
|
|
You're right that .Net will have it, but the problem is noyt a lib file, it's that you've not installed a new Platform SDK. As Windows 200 was released after VC6, you need to download a new platform SDK in order to include the headers for any commands new to W2000.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Hi,
I want to develop and ActiveX control with some standard controls ( or maybe if possible with a cooler look ), but It seems to be very hard to disable buttons and such things with ATL ( sending the message, instead of getting the controls and...).
Can anybody help me on that ?, Thanks, Bye
Braulio
|
|
|
|
|
I was wondering how I go about changing the background color of a View in a WTL application. I have a handler to WM_ERASEBKGND and my code breaks into the OnEraseBkgnd function but it seems that the code is just ignored.
LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
CBrush br;
CClientDC dc(m_hWnd);
br.CreateSolidBrush(RGB(30,30,30));
CRect rect;
GetClientRect(rect); // Using this because
//dc.GetClipBox(rect); // this usually comes back empty.
dc.PatBlt(rect.left, rect.top, rect.Width(),
rect.Height(), PATCOPY);
bHandled = true;
return 0;
}
Cheers,
Clint
|
|
|
|