|
For date and time use the __DATE__ and __TIME__ macros. Not sure how to help you with USER and MACHINE NAME yet.
Kind regards,
Tim
|
|
|
|
|
I'm looking for some information regarding Memory Resident Databases, sometimes called Main Memory Databases (or MMDB).
I can't seem to find a decent explanation of it. The advantages should be obvious, but I'm looking for some more technical information, e.g. how it can co-operate with RDBMS's, in which environments they're actually used, if they're used merely for single-user systems (one MMDB per user/application) or also for multi-user environments (one MMDB for a small company or workgroup).
I find some references to Angara (www.angara.com) but that company seems to be non-existing anymore.
Anyone tips or references ?
Enjoy life, this is not a rehearsal !!!
My Articles:
- Implementing a Subject/Observer pattern with templates
- Different ways of writing class factories
|
|
|
|
|
i have huge problem in doing this, i tried virtually everithing, does anybody has examplecode??
i can change the icon, but i can not change it to a freely selectable ore selfmade icon. by default the icon wich is assigned in the pCommands->AddNamedCommand method
is a smiley, and has the value 59. when i change this value, i see another icon, but is there a list or something, where i can see, which icon has which ID ??
please help me!
thanx a lot
|
|
|
|
|
Hi!
I am new to c++ and I have a small problem.
I have a text file that I dont know how many lines are in and I want to read each line and put each line in a buffer... Does anyone know how to do this?
I use the ifstream function to read the lines and if I know how many lines are in that text file I can create a buffer for each lines. But the problem is if I have a file with 1000 lines.... what can I do to read each line?
The reason why I want to read each line is that I want to put "" tags on each...
Can anyone help me? Or if there is a webpage about this just give me its address... I'm really confused.
Thank you for your future answers!
|
|
|
|
|
Scolinks wrote:
and if I know how many lines are in that text file
You could just read through it, counting, in a first run and then do the read-in in a second run, after having allocated the memory you would need.
Or simply use containers that C++ offers you:
std::vector < std::string >
You can call push_back()( with every new line, and as long as your file is not larger than the available memory, the container will grow.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I have different descriptions to the same file, such as "c:\tmp\test.dat", "c:\tmp\..\tmp\test.dat" etc - the variations are endless.
What is the easiest way to normalize the paths so that I can compare two or more and determine they refer to the same file?
Note the file may not yet exist.
I thought the Shell API had something but was unsuccessful with my search through MSDN. Anybody to point me to some standaed Win32 API to solve that problem?
TIA,
Bernd
|
|
|
|
|
Does GetFullPathName() do the trick?
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Unfortunately not. GetFullPathName() does what the name suggests, but does not normalize.
Thanks for making an effort anyhow
Bernd
|
|
|
|
|
How about _fullpath() ?
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
How can I clear a file with fstream?
I've opened my file with append flag, so I can't do:
my_fstream.write("", 0);
Bye
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
How can I clear a file with fstream?
I've opened my file with append flag, so I can't do:
Why not just close the file and re-open it with ios::trunc? .... I suppose there is probably a faster way.
-Nick Parker
The true measure of a man is how he treats someone who can do him absolutely no good. - Samuel Johnson
|
|
|
|
|
Nick Parker wrote:
Why not just close the file and re-open it with ios::trunc? .... I suppose there is probably a faster way.
... and better.
I've derived a class from fstream and when my app starts I open a log file and keep that log file opened while my app i running. I don't want to close it during runtime...
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Have you looked at fstream::fd
A file descriptor as returned by a call to the run-time function _open or _sopen. filedesc is a typedef equivalent to int.
Then use it in _chsize( int handle, long size );
I have never tried this, so I don't know if it will work, it is supposed to
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
A C function?
Okay, it's seems that there is no way to do it in C++....
Thank you!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I may be wrong of course. But that is the best I could find, after all fstream does use standard C calls eventuallyt.
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
dear all,
i've an sdk application with a window.
on the WM_QUERYENDSESSION message, a message box pops up.
i 've 2 problems
1) if i make my window hidden (SW_HIDE), all the message boxes are also hidden( fired on WM_QUERYENDSESSION)
so how do i ensure that the message box is visible even if window is hidden.
2) how do i kill the message box say after 5 seconds
thanx and regards
rishabhs
|
|
|
|
|
Try IsWindowVisible(). As for a clock, one solution is a SetTimer. Another solution is a thread, event kernel object, and WaitForSingleObject). Finally, you can implement a timer queue timer.
Kuphryn
|
|
|
|
|
1) Showing message box: Try passing NULL as the handle to the parent window, since if the parent is hidden so are its children. (Refer do help for more info.)
2) Automatic closing of message box: Try
'A thread-safe timed message box' at
http://www.codeproject.com/dialog/msgboxdemo.asp
or search codeproject for other articles.
Trust in the code Luke. Yea right!
|
|
|
|
|
thanx a lot guys
i've passed NULL in the first parameter of MessageBox(..) but still it is invisible
Regards
rishabhs
|
|
|
|
|
// The following is a test that shows how to make the
// message box visable, even if parent is hidden. Both
// the commented and uncommented lines below worked.
// Note: MB_TOPMOST flag.
void CMainFrame::OnTimer(UINT nIDEvent)
{
KillTimer(123);
ShowWindow(SW_HIDE);
//::MessageBox(NULL,_T("Test hide"),_T("Test"),MB_OK|MB_TOPMOST);
MessageBox(_T("Test hide"),_T("Test"),MB_OK|MB_TOPMOST);
ShowWindow(SW_SHOW);
CFrameWnd::OnTimer(nIDEvent);
}
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
if( nType == SIZE_MINIMIZED )
SetTimer(123,1000,NULL);
}
Trust in the code Luke. Yea right!
|
|
|
|
|
Can any one help me in multithreading
I am using the AfxBeginThread() method to initialize thread but I am using it for a single thread at the mement But I want to initiate more threads for my assignment
How can I do it?
Please refer any helping material website or helping sample which can guide me to tackle with more than one threads.
Reply me soon
|
|
|
|
|
|
Hi all
I have the following scenario
typedef struct _STRRET{
UINT uType;
union
{
LPWSTR pol;
UINT uof;
char cStr[MAX_PATH];
}DUMMYUNIONNAME;
}STRRET , *LPSTRRET;
The problem is when i make a variable of type STRRET i couldn't acces the union variables. The following line include the code i wrote
STRRET dispName;
LPWSTR temp;
temp = dispName.DUMMYUNIONNAME.pol;
The compiler gives me compiling error:
C2059 syntax error: '.'
see declaration of _STRRET (which i know very good)
Note: the above struct is a MFC defined type and don't know were is the problem may i have accessing the union in a wrong way or something.
Sorry for my very stupid question and thanks for ur time in advance.
Together we are stronger.
I am so
M.A.S.A
|
|
|
|
|
Using another union name than DUMMYUNIONNAME solves the problem.
|
|
|
|
|
I am sorry _Theo_ i don't understand u. The union name is defined in the MFC and i have no authority to midify it. So I must use the "DUMMYUNIONNAME " union name.
Plllllllllllssssssssssss If u know any way of solving this problem i will be very greatful if u send it to me.
Thank u Any way for ur quick reply and waiting for ur reply. I really want a solution for this problem.
M.A.S.A
|
|
|
|