|
IMHO, it is probably a legacy issue where they can't agree on how it should work. Compiler vendor A says "X" while compiler vendor B says "Y". Both want to avoid having to modify their compiler.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
IMHO, it is probably a legacy issue
No offence, but your opinion and facts are disagreeing. The facts carry more weight.
Both C and C++ have the concept of sequence points. These are well-defined. If you modify something twice or more with no sequence point(s) inbetween those modifications, you are invoking implementation-defined behaviour. I.e. there's no way to tell what the outcome will be.
I believe the stated reason it's specified like this (or not specified, depending on how you look at it) is to allow optimizers to do their job by restructuring the code. And, indeed, non-optimized builds often just evaluates the expressions as-is, while an agressive optimizer generates machine code that bears little or no resemblance to the original source code.
|
|
|
|
|
I am doing an MFC program that needs to position some other windows during startup.
But the program starts maximized, however GetWindowRect() returns the non-maximized rect during the processing of WM_CREATE in OnCreate().
I know that SystemParametersInfo() can return the work area, but unfortunately that is not the same as the maximized window rect.
Is there a way to get that rectangle?
Or can you tell me what value(s) are the maximized windows offset by? Some borders on the sides? Which ones?
|
|
|
|
|
If you have no menu, or know that youe menu fits one line (yuck), you can use
GetClientRect
ClientToScreen
AdjustWindowRectEx
You can also use GetWindowPlacement to get the origin of the frame of the maximized window (it will be off-screen for a top level window!) But heed the "Remarks" section of the GetWindowPlacement documentation, and check your app with the taskbar moved to the left, or top!
Those who not hear the music think the dancers are mad. [sighist] [Agile Programming]
|
|
|
|
|
Thanks, but GetWindowPlacement() says that the maximized top-left corner coords are the same as normal position top-left coords
The MSDN page for it also says that the flags member retrieved is always 0, but it's 2 after I call it.. ???
|
|
|
|
|
??
I get sth. like
ptMinPosition = { -6, -25 }
rcNormalPosition = { 241, 417, ... }
(It's an MDI child, and I set wndplacement.flags = WPF_SETMINPOSITION; before I call, but that should not make a difference...)
WINDOWPLACEMENT wpabs;
wpabs.length = sizeof(wpabs);
wpabs.flags = WPF_SETMINPOSITION;
wnd.GetWindowPlacement(&wpabs);
Those who not hear the music think the dancers are mad. [sighist] [Agile Programming]
|
|
|
|
|
Ehh... ptMinPosition is the minimized position(whatever that would be for...), I need the ptMaxPosition, which is the same as rcNormalPositon's topleft corner for me.
|
|
|
|
|
Oops, sorry, that was jst a typo.
IIRC the min position won't be set only when the window is maximized.
What do you need this coordinates for? What kind of window (MDI child, top level)?
Those who not hear the music think the dancers are mad. [sighist] [Agile Programming]
|
|
|
|
|
Anyone got this error ?
Entry point not found
The procedure entry point__lc_collate_cp could not be located in the dynamic link library msvcrt.dll.
Why do I get this error ?
Thank you
|
|
|
|
|
Yes - The CString::Collate* group of functions is somehow not supported by Win95 SR1 and NT4 pre-SP4 systems.
Regards,
BB
|
|
|
|
|
Oh, that makes sense a little since it's a NT 4.0 SP3 and I thank you very much for this. Now, I didn't use any collate function but I did use concatenation functions and operators (especially +=) so I guess concatenation operators aren't supported either. So, I'll have to use char* ? This sucks.
Thank you anyway !
|
|
|
|
|
Link statically. The problem will go away, forever.
|
|
|
|
|
Suppose I have a shortcut named "ABC" (let's say its object is "C:\Program Files\foo\bar.exe", which is not known at coding time), how do you get this shortcut's object path and name in your C++ code? Thanks.
|
|
|
|
|
I you do not mind COM, you could use IShellLink
|
|
|
|
|
Hi All,
I'm trying to do simple aplication to read data from the serial port and put it into an excel spreadsheet. Acctually I'm not sure about what should I use. I rather use VC++.
Could you give me just some advice to wich way should I go?
Thanks in advance,
Igor Kondrasovas
|
|
|
|
|
hi,
check this link, here the author is converting CSV to excel this might be of some help to u..
http://www.codeguru.com/mfc_database/CSpreadSheet.html
cheers..
Himanshu
|
|
|
|
|
You can find an easy start to Excel and ODBC here. Have a look!
|
|
|
|
|
The easiest would probably be an Excel VBScript "macro" using the MSComm object for reading from serial device. (It's amazing how much you can do in this crude language/environment...)
Another option would be generating a .csv file (Comma-separated Values), which excel tends to open nicely (if lannguage settings are correct)
Those who not hear the music think the dancers are mad. [sighist] [Agile Programming]
|
|
|
|
|
1.) CP has some great serial comm tutorials / classes / articles.
2.) you definately either want to write a dll or COM application and export your functions / interfaces for vb to use.
- I did something similar, i created a data aquisition application in VBA (Excel) that uses a dll i wrote in straight c. The dll is a socket client that connects to intelligent hardware and collects data. I had to reformat the data in the DLL so I could export it to excel, which was a bitch, but in the end it worked perfectly. You should have no trouble what so ever. If your going the DLL route, be sure to look into IDL.
Ryan Baillargeon
|
|
|
|
|
Is it possible to use MSComm object on .NET? I tried to convert an app from VB6 to .NET and I got erros, because the component could not be located...
Cheers
Igor
|
|
|
|
|
As it's a fairly "vanilla" COM object, it should work perfectly (just make sure it's registered on the system, and you added a reference to it to the project). I haven't tried it, though.
However, under .NET should be "more native" methods to talk to the serial port. No idea which, but would probably be worth doing (if you care about performance, or want to get rid of the mscomm.dll dependency)
Those who not hear the music think the dancers are mad. [sighist] [Agile Programming]
|
|
|
|
|
hi . i am searching for a Simple code to Show an Animated Gif in a Dialog Based Program or in a SDI project.
can anyone help me ?
regards.
-=Ehsan-de-Burge=-
|
|
|
|
|
thanx for your responses
|
|
|
|
|
dear all,
whenever i try to debug my vc 6 applications in windows Xp, i always get an error in MSDEV.exe (memory not read..)
why is it happening.
I can debug my applications in windows 98 and windows me .
why is it happenning!
any lights!!!!!!!!!!
thanx,
|
|
|
|
|
What SP release do you use? With my XP everything worked fine with SP4, and after applying SP5, msdev started to crash from time to time - but rather at compile time than during debug.
Regards,
BB
|
|
|
|