|
Thank you for your help
QMuffs
|
|
|
|
|
All documented SC_ values (wParam of WM_SYSCOMMAND) have zeros in the lowest 4 bits. But I sometimes receive this message with lowest four bits of wParam set to 0x2. For example when I doubleclick the caption of an MDI child window, I SOMETIMES receive 0xf122 instead of 0xf120 (SC_RESTORE). May I consider these values valid system commands ?
Is that behavior ever platform independent ?
|
|
|
|
|
Windows sends data internally in the fields that you are not supposed to use. So I would consider it valid.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
|
Hi Guys,
I want to write text to a text file in a specific format ast follows:
Exchange Result
-------- ---------
FOREX 1
NASDAQ 0
LSE 1
Basically I want to write text in 2 columns the setting the width of each column
Any ideas appreciated
|
|
|
|
|
printf("%s\t%d\n", string, value); ???
Is there an environment variable about the TAB so that you can set it, to make sure the second column start at a specifed place?
|
|
|
|
|
Interpretation of the TAB character depends on the program used to view the output. Using spaces is better, but even then the file must be viewed using a constant-width font (e.g. Courier) to see the columns correctly.
|
|
|
|
|
Thanks Lucy
I will give the printf a shot
I am not sure off the top of my head about the environment variable thing but I can do a bit of digging on this.
Cheers
Xtorpia;)
|
|
|
|
|
Another option would be to specify widths
"%-20s %d"
That would left justify the string and space fill to 20 characters.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
iostream s were designed just for this kind of stuff. The following is hopefully self-explanatory:
#include <iostream>
#include <iomanip>
using namespace std;
static void stock_row(const char *exchange,int result)
{
cout<<setw(10)<<left<<exchange<<setw(6)<<right<<result<<endl;
}
int main(void)
{
stock_row("FOREX",1);
stock_row("NASDAQ",0);
stock_row("LSE",1);
return 0;
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks Joaquín,
This looks like a pretty good solution for wjat I want.
Cheers
Xtorpia;)
|
|
|
|
|
Hi,
We have an big ugly monolitic project, that takes a big while to compile ( and just some minutes to link), and we don´t have time to chop it now in smaller pieces .
But... we have a lot of free computers, my question is... It´s possible to tell Visual Studio to compile some files in one computer, some other in another... ( for example, from A to F, from F to T, from T to Z...) ? ( the the charge is distributed and it would compile it all in parallel).
Is it possible ? Thanks in advance, greetings
Braulio
|
|
|
|
|
|
Braulio Díez wrote:
my question is... It´s possible to tell Visual Studio to compile some files in one computer, some other in another
Not that I am aware of, but you might be able to manually have multiple systems (each running a copy of DS) building separate parts of the project. You would just have to watch out for dependencies, and make sure all computers are in time-sync.
As a small suggestion, is your project correctly using pre-compiled headers?
Peace!
-=- James.
(Try Check Favorites Sometime!)
|
|
|
|
|
Hi,
It´s a pity, I think it´s a problem that more than one company have had to face off... The main problem from our project is that it contains 350-400 files ( it began long time ago..., and like all the things, it was not thought that it would go so far ).
I think we make a good use of precompiled header, the problem comes when we touch some ".H" files, then VStudio has to recompile it all, and that's a pain in the ass... ( you can see A...B...C..... .... .... .... ... ... Z).
Thanks for your help
Braulio
|
|
|
|
|
Hi,
I have two variables of SYSTEMTIME.. how can i check
their difference.. actually i want to check whether
they have a difference of 2 seconds or not
Sameer
|
|
|
|
|
If you're using MFC you can create two CTime objects from your SYSTEMTIME s, subtract the other from the first and use CTimeSpan::GetTotalSeconds()
|
|
|
|
|
I have used 2 FILETIME objects like this before with the function:
FILETIME current_time ;
FILETIME start ;
::GetSystemTimeAsFileTime(&start) ;
Sleep(100) ;
::GetSystemTimeAsFileTime(¤t_time) ;
double elapsed = CalculateElapsedTime(&start, & current_time) ;
double CalculateElapsedTime(FILETIME *start, FILETIME *current)
{
double elapsed_time ;
__int64 st ;
__int64 ct ;
__int32 *p ;
p = (__int32*)&st ;
*p++ = start->dwLowDateTime ;
*p = start->dwHighDateTime ;
p = (__int32*)&ct ;
*p++ = current->dwLowDateTime ;
*p = current->dwHighDateTime ;
elapsed_time = (double)(ct - st) ;
elapsed_time /= 10000000.0 ;
return elapsed_time ;
}
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Thanx..
|
|
|
|
|
Hi,
I have made a program to hook WH_CBT. The application is
logging the appl name into a log file,
the problem is that i just want the application
name once, where as hooking this WH_CBT is writting
into the log file the application name, number of
times..
How do i do it so that the application name is written
only once
Sameer
|
|
|
|
|
void logAppName()
{
static bool appAlreadyLogged=false;
if(appAlreadyLogged) return;
...
appAlreadyLogged=true;
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
This won't do bcoz, everytime the applcation name
changes
|
|
|
|
|
void logAppName(const char* appName)
{
static std::set<std::string> appsLogged;
if(appsLogged.insert(appName).second==false)return;
...
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi All!
I used CInterSession::OpenURL() to open a TIFF file URL. Then, I used CHttpFile::Read() function to read the TIFF file into a local heap buffer.
About on 100 machines(95/98/NT/XP) it works fine. But on 2 machines (one is windows95 & another windows NT workstn) the Read() returns after just reading the first 263 bytes. What could be the problem??
I checked WININET.DLL versions. On other machines with the same DLL versions, same OS, same SP it works fine. But not on these 2 machines. Its bugging me. Can anybody help please...
|
|
|
|
|
It is ok, you cannot expect to read all the file in one shot. Think that you have a 1Gb file to download
Actually you need to keep reading from file untill the buffer returned is empty. Ammount of bytes read in single operation depends on OS, Connection and settings somewhere in Registry.
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|