|
I don't think b is incorrect.
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.
|
|
|
|
|
B is incorrect because double Grade is a declaration not an expression. This is a fine point of the language and not something I'd expect to show up in a beginner's book.
A is valid syntax, you don't have to initialize the entire array, and any extra elements will be initialized to zero. However, it is not an expression either.
C is not a valid expression because it's not even valid syntax.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
> A is valid syntax, you don't have to initialize the entire array, and any extra elements will be initialized to zero. However, it is not an expression either.
Would you expand on that a little further please
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
An expression is something that has a value. While "x = 100" might look like an assignment *statement*, it's actually an expression since it has a value that you can assign to another variable. When you write "a = b = 42", this is not just a special idiom of C++ syntax. "b = 42" is an expression that has the value 42 which then gets assigned to a i.e. "a = (b = 42)"
Mike's right - it's a very fine point
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.3 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Any suggestions on how to handle multiple developers concurrently working on the same .rc file (although on different dialogs)?
The problem as we all know has to do with resource ids getting munged. I'd prefer to not have to distribute our resources among different resource DLLs. We're using VC6 but plan to switch to VC7 (but stay with MFC) soon.
Thanks for any words of wisdom!
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
The simple answer unfortunately is don't use the VS editor. If you must, manage your resource IDs yourself. You can enter '=number' after a resource identifier in the resource editor to assign that number to the resource ID. You could consider using a small number of general IDs for general resources (perhaps Print buttons), then allocate a block of resource IDs to each dialog.
|
|
|
|
|
Thanks for your reply, Mike!
I'm aware of custom id assignment, and feel the process of reserving resource ids for different groups of controls is error-prone at best. I'm tempted to write a "resource id renumberer" that would be run prior to merging a checked in resource.h. It could also be run on-demand at any time to guarantee unique ids. But what a pain.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
October 18, 2003
Re: Microsoft Knowledge Base Article - 174942
"File Modified Outside Source Editor" Warning Message
I believe I have discovered a cause of this warning in a specific situation. I encountered this message while using Microsoft Visual C++ .NET. The message box appears after the “Build Solution” command is complete, following editing of a source file using the native .NET editor.
In this case, the project and source files were stored on a network file server. A tape backup job was running at the time on the file server when I encountered the warning. I moved the project and source files to the local hard drive on the workstation and didn’t get the error message. I moved the project and source files back to the file server after the tape backup job completed and didn’t get the warning then either.
Under Microsoft Visual C++ .NET, the window title is Microsoft Development Environment. The window displays the full path file name followed by the following message:
This file has been modified outside of the source editor.
Do you want to reload it?
The command buttons are: Yes, Yes to All, No, No to All.
The bottom line is that Visual Studio .NET may erroneously detect that a file has been modified outside of the source editor, in situations when there is a delay between the time the file is saved and when it is actually written to the network drive.
Carl Owenby
|
|
|
|
|
Hi all
How can i create a peer-2-peer direct connection using CSocket?
is there any way without using CSocket::Listen() ?
and another small think: what will happen if I'll try to listen to other procces's port?
thanks
|
|
|
|
|
hmmmm... please more precisly!
are u server, or client?
what do u mean with
lpRomang wrote:
other procces's port?
Don't try it, just do it!
|
|
|
|
|
Well, you can create a p2p connection by specifying to the CSocket object the IP address that you want to connect to. If you are listening to other port that you won't use, it will be listening all time for nothing.
Hope it helped.
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.
|
|
|
|
|
thanks to the people thar reply my outher message.
sorry i have posted a exe file, i know that you will not runit, so i have posted a zip this time.
here it is, a piece of code that i cant get to work.
is there anyone that can spend 5 min with this and tell what is not correct?
Test Project:
http://www.xwega.com/toolbartest.zip[^]
this is a simple sdi app made with the wiz.
i have only added the menu "test" and the toolbar buttons
I have created the menu event handlers
the problem is that the menuitem "Ball" can be disable but the button "ball" with the same id is allways enable.
there is code to enable and disable the menu and toolbar button on the menu event handlers.
what is incorrect?
MSN:maxsnts@hotmail.com
|
|
|
|
|
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
|
|
|
|