dev-cpp-users Mailing List for Dev-C++ (Page 570)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Bob W. <bo...@ph...> - 2002-06-18 14:46:37
|
Can anyone who has down loaded the source for version 4.01 tell me in =
"Util.pas" in line 57:
"if Source < 0 then raise EFOpenError.CreateFmt(SFOpenError, =
[FileName]);"
where "SFOpenError" is defined? When I try to build dev-cpp I get a =
error that says:
"[Error] Utils.pas(60): Undeclared identifier: 'SFCreateError'"
which, of course, leads to a fatal error in the build process because it =
can not compile the required "Utils.pas".=20
Thanks,
Bob
|
|
From: Ioannis V. <no...@ho...> - 2002-06-18 11:21:23
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Ioannis Vranos
> Sent: Tuesday, June 18, 2002 2:09 PM
> To: dev...@li...
> Subject: RE: [Dev-C++] ioannis - namespaces
>
>
> > -----Original Message-----
> > From: dev...@li...
> > [mailto:dev...@li...] On Behalf
> > Of Daniel Glenfield
> > Sent: Tuesday, June 18, 2002 1:36 PM
> > To: dev...@li...
> > Subject: [Dev-C++] ioannis - namespaces
> >
> >
> > Ioannis, you've mentioned several times to always use
> > namespaces as locally
> > as possible. I was wondering why this is? What is the benefit
> > of using them
> > locally?
> >
> > Daniel
>
>
> The namespace system was made to provide a system that
> enables combining
> various libraries while protecting from name clashes.
>
> So you can for example do:
>
> #include <iostream>
#include <vector>
>
> // Daniel's version of vector
> #include <daniel.h>
>
>
> int main()
> {
> using std::cout;
using std::endl;
> using daniel::vector;
>
> vector<int>array(50, 1);
>
> cout<<array[i]<<endl;
> }
>
>
> As god says in TC++PL, using global using directives is an efffort to
> defeat the namespace system, which has bad consequences in large
> projects. We must try to use more using std::something; than using
> namespace std; and as in small scope as possible.
>
> In general myself, i use using std::something; for 2-3 facilities in a
> given function, and if there are more i place a using
> namespace std; in
> that function scope.
>
>
> Ioannis
>
> * Ioannis Vranos
> * Programming pages: http://www.noicys.cjb.net
> * Alternative URL: http://run.to/noicys
>
> --------------------------------------------------------------
> --------------
> Bringing you mounds of caffeinated joy
> >>> http://thinkgeek.com/sf <<<
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Ioannis V. <no...@ho...> - 2002-06-18 11:10:12
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Daniel Glenfield
> Sent: Tuesday, June 18, 2002 1:36 PM
> To: dev...@li...
> Subject: [Dev-C++] ioannis - namespaces
>
>
> Ioannis, you've mentioned several times to always use
> namespaces as locally
> as possible. I was wondering why this is? What is the benefit
> of using them
> locally?
>
> Daniel
The namespace system was made to provide a system that enables combining
various libraries while protecting from name clashes.
So you can for example do:
#include <iostream>
// Daniel's version of vector
#include <daniel.h>
int main()
{
using std::cout;
using daniel::vector;
vector<int>array(50, 1);
cout<<array[i]<<endl;
}
As god says in TC++PL, using global using directives is an efffort to
defeat the namespace system, which has bad consequences in large
projects. We must try to use more using std::something; than using
namespace std; and as in small scope as possible.
In general myself, i use using std::something; for 2-3 facilities in a
given function, and if there are more i place a using namespace std; in
that function scope.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|
|
From: Hongli L. <h....@ch...> - 2002-06-18 10:58:30
|
Douglas J van Vliet wrote: > Hi, > > Where can I get more documentation regarding the use of Dev-C++ IDE? > > 1. How do I get Code Completion to work? Look in the configuration dialogs. > 2. How can I get more information on .rc files for Dev-C++? msdn.microsoft.com > 3. I downloaded the .DevPak file - How do I install it? > How about following the installation instructions. |
|
From: Ramana K. <ra...@my...> - 2002-06-18 10:49:03
|
After compiling a file, when pressing the "Execute" button, Dev-C++ gives an Access Violation error at a specified address. At least this is what used to happen for me (and i heard this happened to some other people) now, when i press "Execute", dev-c++ simply closes and my program runs... but after, i have to reopen dev-c++ to look at the source again. this happens even when using "Compile & Execute". is something already being done about this? Further, if i open (double click on) a .cpp file from windows explorer, dev-c++ opens, but does not open that file. I am using Windows XP (Home ed) and Dev-C++ 4.9.3.0 thanks, :) Ramana |
|
From: Daniel G. <sp...@ho...> - 2002-06-18 10:36:05
|
Ioannis, you've mentioned several times to always use namespaces as locally as possible. I was wondering why this is? What is the benefit of using them locally? Daniel _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com |
|
From: Carlos d. M. <cg...@wo...> - 2002-06-18 10:14:03
|
There is no option in file -> new project to make only the .a file, at least in Dev-C++ 4. There are only windows, console, winmain, dll and empty. But I tried to open a new DLL and compile it wothout touch the basic template, and in the output are the .def, the .dll and the .a file. I suppose then that if you want make an .a file you have just to make a dll. It is valid I'll suppose while no other thing is said. [I don't know yet program them, but I am trying to write an application to convert MSVC project to DEV-C++ project] Hongli Lai escribi=F3: > Carlos Garc=EDa del Monte wrote: > > >Hi: > >Is it possible to build .a files with Dev? How? (Which compiler > >option...) > >I don't find any info in the help files I have. > >Thank you. > > > > > > > > File->New Project->Static Library (.a) ? |
|
From: Douglas J v. V. <do...@gl...> - 2002-06-18 08:52:03
|
Hi, Where can I get more documentation regarding the use of Dev-C++ IDE? 1. How do I get Code Completion to work? 2. How can I get more information on .rc files for Dev-C++? 3. I downloaded the .DevPak file - How do I install it? Win 2000 Pro 256MB RAM Regards Dougie |
|
From: JAIME E. <jae...@ya...> - 2002-06-17 20:39:28
|
Hi. The better plac to download wx is sourceforge. Look for wxWindows there and will be no problem. You will have to compile it. Hongli Lai <h....@ch...> wrote: Napoleon Ahiable wrote: > Hi, > I tried to download the wxWindows package from the bloodshed/dev site > but I noticed that the extension was .DevPak which posed a problem for > me. I use Opera and when I click or double click I get garbage on the > screen. I suspect the browser does not know how to handle the extention. > > How will I be able to download the wxWindows package please. > > Napoleon. > Right click->Save Target _______________________________________________________________ Sponsored by: ThinkGeek at http://www.ThinkGeek.com/ _______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users --------------------------------- Do You Yahoo!? Sign-up for Video Highlights of 2002 FIFA World Cup |
|
From: Hongli L. <h....@ch...> - 2002-06-17 19:38:12
|
Napoleon Ahiable wrote: > Hi, > I tried to download the wxWindows package from the bloodshed/dev site > but I noticed that the extension was .DevPak which posed a problem for > me. I use Opera and when I click or double click I get garbage on the > screen. I suspect the browser does not know how to handle the extention. > > How will I be able to download the wxWindows package please. > > Napoleon. > Right click->Save Target |
|
From: Hongli L. <h....@ch...> - 2002-06-17 19:37:52
|
Carlos García del Monte wrote: >Hi: >Is it possible to build .a files with Dev? How? (Which compiler >option...) >I don't find any info in the help files I have. >Thank you. > > > File->New Project->Static Library (.a) ? |
|
From: Napoleon A. <nah...@so...> - 2002-06-17 19:31:13
|
Hi, I tried to download the wxWindows package from the bloodshed/dev site = but I noticed that the extension was .DevPak which posed a problem for = me. I use Opera and when I click or double click I get garbage on the = screen. I suspect the browser does not know how to handle the extention. How will I be able to download the wxWindows package please. Napoleon. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.371 / Virus Database: 206 - Release Date: 13/06/02 |
|
From: Carlos d. M. <cg...@wo...> - 2002-06-17 19:19:07
|
Hi: Is it possible to build .a files with Dev? How? (Which compiler option...) I don't find any info in the help files I have. Thank you. |
|
From: Abhijit S. <mu...@gm...> - 2002-06-17 17:33:53
|
Thanks for the help. I downloaded MSYS. It's working fine, but it seems very, I dunno, incomplete... thinking of downloading the complete Cygwin... :) -------------------------- http://mudeth.tripod.com |
|
From: Mac R. <re...@no...> - 2002-06-17 14:12:44
|
Don't poll for thread exit. See WaitForSingleObject(), if you only need to wait for one thread, or WaitForMultipleObjects() if you are just going to sit there until all of the threads exit (common in the main() routine). The easiest way to look these functions up is to use Google ( http://www.google.com ) and just type in the function name -- Google indexes Microsofts Dev Network better than Microsoft does... The following link should get you started. PLEASE READ THE ENTIRE PAGE. Microsoft likes to hide extremely important information in the "Remarks" section. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/syn chro_4ldg.asp That should all be on one line -- if it isn't, please reconstruct it (or just use Google -- this was the first entry on the result page for "waitforsingleobject" (I'm lazy and don't specify letter case in searches...). Also, please be aware of the fact that C++ does not have ANY thread support at all. Any threading you do will be system dependent. The closest you can get to "C++ threads" would be the portable threading library that is part of BOOST (http://www.boost.org). I haven't had a chance to work with BOOST yet, but by all reports, getting yourself a good STL implementation (like from http://www.stlport.org) and then strapping in the newest BOOST classes gives you a really nice set of tools to work with. The C++ committe is looking seriously at BOOST for possible inclusion in the next C++ standard, so you may want to start familiarizing yourself now. Also, code built with the BOOST threading libraries stands the best chance of being both cross platform portable and surviving through future standards revisions. (Just to avoid the response -- another "standard" threading system is POSIX threads, or pthreads. pthreads is indeed fairly standard across UNIX-ish OSs, but not particularly supported under Windows. The BOOST libraries are reported to work on at least the major platforms.) http://www.boost.org/libs/thread/doc/overview.html Mac At 05:37 PM 6/16/02 +0530, Abhijit Shylanath wrote: >> do >> { >> GetExitCodeThread(hThread, &exit_code); >> } while(exit_code == STILL_ACTIVE); >> cout << "\n Thread " << i+1 << " has completed.\n"; > > >I almost fergot... polling GetExitCodeThread() can be very CPU intensive, so >you might want to Sleep() in between polls, as in > >do >{ > GetExitCodeThread(hThread, &exit_code); > Sleep(DELAY); >} while(exit_code == STILL_ACTIVE); > >DELAY can be 100 or more or less, I dunno, depending on the need for speed. > >I don't know of any synchornous method to do this. > - _____________________________ /"\ Mac Reiter \ / ASCII Ribbon Campaign Nomadics, Inc. X Against HTML Mail re...@no... / \ (To join the campaign, simply use this in your signature.) |
|
From: Hongli L. <h....@ch...> - 2002-06-17 12:46:44
|
On Mon, 2002-06-17 at 12:39, Andres Rand wrote: > I reccomend to download msys package. It is more sutable for MinGW. > Msys is found at sourceforge.net MinGW download page. > > A. > I've tried MSYS many times, but I've never got it working properly (especially bash). I recommend using Cygwin as environment, but Mingw as compiler. |
|
From: Andres R. <lo...@ho...> - 2002-06-17 10:39:48
|
I reccomend to download msys package. It is more sutable for MinGW. Msys is found at sourceforge.net MinGW download page. A. > -----Original Message----- > From: dev...@li... [mailto:dev-cpp-users- > ad...@li...] On Behalf Of Hongli Lai > Sent: 17. juuni 2002. a. 13:24 > To: Abhijit Shylanath > Cc: Dev-C++ Mailing List > Subject: Re: [Dev-C++] Configure, make, and assorted flowers > > Abhijit Shylanath wrote: > > >Most source packages I download need me to run 'configure' before 'make'. > >Are conigure's windows binaries available for download to run with > >GCC-ports? Where do I get them? I'm really confused. I downloaded bash > >sources, assuming I can compile them (maybe with modifications), using > >Cygwin or MingW, and don't know what to do... any help will be > appreciated. > >Thanks. > > > > > > This is what I do: > 1. Download and install Dev-C++ 5. > 2. Download Cygwin and install everything related to development (bash, > gcc, make, Cygwin's mingw environment, bison, yacc, sed, etc.) > 3. Make Dev-C++'s Mingw the default compiler: > export CC='C:/Dev-C++/bin/gcc' > export CXX='C:/Dev-C++/bin/g++' > 4. Tell configure that you're configuring for Mingw. > ./configure --target=i586-pc-mingw32 --build=i586-pc-mingw32 > --host=i586-pc-mingw32 > make install > > > > > _______________________________________________________________ > > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Hongli L. <h....@ch...> - 2002-06-17 10:19:41
|
Abhijit Shylanath wrote: >Most source packages I download need me to run 'configure' before 'make'. >Are conigure's windows binaries available for download to run with >GCC-ports? Where do I get them? I'm really confused. I downloaded bash >sources, assuming I can compile them (maybe with modifications), using >Cygwin or MingW, and don't know what to do... any help will be appreciated. >Thanks. > > This is what I do: 1. Download and install Dev-C++ 5. 2. Download Cygwin and install everything related to development (bash, gcc, make, Cygwin's mingw environment, bison, yacc, sed, etc.) 3. Make Dev-C++'s Mingw the default compiler: export CC='C:/Dev-C++/bin/gcc' export CXX='C:/Dev-C++/bin/g++' 4. Tell configure that you're configuring for Mingw. ./configure --target=i586-pc-mingw32 --build=i586-pc-mingw32 --host=i586-pc-mingw32 make install |
|
From: Christian W. <Chr...@vo...> - 2002-06-17 09:46:12
|
Hi List,
I try to learn the handling with DLLs and the Project I've wrote doesnt
work...
Has anyone some Ideas what I've made wrong ???
Kind Regards
CHW
Here the code:
#include <windows.h>
#include <TCHAR.h>
#include <stdio.h>
static HINSTANCE hLibrary ;
int main(int argc, char* argv[])
{
bool bT;
LPCSTR test;
typedef bool (*lpTest)(void);
typedef LPCSTR (*lpTest2)(void);
typedef char* (*lpTest3) (char*);
lpTest fnTest;
lpTest2 fnTest2;
lpTest3 fnTest3;
//DLL einbinden
if ((hLibrary = LoadLibrary (TEXT("DLL.DLL"))) == NULL)
{
MessageBox (NULL, TEXT ("Can't load DLL.DLL."), "hjjhkj", 0)
;
return -1 ;
};
fnTest = (lpTest) GetProcAddress(hLibrary, _T("_Test1@0"));
if (fnTest != NULL)
{
printf("juhu\n");
bT = fnTest();
};
FreeLibrary(hLibrary); // Unload DLL from memory
if ((hLibrary = LoadLibrary (TEXT("DLL.DLL"))) == NULL)
{
MessageBox (NULL, TEXT ("Can't load DLL.DLL."), "hjjhkj", 0)
;
return -1 ;
};
fnTest2 = (lpTest2) GetProcAddress(hLibrary, _T("Test2"));
if (fnTest != NULL)
{
printf("juhu2\n");
test = fnTest2();
};
FreeLibrary(hLibrary); // Unload DLL from memory
if ((hLibrary = LoadLibrary (TEXT("DLL.DLL"))) == NULL)
{
MessageBox (NULL, TEXT ("Can't load DLL.DLL."), "hjjhkj", 0)
;
return -1 ;
};
fnTest3 = (lpTest3) GetProcAddress(hLibrary, _T("_Test3@4"));
if (fnTest3 != NULL)
{
char szTest[400];
*szTest = 0;
printf("juhu3");
strcpy (szTest, fnTest3("hallo welt\0"));
printf("%s", szTest);
};
FreeLibrary(hLibrary); // Unload DLL from memory
getchar();
return 0;
}
Here the DLL:
#include <windows.h>
#include <string.h>
#ifdef __cplusplus
#define EXPORT extern "C" __declspec (dllexport)
#else
#define EXPORT __declspec (dllexport)
#endif
EXPORT BOOL CALLBACK TestA();
#define TestA Test1
EXPORT LPCSTR CALLBACK TestB();
#define TestB Test2
EXPORT char* CALLBACK TestC(char*);
#define TestC Test3
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
EXPORT BOOL CALLBACK TestA(void)
{
return TRUE;
};
EXPORT LPCSTR TestB(void)
{
return "Test\0";
};
EXPORT char* CALLBACK TestC(char *lpcStr)
{
MessageBox(NULL, lpcStr, "test", MB_OK);
return lpcStr;
};
|
|
From: Abhijit S. <mu...@gm...> - 2002-06-17 08:44:00
|
Most source packages I download need me to run 'configure' before 'make'. Are conigure's windows binaries available for download to run with GCC-ports? Where do I get them? I'm really confused. I downloaded bash sources, assuming I can compile them (maybe with modifications), using Cygwin or MingW, and don't know what to do... any help will be appreciated. Thanks. -------------------------- http://mudeth.tripod.com |
|
From: Abhijit S. <mu...@gm...> - 2002-06-16 12:08:49
|
> do
> {
> GetExitCodeThread(hThread, &exit_code);
> } while(exit_code == STILL_ACTIVE);
> cout << "\n Thread " << i+1 << " has completed.\n";
I almost fergot... polling GetExitCodeThread() can be very CPU intensive, so
you might want to Sleep() in between polls, as in
do
{
GetExitCodeThread(hThread, &exit_code);
Sleep(DELAY);
} while(exit_code == STILL_ACTIVE);
DELAY can be 100 or more or less, I dunno, depending on the need for speed.
I don't know of any synchornous method to do this.
--------------------------
http://mudeth.tripod.com
|
|
From: Abhijit S. <mu...@gm...> - 2002-06-16 06:55:43
|
> Is there any function call like join() of java, in
> C++.
GetExitCodeThread(HANDLE, LPDWORD exit_code) tells you the exit code of the
thread. exit_code is STILL_ACTIVE if the thread is running, the actual exit
code if it has completed. For example,
#include <iostream.h>
#include <windows.h>
DWORD WINAPI ThreadProc(LPVOID );
int main()
{
for(int i = 0;i<3;i++)
{
DWORD threadId;
DWORD exit_code;
HANDLE hThread;
hThread = CreateThread(NULL,0,ThreadProc,&i,0,&threadId);
if(hThread == NULL)
cout << "\n Thread has not been created";
else
{
//_getch();
cout << "\n Thread has been created successfully.";
do
{
GetExitCodeThread(hThread, &exit_code);
} while(exit_code == STILL_ACTIVE);
cout << "\n Thread " << i+1 << " has completed.\n";
}
}
return 0;
}
DWORD WINAPI ThreadProc( LPVOID lpParam )
{
cout << "\n Entered threadProc...";
MessageBox(NULL,"sample output","",MB_OK);
for(int i = 0;i<10;i++)
{
cout << "\n thread output is:"<<HIWORD(lpParam) << ".."<<i;
}
return 0;
}
--------------------------
http://mudeth.tripod.com
|
|
From: Raghunath Marella.S <ms...@ya...> - 2002-06-16 05:21:51
|
Thanks Abhijit.
Is there any function call like join() of java, in
C++.
regards,
Raghunath
--- Abhijit Shylanath <mu...@gm...> wrote:
> You're not giving enough time for the threads to
> start. As soon as you
> create them, the main() process ends, so the threads
> are destroyed. Put a
> delay, either using a Sleep() or MessageBox()
> function, as show below. Try
> clicking the OK button in the 'waiting' message-box
> to see what happens to
> the threads, they're stopped without being
> completed. The new code is here:
>
> #include <iostream.h>
> #include <stdlib.h>
> #include <windows.h>
> #include <conio_mingw.h>
>
> DWORD WINAPI ThreadProc(LPVOID );
>
> int main()
> {
> for(int i = 0;i<3;i++)
> {
> DWORD threadId;
> HANDLE hThread;
>
> hThread =
> CreateThread(NULL,0,ThreadProc,&i,0,&threadId);
> if(hThread == NULL)
> cout << "\n Thread has not been created";
> else
> {
> //_getch();
> cout << "\n Thread has been created
> successfully.";
> }
> }
> MessageBox(NULL, "Click to close.", "Waiting",
> MB_OK);
> return 0;
> }
>
> DWORD WINAPI ThreadProc( LPVOID lpParam )
> {
> cout << "\n Entered threadProc...";
> MessageBox(NULL,"sample output","",MB_OK);
>
> for(int i = 0;i<10;i++)
> {
> cout << "\n thread output is:"<<HIWORD(lpParam)
> << ".."<<i;
> }
>
> return 0;
> }
>
> PS: Note that using void main() is WRONG!!! It
> should be int main(), and int
> only. It may run on some platforms, but it won't run
> on all. Also, in MingW,
> you have to use conio_mingw.h, but this is very
> platform and compiler
> specific.
>
>
>
_______________________________________________________________
>
> Sponsored by:
> ThinkGeek at http://www.ThinkGeek.com/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
>
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
|
|
From: Abhijit S. <mu...@gm...> - 2002-06-16 05:09:07
|
You're not giving enough time for the threads to start. As soon as you
create them, the main() process ends, so the threads are destroyed. Put a
delay, either using a Sleep() or MessageBox() function, as show below. Try
clicking the OK button in the 'waiting' message-box to see what happens to
the threads, they're stopped without being completed. The new code is here:
#include <iostream.h>
#include <stdlib.h>
#include <windows.h>
#include <conio_mingw.h>
DWORD WINAPI ThreadProc(LPVOID );
int main()
{
for(int i = 0;i<3;i++)
{
DWORD threadId;
HANDLE hThread;
hThread = CreateThread(NULL,0,ThreadProc,&i,0,&threadId);
if(hThread == NULL)
cout << "\n Thread has not been created";
else
{
//_getch();
cout << "\n Thread has been created successfully.";
}
}
MessageBox(NULL, "Click to close.", "Waiting", MB_OK);
return 0;
}
DWORD WINAPI ThreadProc( LPVOID lpParam )
{
cout << "\n Entered threadProc...";
MessageBox(NULL,"sample output","",MB_OK);
for(int i = 0;i<10;i++)
{
cout << "\n thread output is:"<<HIWORD(lpParam) << ".."<<i;
}
return 0;
}
PS: Note that using void main() is WRONG!!! It should be int main(), and int
only. It may run on some platforms, but it won't run on all. Also, in MingW,
you have to use conio_mingw.h, but this is very platform and compiler
specific.
|
|
From: Ramana K. <ra...@my...> - 2002-06-16 01:40:28
|
Well, that is very weird indeed. I have played around a bit with your code
and have found a solution, but a better explaination would be welcome. I
tried
cout << 2147483648;
and the complier gave me a warning that the integer was so large it would
have to be unsigned. so i decided to make the result of the Power(int,int)
function unsigned.
Thus:
instead of
cout << "Power(" << a << "," << n+1 << ")= " << Power(a,n+1) << endl;"
you have this:
cout << "Power(" << a << "," << n+1 << ")= " << (unsigned) Power(a,n+1)
<< endl;
and it works fine.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Jose Gana
Sent: Sunday, 16 June 2002 1:30 AM
To: dev...@li...
Subject: [Dev-C++] weird result
Hi!
Sorry if it is too obvious!
I am new in C++. I got 2^30= Power(2,30)= - 2147483648 in stead of +
2147483648 in my program.
I must have done something wrong. But I can figure it out. Can somebody
help me out?
#include <iostream>
#include <cstdlib>
using namespace std;
int Power(int a, int n);
int main()
{
int a=2, n=30; //int limit == 4294967295;
// Power(2,30)==1073741824
// Power(2,31)==2147483648
// Power(2,32)==4294967296 out of limit
=> Power(2,32)==0
cout << "Power(" << a << "," << n << ")= " << Power(a,n) << endl;
cout << "Power(" << a << "," << n+1 << ")= " << Power(a,n+1) << endl;
system("PAUSE");
return 0;
}
int Power(int a, int n)
{
int i=1, r=1;
for (i=1;i<=n;i++)
{
r=r*a;
}
return r;
}
I am using Dev-C++ version 4.01. in windows XP
Thank you for your help to this matter.
Jose Gana
Santiago, Chile.
----------------------------------------------------------------------------
--
Join the worlds largest e-mail service with MSN Hotmail. Click Here
_______________________________________________________________ Don't miss
the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las
Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
_______________________________________________ Dev-cpp-users mailing list
Dev...@li...
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|