|
Rejeesh.T.S:
How window can receive mouse messages from a control? It does not. If you want to handle control’s messages, you have to subclass it.
JohnCz
MS C++ MVP
modified on Friday, November 27, 2009 3:24 AM
|
|
|
|
|
How window can receive mouse messages from a control? It does not. If you want to handle control’s messages, you have to subclass it.
JohnCz
MS C++ MVP
|
|
|
|
|
CODE:
int k = 35;
printf( "%d %d %d", k == 35, k = 50, k > 40 );
When i compiled same code in Turbo C++ then its giving output as:
0 50 0
and in Microsoft VC++ its giving output as:
0 50 1
Can anyone tell me why there is difference in outputs when i change the compiler?
Thanks
Nilesh
http://nnhamane.googlepages.com/
|
|
|
|
|
Different compilers might -and will- interpret the code differently, don't be surprised at this because either some compilers follow standards, some don't, ot they interpret them differently, or the standard itself does not specify every possible aspect of a given problem so the guys making the compiler are free to handle it as they see fit. Based on your code sniplet, i'd say that the Turbo C version will "run" from right to left, so:
k > 40 -> 0, since k is at this point 35 which is less than 40
k = 50 -> 50, since k is 50
k == 35 -> 0, sinke k is 50 which is not 35
While the MS compiler is probably doing it in this order:
k = 50 -> 50, makes k 50 at first
k == 35 -> 0, since k is 50, not 35
k > 40 -> 1 since k is 50 which is greater than 40
There might be other explanations too i guess.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Thanks Code-o-mat for your explanation. But it means that there are no standard rules for compilers to interpret the code. Am i correct?
http://nnhamane.googlepages.com/
|
|
|
|
|
Well, there!s the ANSI C Standard[^] that i know of, but as said, some things the standard specifies as "undefined", which means -as i said- that different compilers might and will behave differently in case they "meet" something the standard does not clearly have an "oppinion" about. Your best bet to avoid such problems is to try and write code that avoids these and write "obvious" code. For example, depending on what you need you could do:
...
k = 50;
printf("%d, %d, %d", k == 35, k, k > 40);
or
int a = (k == 35);
k = 50;
int b = k;
int c = (k > 40);
printf("%d, %d, %d", a, b, c);
and so on...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Correct. There are holes in the definition of the C language. IIRC the official specification even holds an appendix with issues that the compiler designer has to solve, and has to publish how he did solve them. One of those issues is the order in which side effects may occur, e.g. does i=i++; modify i or not?
Your defense against such things is very easy:
1) don't create statements that are ambiguous. In your example, split the line in a couple of lines and use temporary variables, so the parameters get evaluated in the order you choose.
2) or switch to an unambiguous language, such as Java and C#
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hi,
I am using NOTIFYICONDATA.szInfo in order to display a baloon tooltip when my tray-based application starts. The balloon has a "x"-button in it's upper right corner, so the user can close the message. If he doesn't, the balloon tip is being displayed all the time.
Which message do I have to send if I want to close the balloon tooltip automatically after a few seconds, for example by using a timer?
|
|
|
|
|
Just the message to hide a window (SW_HIDE if i'm correct)
Rozis
|
|
|
|
|
you can use the uTimeout memeber of the NOTIFYICONDATA structure to specify the timeout value.
|
|
|
|
|
Hello,
is there a guide how to isntall the latest Platform SDK that is compatible with Visual Studio 6.0 under XP SP3? I have read that te latest SDK compatible with this package is the Windows Server 2003 SDK, which I downloaded right from here: [^]
The download itself is a pain in the ass, since it's not a ZIP package or something comfrotable you would expect, but 15 single files to download.
The next step is that the setup.exe you get after extracting starts your browser, which is Firefox in my case, telling me that IE 5.0 or later is required. So I try to run default.html manually in IE 8.0 (which is installed on my plattform), but as soon as I click "install Core SDK", IE crashes, and tells me the Active X is not secure (although I explicitly allowed it).
Is there some guideline on how to install this SDK properly? Why can't MS make it simple as nearly every other software company?
|
|
|
|
|
The Platform SDK you choose does not depend on your version of Visual Studio but your Platform (Win2000 , XP 32/64 , Vista ...).
However I wonder what you have downloaded. 15 single files? I don't know such distribution.
I recommend you to install the latest SDK which can be downloaded here:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc
You have the choice between the web installer and downloading a full ISO (1.3GB).
Installing one of those is as simple as downloading and installing any other software. It has never been more complicated.
Compatibilty with different versions of Visual Studio is related to the help system integration into that versions. You do not need this necessarily since the help is included as standalone. Header files and libraries should be compatible to the compiler version included in Visual Studio 6. Correct me if I am wrong.
I further recommend switching to a newer version of Visual Studio if possible. The C++ Express Edition should be ok for most applications. The only thing is that there is no MFC included. Even the Standard Edition isn't too expensive.
|
|
|
|
|
Stefan76 wrote: The Platform SDK you choose does not depend on your version of Visual Studio but your Platform (Win2000 , XP 32/64 , Vista ...).
Incorrect.
Stefan76 wrote: Correct me if I am wrong
You're wrong.
|
|
|
|
|
Stefan76 wrote: The Platform SDK you choose does not depend on your version of Visual Studio but your Platform (Win2000 , XP 32/64 , Vista ...).
Wrong and misleading. You have no idea of what Platform SDK is, and you may please refrain from answering queries that you don't know anything about.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi Rajesh
Please can you give me an example how the choice of the Platform SDK depends on the compiler suite you are using?
As I understand it the Platform SDK is basically a collection of headers, libraries and API documentation you need to build applications targeted to the platform you use. The compiler you use to build your stuff is subordinate may it be Visual Studio or Borland or whatever.
|
|
|
|
|
Hi Stefan,
From your original reply to the OP: The Platform SDK you choose does not depend on your version of Visual Studio but your Platform (Win2000 , XP 32/64 , Vista ...).
However I wonder what you have downloaded. 15 single files? I don't know such distribution.
I recommend you to install the latest SDK which can be downloaded here:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc
The OP clearly mentioned that he needs an SDK for VS 6.0 and the latest version of the SDK that is compatible with VS 6.0 is Windows Server 2003 Platform SDK (February 2003 edition)[^]. For information on this, read the "Development Toools" section under the "System Requirements" Heading on this page[^]. You linked him to the latest PSDK, which is plainly wrong.
From your original reply to the OP: The Platform SDK you choose does not depend on your version of Visual Studio but your Platform (Win2000 , XP 32/64 , Vista ...)
Stefan76 wrote: Please can you give me an example how the choice of the Platform SDK depends on the compiler suite you are using?
VS comes with an SDK. The OS and the Platform SDK are two different things, even though to use certain new features/API calls you may need a new SDK.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
The SDK you downloaded is the correct one for VS6.
I didn't have any problem installing it with IE6 on XPSP3. I suppose your problem is IE8.
|
|
|
|
|
I believe you are right, the problem seems to be IE8, the question is why this setup requires a browser at all. The MSIs are all available in the subdirs, the question is which ones to install in which order.
I really don't understand why Microsoft is doing it this way, it's crap. Why not make a simple setup without requiring a browser?
|
|
|
|
|
how to make winapi control "edit" transparent? thank you
|
|
|
|
|
Is this a question or a boast?
|
|
|
|
|
The question is not clear.
I'm assuming that you have a Win32 application and you have placed an edit control in the dialog template.
Now you want to apply the transparent style to this edit control.
If this is your question, here is my answer -
Use GetDlgItem to get a handle to the edit control.
Use SetWindowLongPtr(hEdit, GWL_EXSTYLE, WS_EX_TRANSPARENT) to apply the transparent style.
|
|
|
|
|
|
pDC->SetTextColor(m_pLinesColor[i]);
pDC->TextOut(m_tempLT.x, m_tempLT.y-8, _T(m_pLinesName[i]));
why is not the setting color "m_pLinesColor[i]" in the print preview??
|
|
|
|
|
Have you tried to create a font, change the colour of the font attribute and use the pDC->SelectObject (&Font) instead of the pDC->SetTextColor ??
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hello people,I've installed Borlands' 5.0 C++
on a Windows ME machine running on a Vmware virtual disk.
The problem I'm having is this,at compile time I cant see the-
-out put of the file when it runs,instead all I see is a DOS like-
-box that briefly flashes on the screen.
I know that,that "box" is the out put,but how can I make it stay
on the screen long enough to see the results?
|
|
|
|