|
Hello Sir:
I am working on testing float point exception. I know the float point exception have 6 category. I want to catch all exception. I know some float point instruction can generate these ecception. I want to one by one test float point exception. So i must generate these exception at first, but i know a little float point instruction, i don't how generate these float point exception. I want to know somebody know these. Can you help me? I am a rookie
Thanks in advance!
|
|
|
|
|
Sir,
Where do I find free VC++ projects alongwith the source code. The projects should not be too big as I want to improve my knowledge in VC++.
How to generate reports like the data environment present in VB6.0
Neelesh Jain
|
|
|
|
|
From the cp home page (www.codeproject.com) , look on the left hand side of the page. There you will find coding categories, if you want to find articles w/ source code, just click away at the ones that interest you (ie. mfc, win32, c++)
You can also find source code snippets and pertinent information on msdn.microsoft.com , just search for c++ or something more specific.
Good luck.
R.Bischoff
.NET, Kommst du mit?
|
|
|
|
|
Hi All,
I can not seem to get ::FindNextFile to work properly, or should I say the way I would expect it to work. The code below is straight out of MSDN, but it only works on the first file, the FindNextFile call returns FALSE, thus it does not iterate through the entire directory. I have a ton of .txt files, so it should find more than one.
Thanks in advance for any help or suggestions ?
<br />
#include <windows.h><br />
#include <stdio.h><br />
<br />
WIN32_FIND_DATA FileData; <br />
HANDLE hSearch; <br />
DWORD dwAttrs; <br />
char szDirPath[] = "c:\\TEXTRO\\"; <br />
char szNewPath[MAX_PATH]; <br />
char szHome[MAX_PATH]; <br />
<br />
BOOL fFinished = FALSE; <br />
<br />
<br />
if (!CreateDirectory(szDirPath, NULL)) <br />
{ <br />
printf("Couldn't create new directory."); <br />
return;<br />
} <br />
<br />
<br />
hSearch = FindFirstFile("*.txt", &FileData); <br />
if (hSearch == INVALID_HANDLE_VALUE) <br />
{ <br />
printf("No .TXT files found."); <br />
return;<br />
} <br />
<br />
<br />
while (!fFinished) <br />
{ <br />
lstrcpy(szNewPath, szDirPath); <br />
lstrcat(szNewPath, FileData.cFileName); <br />
if (CopyFile(FileData.cFileName, szNewPath, FALSE))<br />
{ <br />
dwAttrs = GetFileAttributes(FileData.cFileName); <br />
if (!(dwAttrs & FILE_ATTRIBUTE_READONLY)) <br />
{ <br />
SetFileAttributes(szNewPath, <br />
dwAttrs | FILE_ATTRIBUTE_READONLY); <br />
} <br />
} <br />
else <br />
{ <br />
printf("Couldn't copy file."); <br />
return;<br />
} <br />
<br />
if (!FindNextFile(hSearch, &FileData)) <br />
{<br />
if (GetLastError() == ERROR_NO_MORE_FILES) <br />
{ <br />
MessageBox(hwnd, "No more .TXT files.", <br />
"Search completed.", MB_OK); <br />
fFinished = TRUE; <br />
} <br />
else <br />
{ <br />
printf("Couldn't find next file."); <br />
return;<br />
} <br />
}<br />
} <br />
<br />
<br />
FindClose(hSearch);<br />
R.Bischoff
.NET, Kommst du mit?
|
|
|
|
|
Use the full path in the FindFirstFile() call, don't rely on whatever the current directory happens to be, because if it's different that what you think, code will break and there's no obvious indication why.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Thanks for your reply Mike. I did try to use an absolute path for FindFirstFile, but it still didn't work. I've got something working, but still a little confused about FindFirstFile 's behavior, eventhough it seems really straightforward.
Thanks again.
R.Bischoff
.NET, Kommst du mit?
|
|
|
|
|
This code seems to work like I expected:
<br />
WIN32_FIND_DATA fd;<br />
HANDLE hFind = ::FindFirstFile(_T("C:\\wutemp\\*.*"), &fd);<br />
<br />
if (hFind != INVALID_HANDLE_VALUE)<br />
{<br />
do<br />
{<br />
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)<br />
m_listBox.AddString(fd.cFileName);<br />
}<br />
while(::FindNextFile(hFind, &fd));<br />
::FindClose(hFind);<br />
}<br />
I guess in my first post the file attributes were not set correctly. Not sure.
R.Bischoff
.NET, Kommst du mit?
|
|
|
|
|
MindNets
“MindNets” is an organization that is being established for providing support and solution in different fields of IT/Computer Science.
Our Expertise includes:
Web Design and Development, Databases, Networks, Desktop Applications, Business Applications, Image Processing, Biometrics, Science and Engineering.
For Students:
During our final projects, we found that there is very little guidance for students; in working on their projects (software) using latest tools and technologies. This is where the whole idea came to our mind and became the basis of “MindNets”.
For Companies:
In this era, for each and every organization; it’s necessary to transfer its business online. This is so, because it not only helps in expanding the business but also in providing more facilities to the customers.
For this we are providing complete web site design, development and hosting facilities. We are also looking forward to facilitate these companies in building and maintaining efficient LAN/WAN networks.
So feel free to contact us at any time; you need us; as we are to help YOU.
Team:
Khurram Ishtiaq Qazi (Netsol)
(c++, visual c++, java, Oracle 8i, (sql/plsql, Developer6))
Asim Nazir (XavorInt)
(c++, java, visual c#, ASP.NET, Sqlserver 2000, Crystal Reports)
Irfan Yousaf (ICBCS)
(VB6, ASP, VB.NET, ASP.NET, Oracle, Visual C++, Visual Prolog)
Mohsin Ali (TWE)
(Microsoft Certified Solution Developer (MCSD), VB6, Flash)
Aamir Alla-u-Din (Operation Al-Badar)
(Microsoft Certified System Engineer (MCSE NT+2000), CCNA)
Contact:
Mail: mind_nets@yahoo.com
Voice: 0333-4294413
MindNets
|
|
|
|
|
How much do you charge?
And how much credibility do you think you have with a Yahoo email address?
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
|
Have you ever heard of "spam"?
No??
Well, you've just provided a perfect example.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I created a function which will return a user-selected item from the listbox so that a dialog box will pop up whenever a button is pressed for that string selected in listbox:
if(m_list.GetCurSel()="Apples")
{m_ProcessDlg.DoModal();}
problem is there is an error coz it returns an int, so is there a way to return a cstring type? urgent!
|
|
|
|
|
If your using the CListBox, use the method GetText. It takes the index returned from the GetCurSel and a buffer of the text.
Larry
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
thanx! that is what I need but how to code the syntax? ( I am new to c++ so I have some problems with coding), I tried this:
int chosen=m_list.GetCurSel();
if(m_list.GetText(chosen)="Apples")
{m_ProcessDlg.DoModal();}
how to correct this?
|
|
|
|
|
|
i tried this but got a "buffer not initialised" warning, how to resolve that?
int chosen=m_list.GetCurSel();
LPTSTR buffer;
m_list.GetText(chosen,buffer);
if(strcmp(buffer,"apples") == 0)
{m_ProcessDlg.DoModal();}
|
|
|
|
|
LPTSTR buffer only allocates a pointer to a string
use a cstring like:
CString buffer;
or an array like:
TCHAR buffer[256];
or use the new / delete stuff like:
LPTSTR buffer = new TCHAR [256];
blah blah blah
delete buffer;
"there is no spoon" biz stuff about me
|
|
|
|
|
int Select = m_list.GetCurSel();
CString fruit;
m_list.GetText( fruit );
if( fruit == "Pears" )
yada yada yada
Larry
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
Hi, I was wondering if IE or Windows ships with the MFC dlls (the ones that come with VC++ 2002, I don't know the version number). Thanks
Shutter
|
|
|
|
|
I believe Windows XP ships only with msvcrt.dll (for 6.0.)
It would be nice if XP SP2 shipped with them though.
|
|
|
|
|
I have a problem with a property sheet
I am creating property sheet insde a dialog this way:
<br />
BOOL CMyDlg::OnInitDialog() <br />
{<br />
CDialog::OnInitDialog();<br />
<br />
m_propsheet.Create(this, WS_CHILD | WS_VISIBLE, 0);<br />
m_propsheet.ModifyStyleEx (0, WS_EX_CONTROLPARENT);<br />
m_propsheet.ModifyStyle(0, WS_TABSTOP);<br />
<br />
m_propsheet.GetTabControl()->ModifyStyle(TCS_MULTILINE,0);<br />
<br />
CRect rcSheet;<br />
GetDlgItem(IDC_PROPSHEET)->GetWindowRect( &rcSheet );<br />
ScreenToClient( &rcSheet );<br />
m_propsheet.SetWindowPos( NULL, rcSheet.left-7, rcSheet.top-7, 0, 0, <br />
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE );<br />
.<br />
.<br />
.<br />
}<br />
In this code I tried to change the style of tab control inside a property sheet,
so it would display one row of tabs. It works, but the size of property sheet retains bigger,
just like with two rows of tabs,
How to fix this ?
|
|
|
|
|
Hello,
i decided to use only the win32 api. no mfc.
i am having a hard time finding material about this topic.
how to do splitters, message handling, owner drawing, multiple childwindows that handle data and so on?
do you know sites, help or ideas? if those are for beginners it would help even more.
(i even failed to change the font in a listbox created as a child window. it looks perfect in a dialog but as child window the font is BIG and all my changes didnt work. too small too big but never the right size...)
can anyone help?
|
|
|
|
|
HeiniBlad wrote:
i even failed to change the font in a listbox created as a child window.
Well, I had a lot of difficulty changing the font in MFC also so it is not limited to just win32 api. Windows is designed to make it difficult to implement a non standard interface.
HeiniBlad wrote:
i decided to use only the win32 api. no mfc.
i am having a hard time finding material about this topic.
Why don't you try one of the other windowing libraries WTL, xwWindows, VCF? I don't see why so many people want to do things the hard way. There is not that much performance benifit using Win32 api over MFC. And for the memory considerations sure MFC is a big library and takes a mb or so to load but it is most likely already loaded with windows. Windows will only load a dll once in memory and share it with multiple programs. So in reality using it creates an application with a smaller foot print...
John
|
|
|
|
|
HeiniBlad wrote:
i decided to use only the win32 api. no mfc.
I'm curious. What was your decision based on?
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Have control over the code?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|