My colleague Pavlo always in a hurry.
Next code is really what you need.
I supposed, that str is AnsiString, and it contains
something like this:
2:00:00 PM
//-------------------------------
for(int x = 1;x <= str.Length();x++)
if(str[x] == ':' ||
str[x] == ' ')...
I supposed, that the program name is "Test", then next code will not allow to execute second instance of the program "Test".
//----------------------------------------------------------static int runing = 0;
//----------------------------------------------------------bool...
The only way (I suppose):
//--------------------------------------------------
void deleteItems()
{
int* sel = new int[ListBox1->Items->Count];
int j = 0;
for(int k = 0;k < ListBox1->Items->Count;k++)
if(ListBox1->Selected[k])
sel[j++] = k;
while(j)...
#include <dos.h>
long delay = 500; // 5 sec.,delay in hundred of second
struct time oldt;
struct time newt;
gettime(&oldt);
for(;;)
{
gettime(&newt);
long t = (newt.ti_hund-oldt.ti_hund) +
100*(newt.ti_sec - oldt.ti_sec) +
6000*(newt.ti_min - oldt.ti_min)...
another example:
var.h:
//---------------------------
#ifndef __MY_VAR__ // It's very important!
#define __MY_VAR__
int myFirstVar;
// etc
// etc
#endif
//---------------------------
other forms:
man.cpp: // for example
//---------------------------
#include "var.h"
// the body...
in xxxx.h:
//----------------------------------------------------------
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER (WM_ENDSESSION,TWMEndSession,WndProc);
END_MESSAGE_MAP(TForm);
//----------------------------------------------------------
in xxxx.cpp...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.