|
And your printf is erronous
try a printf((LPCTSTR)rad);
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Stojan78 wrote:
file.WriteString(rad1 + '\n');
file.WriteString(rad2 + '\n');
file.ReadString(rad);
Your problems lies with the above statement.
Try this:
<br />
file.WriteString(rad1 + '\n');<br />
file.WriteString(rad2 + '\n');<br />
file.SeekToBegin();
file.ReadString(rad);<br />
I Dream of Absolute Zero
|
|
|
|
|
Thanks a lot all. It now works just fine...
|
|
|
|
|
i am using visual studio to make some histogram graphs and pie graphs of standered divation but the programme does not recognize the graphics.h header file. how should i make the graphs and please tell what should i do to this heard file (graphics)
graphics in c/c++
|
|
|
|
|
|
How can I change the Style of an CSlideCtrl subsequent? I need this, because some settings cannot be set on the dialog editor...!
|
|
|
|
|
Thank you for reading this.
Now I want to keep the height and position of vertical scrollbar's thumb all
the time,so I used this m_ctrlTree' is a TreeListView control)
----------------------------
const int nBar = SB_VERT;
SCROLLINFO si = {0};
si.cbSize = sizeof(si);
si.fMask = SIF_ALL;
m_ctrlTree.GetScrollInfo(nBar, &si);
si.nMax = si.nPage * 2;
si.nPos = (int)si.nPage/2;
m_ctrlTree.SetScrollInfo(nBar, &si, TRUE);
-----------------------------
I placed that block in the 'OnPrePaint' event of the tree control and it really works,but
problem is that when resizing the TreeListView window or expanding a
node, it scrolls madly,perhaps always scrolls to the last record,this is not what I
want.
Is the calculate method right?And where should I place the
SetScrollInfo(nBar, &si, TRUE)to control the Thumb?
Best reguards.
de BG2SC
|
|
|
|
|
Hi,
in an application that i'm developping, i need to know if there are some user activities at any given time, such as the mouse being moved or the keyboard being used.
Is there any other smarter way to know how, that there are no user activity on the system and how long he was not active. Such a behaviour is used by application for IM, when they set the "away" message !
Thanks in advance for any hints and best regards
Richard
|
|
|
|
|
Check OnIdle( LONG lCount ); for MFC
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
i'm not using mfc in my application ;o) !
So please provide a solution without mfc !
Thx in advance and best regards
Richard
|
|
|
|
|
From MSDN about OnIdle
OnIdle is called in the default message loop when the application’s message queue is empty. Use your override to call your own background idle-handler tasks.
Why not do the "same" in your main loop?
When no messages are being treated treat Call an OnYourIdle Function
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Check out GetLastInputInfo() .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
If you are using MFC based application u can track it by overriding OnIdle method of CWinApp class.
for direct win32 application u can use WinProc method to track any message is posted on the message queue of the application.
One Best method is, Through Hook. write a WH_MESSAGE hook and do your work fine
I hope it will help you
thanks
|
|
|
|
|
Maybe one note on the onidle loop.
It will use a lot of cpu % usage!
You can solve this by setting a start time in your onidle (and then tell it to stop working) and starting a thread which will test this starttime against the currenttime. if a certain time has passed ... (take some action).
Put a Sleep in your thread to keep the cpu % usage down.
Have fun ...
|
|
|
|
|
As already suggested, GetLastUserInputInfo() on W2K+ systems.
Otherwise you could modify the main message loop, and take the time stamps of hincoming mouse/keyboard messages.
Another option would be a Mouse/Keyboard hook inside your process, that simply resets a timer. This seems the most independent solution (and not too complicated), but personally I would avoid a hook unless it's the only way.
or you just check if the space key is permanently down, and there are snoring noises from the MIC IN.
Flirt harder, I'm a Coder
mlog || Agile Programming | doxygen
|
|
|
|
|
|
I want to be able to display properties for file or folder, as we do when right-clicking over file or folder, I have to display this shell dialog (shell dialog I Guess), but my search in msdn and here at CP does not give any results. Does anyone know how to do that or have information link?
Thanks in Advance!
|
|
|
|
|
Try ShellExecute with the verb "Properties"
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
Doesent seem to work
|
|
|
|
|
Following is the code snippet i am working with.
miNumDataFile denotes number of datafiles
msarrDataFile[iloop] denotes the file path and name.
I am opening around 3000 fines in binary mode and
reading all the records in each file using fread. total file size
around 187mb with 1366218 rows.
its a simple c exe.
on the first run it takes 48 secs.
on the seond run it takes 2 secs!!!!!!!!!.
my question is why is happening. each time i reboot my pc
the same phenomenon happens. WHY??????
for(int iloop=0;iloop
|
|
|
|
|
The OS does a caching for you
does it bother you?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks Papa for your reply.
I was not sure what was happening.
Now even if the OS is doing the caching part, I have 2 questions.
Will this happen in every OS. and further more some times it takes 1-2 secs to read files (total size 200 MB). that whats bothers me. 1/2 secs is really low, for reading and processing 200MB file wont you think!!
Anyway i am planing it run this component on a web sever. and a page will call this to show the results of this component.
thats why i am so worried about this thing..
Thanks a lot anyway...
Apratim
|
|
|
|
|
hi,
i created a simple editbox derived from CEdit class. its working , but clicking in the edit box sets out the devil.
The program shuts down after showing the message 'Debug Assertion Failed " Abort-Retry-Ignore.
Another problem is that i can't type characters more than the length of the editbox.
I wrote a message to handle the keypress event, using ON_EN_CHANGE(IDC_ED,OnEditKeyDown). but am not getting the 'enter' key.
the edit box is deleted in the killfocus event..
CAN ANYBODY HELP PLEASE ?
thanks in advance..
---------------- here goes the code-----------
-----edit box creation on pressing F4 key-----
case VK_F4:
{
CMainFrame* pMainWnd = (CMainFrame*) AfxGetMainWnd();
pEdit = new CEdit;
pEdit->Create(ES_AUTOVSCROLL | ES_WANTRETURN | WS_CHILD | WS_VISIBLE |WS_TABSTOP | WS_BORDER, CRect(0,col+(m_nCurSel*2),75,col+(m_nCurSel*2)+17), this,
IDC_ED);
pEdit->SetLimitText(50);
pEdit->SetFocus();
}
------ function that receives keypress---
void CMarketWatchView::OnEditKeyDown(UINT nChar)
{
static const MSG* pMsg = GetCurrentMessage();
if(pMsg->wParam==0x0D) //checkfor enter key
{
AfxMessageBox("Enter key");
- other code here-
}
pEdit->SetFocus();
}
---------lost focus function for the edit box ----
void CMarketWatchView::OnEditKillFocus()
{
char buf[50];
pEdit->GetWindowText(buf,49);
--other code here--
Invalidate(FALSE); //redraw
delete pEdit;
}
|
|
|
|
|
maybe you post the complete code here?
|
|
|
|
|
b coz, i want the edit box to be dstroyed when it loses the focus.
the user can press F4 key again to create it.
it will b good if edit box disappears, when user hits Enter key.
thanks
|
|
|
|