|
rp_suman wrote: Is it OK to get the handle inside PreCreateWindow() of SDI application?
No, at as name indicates, window is yet to create.
Prasad
MS MVP - VC++
|
|
|
|
|
can any one explain the sequence steps how x value changes.
x=x++ + ++x + ++x + --x;
printf("%d",x);
y=x++ + ++x + ++x + --x;
printf("%d",x);
printf("%d",y);
I executed this exp in vc++ i got 1st exp values as x=14
and in second exp i got x=4 and y=14.
|
|
|
|
|
It's GOT to be homework!
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Hi All,
Under Microsoft C++ compiler Divide by Zero and NULL pointers can be catched using
try
{
}
catch(...)
{
// exception handling
}
When I try it under the GCC on unix platforms it does not catch it. Simply "Segmantation fault" is thown outside and program terminates.
I am just wondering that above mentioned exceptions and not part of C++ standard?
If so, anybody have any more information on this?
|
|
|
|
|
MSVC6 is crap; GCC is behaving correctly according to the C++ standard. The catch keyword is only meant to be able to catch C++ exceptions thrown with the throw keyword; not arbitrary hardware exceptions. Later versions of MSVC corrected this behaviour but added the /EH?[^] switch to choose between to two behaviours.
Steve
|
|
|
|
|
hi
i'm programming a document using scintilla wnd...
here on right clicking mouse button my own popup menu should come..but by default it is showing some popup menu with cut,copy,paste...
i have added mine using RButtonUp function but it is not sensing that function...any help please..thanx in advance...
|
|
|
|
|
Have you tried overriding OnRButtonDown? After all, that happen first...
Or checked if there's an overridable member OnContextMenu?
Lastly, have you added the macros (ON_WM_RBUTTONetc) to your message map? You need to hook up your handler as well as write it.
Iain.
|
|
|
|
|
yah!i have tried with adding WM_RBUTTONUP message using class wizard but it is not at all sensing the function when i press rightmousebutton ...even i tried with WM_RBUTTONDOWN through class wizard,neither is working....
i have avoided the default scintilla wnd's popmenu also by using SCI_USEPOPUP(false)...
as you said these WM_RBUTTONUP are working well in other windows not in scintilla wnd...
any help thanx in advance....
|
|
|
|
|
Hi,
How i can delete a file at an specified location.Is there any function which does this.
Regards,
|
|
|
|
|
The DeleteFile function deletes an existing file.
BOOL DeleteFile(
LPCTSTR lpFileName
);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
If you want to be more portable across various platforms:
int unlink(const char *filename)
-- modified at 2:23 Monday 30th July, 2007
Roberto
|
|
|
|
|
|
Hello everyone,
I am wondering how to remove a non-empty directory on Windows? I find that function RemoveDirectory works only for empty directory.
thanks in advance,
George
|
|
|
|
|
A quick search give me the below link. I have not tested/used.
http://www.codeproject.com/cpp/Clean_Workspace.asp
|
|
|
|
|
Good reference, thanks mandanani!
Since I need to use API DeleteFile, I am wondering how to pass path name string which is encoded as multi-byte character or wide character?
In the article, it is an MFC project so CString is used, but I am not using MFC based Windows project, and I can not use CString data type.
Any ideas?
regards,
George
|
|
|
|
|
To delete a non-empty directory I usually use a loop with FindFirstFile()/FindNextFile().
If you want to delete a whole subtree, you can make a littel recursive function using the above calls: it is very simple. Pay attention to the read-only files: you should change the read-only attribute (if you can) before removing them.
Hope this helps.
Roberto
|
|
|
|
|
Thanks Roberto,
For API DeleteFile, I am wondering how to pass path name string which is encoded as multi-byte character or wide character?
regards,
George
|
|
|
|
|
try SHFileOperation(..) shell API
|
|
|
|
|
Hi nitinmx,
I need to run program on both Windows desktop and Windows CE, I am wondering whether SHFileOperation could be supported on Windows CE?
regards,
George
|
|
|
|
|
As most people don't program for windows CE, you could always look at the help file to see if it supported yourself. Or try using it and fail?
Iain.
|
|
|
|
|
Hi,
I have many string values . I am displaying them on GDI using the
TEXTOUT() method . but my problem is that I want to SCroll them
on the GDI .also I am displaying bimap usig bitblt(). I also wants
to scroll many bitmpas on the GDI
Trioum
|
|
|
|
|
Then you have to save your relative position of your elements and then update them with the position of your CScrollview in every OnDraw. I made it like this:
void CMyView::OnInitialUpdate()
{ CScrollView::OnInitialUpdate();
CSize sizeTotal;
sizeTotal.cx = 950; sizeTotal.cy = 1400;
SetScrollSizes(MM_TEXT, sizeTotal);
CMyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
extern CMyDoc* m_pDoc;
m_pDoc = GetDocument ();
pDoc->UpdateDescription ();
m_hCursor=AfxGetApp()->LoadStandardCursor(IDC_ARROW);
return;
}
void CMyView::OnDraw(CDC* pDC)
{ PlaceElement ();
return;
}
void CMyView::PlaceElement ()
{ CMyDoc* pDoc = GetDocument ();
ASSERT_VALID (pDoc);
CClientDC dc(this);
CDC dcNormMem;
dcNormMem.CreateCompatibleDC (&dc);
CDC dcSelMem;
dcSelMem.CreateCompatibleDC (&dc);
CString szTempText = "";
CPoint cpTempPos, cpTempTextPos, cpScrollPoint = GetScrollPosition ();
CBitmap bmNormIn, bmNormOut, bmNormReg, bmSel;
BITMAP bmNormTemp, bmSelTemp;
for (int nIn = 0; nIn < pDoc->m_cMyListSet.GetCount (); nIn++)
{ if (!pDoc->m_cMyListSet[nIn].m_bInSel)
{ if (bmNormIn.m_hObject != NULL)
bmNormIn.DeleteObject ();
bmNormIn.LoadBitmap (IDB_NORMIN);
bmNormIn.GetObject(sizeof(bmNormTemp), &bmNormTemp);
dcNormMem.SelectObject(&bmNormIn);
cpTempPos.x = pDoc->m_cMyListSet[nIn].m_cpInCoord.x - cpScrollPoint.x;
cpTempPos.y = pDoc->m_cMyListSet[nIn].m_cpInCoord.y - cpScrollPoint.y;
dc.BitBlt(cpTempPos.x, cpTempPos.y, bmNormTemp.bmWidth,
bmNormTemp.bmHeight, &dcNormMem, 0, 0, SRCCOPY);
szTempText = pDoc->m_cmlInputSet[nIn].m_szInName;
dc.SetTextColor(RGB(0,0,0));
dc.TextOut (cpTempPos.x, cpTempPos.y + SIGHEIGHT + 1, szTempText);
}
}
}
With these I put one Bitmap and a label with its name below for every element I have , and when I scroll the View surface its position scrolls as well.
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
actually i donot want to scroll image and text by picking from list by by one .I want to scroll them like the news tickers in News Channel
can you help.
Trioum
|
|
|
|
|
????
Explain it a bit. I don't know what you mean
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hello Gurus...
Using pDC->GetClipBox(&rect), i Will get clip region of pDC(my CDC*).
But
m_DC is my another DC, and i want to assign the clip region of pDC to m_DC.
How to assign?????????????
thanks in advance
|
|
|
|