|
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
|
|
|
|
|
Try this ..
// get current clipping boundary
RECT rect;
pDC->GetClipBox( &rect );
// Selects the current clipping region for other dc
CRgn rgn;
rgn.CreateRectRgnIndirect( &rect );
m_DC.SelectClipRgn( &rgn );
... hope it helps
|
|
|
|
|
Thanks "csc"
its exactly does what i expect...
|
|
|
|
|
hello
please help to solve this problem
when i coonect vc++ to mysql
and use this code to fetch data from mysql
mysql_query(myDB,"select password from login where user= \'" + user + "\'");
i = mysql_query(myDB,"select * from login");
res=mysql_store_result(myDB);
row = mysql_fetch_row(res);
MessageBox(row[0]);
but when i use debugger at this line row = mysql_fetch_row(res);
an unhandled exception myapp.exe(libmysql.dll) access violation appears in message box and when i click ok then in output window of vc++ following messages appears :
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\DOGRA\company\libmySQL.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wsock32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL'
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Warning: no listbox item selected.
Loaded 'C:\WINDOWS\system32\mswsock.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\dnsapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winrnr.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rasadhlp.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\hnetcfg.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wshtcpip.dll', no matching symbolic information found.
First-chance exception in company.exe (LIBMYSQL.DLL): 0xC0000005: Access Violation.
The program 'C:\DOGRA\company\Debug\company.exe' has exited with code 0 (0x0).
now please help me to solve this problem
hi
|
|
|
|