|
Have you tried calling
DWORD flags = SWP_NOACTIVATE | SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER;
SetWindowPos( editHwnd, NULL, 0, 0, 0, 0, flags );
I know that the only way to get certain window style settings to take effect is to call SetWindowPos() like this. Hope this helps!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Hi, and thanks for the reply. I didn't mention in my parent post, but I DID already have that code at the bottom of my function. I needed it to display the HSCROLL appearing or disappearing, but it does not help with the problem of word wrapping.
|
|
|
|
|
I copied my project from a Windows 2000 PC to a Windows XP PC, but now I get a load of compile erros and I a completely at a loss to why
Visual Studio 7.1 is installed on both PCs.
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1553): error C2059: syntax error : ')'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1560): error C2059: syntax error : ')'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1633): error C2059: syntax error : ')'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1640): error C2059: syntax error : ')'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1647): error C2059: syntax error : ')'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1655): error C2059: syntax error : ')'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1671): error C2059: syntax error : ')'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinNT.h(340): error C2143: syntax error : missing ';' before '*'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinDef.h(204): error C2143: syntax error : missing ';' before '*'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinDef.h(205): error C2143: syntax error : missing ';' before '*'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1620): error C2143: syntax error : missing ';' before '__stdcall'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1628): error C2143: syntax error : missing ';' before '__stdcall'
Does anyone know the cause of these errors, they have been no code changes.
grahamfff
|
|
|
|
|
The problem is plainly in the Windows SDK, perhaps you had a different SDK installed on one machine ? Either way, have you looked at the lines being complained about ? How about the project settings, are they unchanged ? The code that's blowing up shouldn't be, but it's not your code, either way. Having said that, the C++ compiler can report some weird errors, relative to what the real problem is...
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I had this happen at work. It "appeared" that the header was screwed up. In the end it got written up to a bad hard drive, which eventually got replaced, and later on I got a new system out of it! 3 cheers for MS!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Grahamfff wrote:
CodeProjectForum problems or suggestions?
I copied my project from a Windows 2000 PC to a Windows XP PC, but now I get a load of compile erros and I a completely at a loss to why
Visual Studio 7.1 is installed on both PCs.
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1553): error C2059: syntax error : ')'
...
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1560):
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1628): error C2143: syntax error : missing ';' before '__stdcall'
Hello,
I got the same scenario also when I moved from Win2K to WinXP, and the problem was with old projects that did not define the corresponding preprocessor macros that are generated on a new stdafx.h file, for example: (I'm not sure which one of the #defines fixed my problem)
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later.
#endif
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#define _AFX_ALL_WARNINGS
Look on Using the Windows Headers[^] in the MSDN docs.
Hope this solves your problem.
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
The last thing I did on my Windows 2000 PC was to clean the project.
I have tried the above but still no luck.
This is mad, projects should be movable between PC's and Windows versions.
Completely
grahamfff
|
|
|
|
|
I am having trouble converting double to char. The number can be 15 digits in length with
maximum of 5 decimal precision or minimum 0. Tried using sprintf/ltoa but it gives some
wierd results.
sprintf when used in this format sprintf(buffer,"%.5f",dNum); works fine if there are 10
digits to the left of the decimal. For digits >10 to the left of decimal i.e 11,12,13 the results are incorrect.
Code Snippet:
char buffer[20];
CString csTest;
dNum = 99999999999.999;
sprintf(buffer,"%.5f",dNum);
csTest.Format(_T("%.5f"),dNum);
Test cases with 11 digits to the left
INPUT (dNUM) OUTPUT
99999999999.99999 9999999999.99999
99999999999.9999 99999999999.99989
99999999999.999 99999999999.99899
99999999999.99 99999999999.99001
99999999999.9 99999999999.89999
I tried using the CStrings' Format function but I get the same result as that function also inherently uses sprintf.
|
|
|
|
|
|
That sounds so zen.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
I take it that you actually want to pad the the number with trailing 0's.
Here's 1 method:
// test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <conio.h>
int _tmain(int argc, _TCHAR* argv[])
{
char buffer[64];
char Format[32];
double dNum = 99999999999.0;
int MaxPrecision = 5;
int Precision;
double Divisor = 10.0;
for(Precision = 0; Precision <= 5; Precision++)
{
sprintf(Format, "%%.%uf", Precision);
int CharCount = sprintf(buffer, Format, dNum);
if(CharCount >= 0)
{
int i;
if(!strchr(buffer, '.'))
{
buffer[CharCount] = '.';
CharCount++;
}
for(i = 0; i < MaxPrecision - Precision; i++)
buffer[CharCount + i] = '0';
buffer[CharCount + i] = 0;
}
printf("%s\n", buffer);
dNum = dNum + (9 / Divisor);
Divisor *= 10;
}
getch();
return 0;
}
|
|
|
|
|
Sorry, I misinterpreted your question in my previous reply.
The short answer is that you have exceeded the floating point (or is it printf?) library precision by using 11 + 5 digits (excluding the decimal point).
This example may help you understand what is going on:
// test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <conio.h> // for getch()
int _tmain(int argc, _TCHAR* argv[])
{
char buffer[64];
double dNum;
int MaxPrecision = 8;
int Precision;
double Divisor;
long MaxDecimal;
for(double dblNum = 8888; dblNum <= 88888888888; dblNum = dblNum * 10 + 8)
{
for(int CurPrecision = 1; CurPrecision <= MaxPrecision; CurPrecision++)
{
dNum = dblNum;
Divisor = 10.0;
fprintf(stdout, "\nCurrent Precision: %u\n\n", CurPrecision);
for(Precision = 0, MaxDecimal = 0; Precision < CurPrecision; Precision++)
MaxDecimal = MaxDecimal * 10 + 9;
for(Precision = 0; Precision <= CurPrecision; Precision++)
{
int CharCount;
CharCount = sprintf(buffer, "%.*f", CurPrecision, dNum);
fprintf(stdout, "%s\t", buffer);
CharCount = sprintf(buffer, "%.*f", Precision, dNum);
if(CharCount >= 0)
{
int i;
if(!strchr(buffer, '.'))
{
buffer[CharCount] = '.';
CharCount++;
}
for(i = 0; i < CurPrecision - Precision; i++)
buffer[CharCount + i] = '0';
buffer[CharCount + i] = 0;
}
fprintf(stdout, "%s\n", buffer);
dNum = dNum + (9 / Divisor);
Divisor *= 10;
}
}
}
getch();
return 0;
}
If you run the example, you will notice that things become decidedly 'iffy' when you reach the 16 char output limit. The reason the second sprintf statement works better is that it is forcing rounding of the decimal part (so it must be printf that is the culprit), but since your problem states that the maximum number of digits is 15, you should have no problem with these limits.
|
|
|
|
|
Try something like this. I use code very similar to this all the time. NOTE I have not tested the negative double (the insertion of the - sign may need to be adjusted.
void convertMyDoubleToString(double myDouble,int precision,CString& result) const{
char* buffer;
int dec;
int sign;
size_t i;
buffer = _fcvt(myDouble,precision,&dec,&sign);
for (i=strlen(buffer)-1;i>(size_t)sign;i--){
if (i == dec){
buffer[i+1] = buffer[i];
buffer[i] = '.';
break;
}else{
buffer[i+1] = buffer[i];
}
}
result = buffer;
if (myDouble >= 0 && myDouble < 1){
result = CString("0.") + result.Left(result.GetLength()-1);
}else if (myDouble < 0 && res > 1){
result = CString("-0.") + result; //MAY NEED TO ADJUST THIS
}else if (myDouble <= 1){
result = CString("-") + result; //MAY NEED TO ADJUST THIS
}
}
|
|
|
|
|
Try
sprintf(buffer,"%.5lf",dNum);
(remark the l between 5 and f)
SkyWalker
|
|
|
|
|
Is there a way I can find out if a given path is on a drive on the user's PC vs. a remote drive on a LAN. The path could be a UNC, a mapped drive, a local drive or no drive spec. The UNC could still be the local machine.
Suggestions?
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Is PathIsNetworkPath() close? There are other Pathxxx() functions, too.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks David, I didn't think to look at the Shell functions. I'll give this a try.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
I realize its not the stl forum but theres no traffic in there:
I want to get the index of the min element and am doing:
std::vector<int>::iterator start,end, location ;
start = m_distances.begin();
end = m_distances.end();
location = min_element(start,end);
qDebug("%d min val %d %d",*location, *start, *end);
int index = location - start;
but it doesnt work. I always get 181 as the index.
??
Thanks,
sb
|
|
|
|
|
Hi,
has anyone done the above before in C++? I need to do it and don't know where to start...
Thanks,
Pia
|
|
|
|
|
Start by having a look at GDI+. You'll find articles here and at MS.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
There are several articles at http://www.codeproject.com/bitmap/[^] that cover the topic. The most light weight ones being the ones that wrap the IPicture interface.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hey all
My question is how to find a child window!
well, I know that I can use FindWindow("hwndclass", NULL); but how to find a child window of a program? I tried using FindWindow() but it couldn't recognize the child window... is there any way?
thanks in advance
|
|
|
|
|
EnumChildWindows()?
Artificial intelligence is no match for natural
stupidity.
|
|
|
|
|
|
After Using the FindWindow() ,For enumerating Child Window use FindWindowEx() .
if you need,I will Provide you code for Enumerting the Desktop Windows.
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|