dev-cpp-users Mailing List for Dev-C++ (Page 241)
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: Tim S. <ti...@we...> - 2004-03-10 08:24:15
|
Hi Oladipo, You wrote: > when replying posts, could you pls help out those of us with > space-limited mail accounts to strip out whatever isn't important in > the post?=20 Btw, you don't need to save the mails, there is a archive on Sourceforge of the mailinglist: http://sourceforge.net/mailarchive/forum.php?forum_id=3D6572 > for instance, the 'this mail is sponsored by SF.net..' thing. please, > just help us out, okay. some of these things get very long and very > large.=20 I think it would even help if most people would quote right like described on http://www.netmeister.org/news/learn2quote.html greetings Tim --=20 http://we-are-teh-b.org/~tim/borg.key http://learn.to/quote |
|
From: <gen...@ya...> - 2004-03-10 07:20:32
|
hey all, when replying posts, could you pls help out those of us with space-limited mail accounts to strip out whatever isn't important in the post? for instance, the 'this mail is sponsored by SF.net..' thing. please, just help us out, okay. some of these things get very long and very large. advTHANKSance. the dypester --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now |
|
From: Per W. <pw...@ia...> - 2004-03-10 06:09:33
|
The only real advantage of a static object is that you don't allocate it which might be an advantage in a small embedded environment - you might write the application without support for dynamic memory. If the class on the other hand has only static members, you don't have to send the "this" pointer to the member functions. A very minor improvement that is mostly eaten up for a number of compilers by loss of a couple of compiler optimizations specially added for C++ object accesses. If the class is using static methods it has to use static member variables too, which is a bit bothersome, and you don't get to use a constructor. Some notable advantages of Singleton objects are: 1) Constructor is run after main, so it might be easier to debug. 2) Programmer control when constructor is run, which is advantageous if multiple classes relates to each other, and you want to control order of construction. 3) If you later realizes that you need more than one object of a class, it tends to be easier to modify the program if the class was originally using the Singleton pattern. A solution with static methods requires heavy rewrites. /Per W On Tue, 9 Mar 2004, Doug MacDonald wrote: > This is thread is especially interesting to me, as I'm working on a > project that uses Singleton for a number of its classes, and I'm not > sure it is warranted. No one has addressed Michael's original question: > what are the tradeoffs between using Singleton and just making the class > (or all of its members) static? I'd like to know about others' > experiences with Singleton, in case it's advisable to move from > Singleton-based classes to static classes in my project. > > Doug > > > > |
|
From: Doug M. <dou...@al...> - 2004-03-10 03:29:42
|
This is thread is especially interesting to me, as I'm working on a project that uses Singleton for a number of its classes, and I'm not sure it is warranted. No one has addressed Michael's original question: what are the tradeoffs between using Singleton and just making the class (or all of its members) static? I'd like to know about others' experiences with Singleton, in case it's advisable to move from Singleton-based classes to static classes in my project. Doug |
|
From: Per W. <pw...@ia...> - 2004-03-09 23:50:50
|
Oops, missed your mail ;) /Per W On Tue, 9 Mar 2004, P.D. van Zelst wrote: > There's an excellent pattern for this, it's called "Singleton"... look it= up > (try google for "singleton design pattern" for instance). > > Hope this helped, > > > Paul > > ________________________________ > > From: dev...@li... > [mailto:dev...@li...] On Behalf Of Michael > Stather > Sent: Tuesday, March 09, 2004 9:00 PM > To: dev...@li... > Subject: [Dev-C++] Design decision in C++ > > > Hi, > > I=B4ve thought about a class-design for one of my projects. > I=B4ve several big codeblocks like "compiler" which are seperated into > classes. > However, of this classes there is only one instance, like TheCompiler. > So I thought of implementing this class using static methods rather than = a > regular class (I don=B4t need constructors/destructors). > So, is it better do use a regular class and create one instance of it or = to > use a class which has only static methods (also easier) > Where are the caveats? > > thanks for your help > > Michael Stather > > > > > ---------------------------- |
|
From: Per W. <pw...@ia...> - 2004-03-09 23:50:23
|
I would instanciate a single object using the singleton design pattern.
Make the only constructor private, and add a public static method to
create and retrieve this single instance:
class MyClass {
private:
static My>Class *myself;
MyClass(); // Note constructor private!
public:
static MyClass* getInstance() {
if (!myself) myself =3D new MyClass;
return myself;
}
};
/Per W
On Tue, 9 Mar 2004, Michael Stather wrote:
> Hi,
>
> I=B4ve thought about a class-design for one of my projects.
> I=B4ve several big codeblocks like "compiler" which are seperated into
> classes.
> However, of this classes there is only one instance, like TheCompiler.
> So I thought of implementing this class using static methods rather than =
a
> regular class (I don=B4t need constructors/destructors).
> So, is it better do use a regular class and create one instance of it or =
to
> use a class which has only static methods (also easier)
> Where are the caveats?
>
> thanks for your help
>
> Michael Stather
>
|
|
From: <or...@vp...> - 2004-03-09 21:06:05
|
Josep Subirana wrote: > Do you know how to get the directory where your c++ application is runn= ing > in? > This should be a simple question for most experienced c++ programmers! __argv[0] has the entire path to your application binary. For example: "C:\Programs\MyProg.exe" All you need to do, is to strip off "MyProg.exe" (your app name). I suspect you wish to save config files, eh? :) (Well, at least that was why I needed to search for a solution a few=20 years ago, and that's what I found). One last note: I used __argv because if you have a WinMain in you=20 program, then you don't have argv simply. But __argv is always present=20 (as well as __argc), it is global, and has the same contents as argv and=20 argc would (at least in MinGW). -- Greetings, Bal=E1zs |
|
From: P.D. v. Z. <pd...@xs...> - 2004-03-09 20:53:46
|
There's an excellent pattern for this, it's called "Singleton"... look = it up (try google for "singleton design pattern" for instance). =20 Hope this helped, =20 =20 Paul ________________________________ From: dev...@li... [mailto:dev...@li...] On Behalf Of Michael Stather Sent: Tuesday, March 09, 2004 9:00 PM To: dev...@li... Subject: [Dev-C++] Design decision in C++ Hi, =20 I=B4ve thought about a class-design for one of my projects. I=B4ve several big codeblocks like "compiler" which are seperated into classes. However, of this classes there is only one instance, like TheCompiler. So I thought of implementing this class using static methods rather than = a regular class (I don=B4t need constructors/destructors). So, is it better do use a regular class and create one instance of it or = to use a class which has only static methods (also easier) Where are the caveats? =20 thanks for your help =20 Michael Stather |
|
From: Jay B. <jay...@ni...> - 2004-03-09 20:26:44
|
[snip] =09 I =B4ve thought about a class-design for one of my projects. I=B4ve several big codeblocks like "compiler" which are seperated into = classes. However, of this classes there is only one instance, like TheCompiler. So I thought of implementing this class using static methods rather = than a regular class (I don=B4t need constructors/destructors). So, is it better do use a regular class and create one instance of it = or to use a class which has only static methods (also easier) Where are the caveats? =20 [/snip] =20 Regular class? |
|
From: Michael S. <mic...@nu...> - 2004-03-09 20:16:58
|
Hi, =20 I=B4ve thought about a class-design for one of my projects. I=B4ve several big codeblocks like "compiler" which are seperated into classes. However, of this classes there is only one instance, like TheCompiler. So I thought of implementing this class using static methods rather than = a regular class (I don=B4t need constructors/destructors). So, is it better do use a regular class and create one instance of it or = to use a class which has only static methods (also easier) Where are the caveats? =20 thanks for your help =20 Michael Stather |
|
From: Josep S. <sub...@ar...> - 2004-03-09 19:53:27
|
Hi Per,
>> strcpy(flag,"--datadir=");
>> getcwd(flag+strlen(flag),((size_t)size) - strlen(flag));
>> if (strlen(flag) < size-5)
>> strcat(flag,"\\data");
>> else
>> fail - too small buffer.
Thank you for streamlining the code! Your version is much more elegant than
my "beginner" one.
I will try now to use the following function, in order to assure that the
size with which the buffer char array is defined, is enough to contain a
path...
size = pathconf(".", _PC_PATH_MAX);
Thanks,
Josep
-----Ursprungliche Nachricht-----
Von: dev...@li...
[mailto:dev...@li...]Im Auftrag von Per
Westermark
Gesendet: Dienstag, 9. Marz 2004 19:35
An: Josep Subirana
Cc: DEV-C++
Betreff: Re: AW: [Dev-C++] How to get application directory?
Wrong use of getcwd - it doesn't allocate any memory. You have to supply
the memory it should use.
When you create a shortcut, you can specify the working directory, i.e.
where the program should be started.
getcwd() will - on startup of the program - always return this directory.
However, using getcwd() you may use multiple shortcuts that specifies
different working directories. getcwd() will then return different paths.
However, if a user has specified two different working directories, I
thinkt that is an expected behaviour.
/Per W
On Tue, 9 Mar 2004, Josep Subirana wrote:
> >>in Win32 I get
> >>the path to the running application like this:
> >>
> >>char szBuf[512];
> >>GetModuleFileName(NULL, szBuf, 512);
> >>
> >>(if the call succeeded, szBuf now contains the full path to the current
> >>module (executable))
>
> Hi Paul,
>
> Thanks alot for your hint! I'm a bit new to API and I don't know with c++
if
> I have to declare this function (GetModuleFileName()) in a header or what
I
> do have to do in order to being able to use this function you describe.
> Could you help me on that too? (If I need a function declaration in my
> header, could you please post it with the right variable types or point me
> to a website where i can find those API function declarations???)
>
> Thanks again,
>
> Josep
>
> BTW,
> I've tried with the following code, but I don't know if the *working
> directory* is always, at the beginning, the same as the directory where
the
> .exe file lies!!!
>
> const long size = 1000L;
> //char *buf;
char flag[size];
> //char *cwd;
> //size = pathconf(".", _PC_PATH_MAX);
>
strcpy(flag,"--datadir=");
getcwd(flag+strlen(flag),((size_t)size) - strlen(flag));
if (strlen(flag) < size-5)
strcat(flag,"\\data");
else
fail - too small buffer.
> //cwd = getcwd(buf, (size_t)size) ;
>
> //char flag[size] = "--datadir=";
> //char *subdir = "\\data";
> //char *foo = strcat (buf, subdir);
> //strcat(flag, foo);
>
> int argn = 3;
> char *arg[] = {
> argv[0], "c++", flag
> };
>
> mysql_server_init(argn, arg, (char **)server_groups);
>
> -----Ursprungliche Nachricht-----
> Von: dev...@li...
> [mailto:dev...@li...]Im Auftrag von P.D.
> van Zelst
> Gesendet: Dienstag, 9. Marz 2004 17:33
> Cc: dev...@li...
> Betreff: RE: [Dev-C++] How to get application directory?
>
>
> For the original poster: Don't know if it will help you, but in Win32 I
get
> the path to the running application like this:
>
> char szBuf[512];
> GetModuleFileName(NULL, szBuf, 512);
>
> (if the call succeeded, szBuf now contains the full path to the current
> module (executable))
>
> To Per:
> Thanks :D I forgot that lots of things are file (or pseudo-file) based in
> Linux. But it appears that /proc/self/exe is a symlink to the current
> binary... which brings me to a second problem: How do I get the target of
a
> symlink as a string or something :) Whenever I'm programming for Linux I
> constantly run into problems, cause I have no clue where to get MSDN-like
> information for Linux or POSIX.
>
> Regards,
>
>
> Paul
>
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf Of Per
> Westermark
> Sent: Tuesday, March 09, 2004 1:14 PM
> To: sub...@ar...
> Cc: dev...@li...
> Subject: Re: [Dev-C++] How to get application directory?
>
> If the application was started with a path, you might retrieve it as
> the arg[0] parameter of main().
>
> If not, you have to search the path for an application with the correct
> name. I don't think there is a standard function to perform this. If I'm
> wrong, I very much want to know the name of the function, since it would
> be useful :)
>
> On Linux, it is possible to heck in the /proc filesystem. There exists a
> symbolic link:
> /proc/<process_id>/exe -> /my/running/binary
> That will specify which binary that is running.
>
> It may also be accessed as:
> /proc/self/exe -> /my/running/binary
> to avoid the extra trouble of retrieving process id and dynamically create
> the path to the symbolic link.
>
> /Per W
>
> On Tue, 9 Mar 2004 sub...@ar... wrote:
>
> > What I actually wanted is the directory where the binary application is
> stored...
> > Anybody knows how to get it?
> >
> > Thanks again,
> > Josep
> >
> > ----- Original Nachricht ----
> > Von: Per Westermark <pw...@ia...>
> > An: Kevin Wood <ke...@me...>
> > Datum: 09.03.2004 10:28
> > Betreff: Re: [Dev-C++] How to get application directory?
> >
> > > The question was which directory the application is running in - not
> where
> > > the application binary is stored.
> > >
> > > /Per W
> > >
> > > On Tue, 9 Mar 2004, Kevin Wood wrote:
> > >
> > > > getcwd() returns the current working directory, which is not
> necessarily
> > > > the same as the directory in which the application resides.
> > > >
> > > > At 08:10 09/03/04, Per Westermark wrote:
> > > > >getcwd() or _getcwd().
> > > > >
> > > > >/Per W
> > > > >
> > > > >On Tue, 9 Mar 2004, Josep Subirana wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Do you know how to get the directory where your c++ application
is
> > > running
> > > > > > in?
> > > > > > This should be a simple question for most experienced c++
> > > programmers!
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Josep
> > > > > >
> > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.Net email is sponsored by: IBM Linux Tutorials
> > > > Free Linux tutorial presented by Daniel Robbins, President and CEO
of
> > > > GenToo technologies. Learn everything from fundamentals to system
> > > >
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > > > _______________________________________________
> > > > Dev-cpp-users mailing list
> > > > Dev...@li...
> > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> > > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by: IBM Linux Tutorials
> > > Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > > GenToo technologies. Learn everything from fundamentals to system
> > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > > _______________________________________________
> > > Dev-cpp-users mailing list
> > > Dev...@li...
> > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> > >
> >
> >
> >
> >
> >
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Per W. <pw...@ia...> - 2004-03-09 18:52:09
|
Wrong use of getcwd - it doesn't allocate any memory. You have to supply
the memory it should use.
When you create a shortcut, you can specify the working directory, i.e.
where the program should be started.
getcwd() will - on startup of the program - always return this directory.
However, using getcwd() you may use multiple shortcuts that specifies
different working directories. getcwd() will then return different paths.
However, if a user has specified two different working directories, I
thinkt that is an expected behaviour.
/Per W
On Tue, 9 Mar 2004, Josep Subirana wrote:
> >>in Win32 I get
> >>the path to the running application like this:
> >>
> >>char szBuf[512];
> >>GetModuleFileName(NULL, szBuf, 512);
> >>
> >>(if the call succeeded, szBuf now contains the full path to the current
> >>module (executable))
>
> Hi Paul,
>
> Thanks alot for your hint! I'm a bit new to API and I don't know with c++ if
> I have to declare this function (GetModuleFileName()) in a header or what I
> do have to do in order to being able to use this function you describe.
> Could you help me on that too? (If I need a function declaration in my
> header, could you please post it with the right variable types or point me
> to a website where i can find those API function declarations???)
>
> Thanks again,
>
> Josep
>
> BTW,
> I've tried with the following code, but I don't know if the *working
> directory* is always, at the beginning, the same as the directory where the
> .exe file lies!!!
>
> const long size = 1000L;
> //char *buf;
char flag[size];
> //char *cwd;
> //size = pathconf(".", _PC_PATH_MAX);
>
strcpy(flag,"--datadir=");
getcwd(flag+strlen(flag),((size_t)size) - strlen(flag));
if (strlen(flag) < size-5)
strcat(flag,"\\data");
else
fail - too small buffer.
> //cwd = getcwd(buf, (size_t)size) ;
>
> //char flag[size] = "--datadir=";
> //char *subdir = "\\data";
> //char *foo = strcat (buf, subdir);
> //strcat(flag, foo);
>
> int argn = 3;
> char *arg[] = {
> argv[0], "c++", flag
> };
>
> mysql_server_init(argn, arg, (char **)server_groups);
>
> -----Ursprungliche Nachricht-----
> Von: dev...@li...
> [mailto:dev...@li...]Im Auftrag von P.D.
> van Zelst
> Gesendet: Dienstag, 9. Marz 2004 17:33
> Cc: dev...@li...
> Betreff: RE: [Dev-C++] How to get application directory?
>
>
> For the original poster: Don't know if it will help you, but in Win32 I get
> the path to the running application like this:
>
> char szBuf[512];
> GetModuleFileName(NULL, szBuf, 512);
>
> (if the call succeeded, szBuf now contains the full path to the current
> module (executable))
>
> To Per:
> Thanks :D I forgot that lots of things are file (or pseudo-file) based in
> Linux. But it appears that /proc/self/exe is a symlink to the current
> binary... which brings me to a second problem: How do I get the target of a
> symlink as a string or something :) Whenever I'm programming for Linux I
> constantly run into problems, cause I have no clue where to get MSDN-like
> information for Linux or POSIX.
>
> Regards,
>
>
> Paul
>
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf Of Per
> Westermark
> Sent: Tuesday, March 09, 2004 1:14 PM
> To: sub...@ar...
> Cc: dev...@li...
> Subject: Re: [Dev-C++] How to get application directory?
>
> If the application was started with a path, you might retrieve it as
> the arg[0] parameter of main().
>
> If not, you have to search the path for an application with the correct
> name. I don't think there is a standard function to perform this. If I'm
> wrong, I very much want to know the name of the function, since it would
> be useful :)
>
> On Linux, it is possible to heck in the /proc filesystem. There exists a
> symbolic link:
> /proc/<process_id>/exe -> /my/running/binary
> That will specify which binary that is running.
>
> It may also be accessed as:
> /proc/self/exe -> /my/running/binary
> to avoid the extra trouble of retrieving process id and dynamically create
> the path to the symbolic link.
>
> /Per W
>
> On Tue, 9 Mar 2004 sub...@ar... wrote:
>
> > What I actually wanted is the directory where the binary application is
> stored...
> > Anybody knows how to get it?
> >
> > Thanks again,
> > Josep
> >
> > ----- Original Nachricht ----
> > Von: Per Westermark <pw...@ia...>
> > An: Kevin Wood <ke...@me...>
> > Datum: 09.03.2004 10:28
> > Betreff: Re: [Dev-C++] How to get application directory?
> >
> > > The question was which directory the application is running in - not
> where
> > > the application binary is stored.
> > >
> > > /Per W
> > >
> > > On Tue, 9 Mar 2004, Kevin Wood wrote:
> > >
> > > > getcwd() returns the current working directory, which is not
> necessarily
> > > > the same as the directory in which the application resides.
> > > >
> > > > At 08:10 09/03/04, Per Westermark wrote:
> > > > >getcwd() or _getcwd().
> > > > >
> > > > >/Per W
> > > > >
> > > > >On Tue, 9 Mar 2004, Josep Subirana wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Do you know how to get the directory where your c++ application is
> > > running
> > > > > > in?
> > > > > > This should be a simple question for most experienced c++
> > > programmers!
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Josep
> > > > > >
> > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.Net email is sponsored by: IBM Linux Tutorials
> > > > Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > > > GenToo technologies. Learn everything from fundamentals to system
> > > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > > > _______________________________________________
> > > > Dev-cpp-users mailing list
> > > > Dev...@li...
> > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> > > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by: IBM Linux Tutorials
> > > Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > > GenToo technologies. Learn everything from fundamentals to system
> > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > > _______________________________________________
> > > Dev-cpp-users mailing list
> > > Dev...@li...
> > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> > >
> >
> >
> >
> >
> >
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Josep S. <sub...@ar...> - 2004-03-09 18:22:18
|
Hi Oliver, >>i would like to know how to run this embedded mysql together with dev-c= ++. I've put a .zip file on my website: http://www.subirana.de/embedded.zip with the Dev-C++ Project file + cpp files + libraries and includes + dll ...all you need to compile and run/test embedded mysql. This Dev-C++ proj= ect is an adaptation of the Visual-c++ project that comes with the mysql distribution. The libmysqld.a library works without problems with Dev-C++ (The libmysql.lib library that comes with the mysql distribution doesn't,= so I had to find a way to get a working one). You just have to compile the project and run it: you should get some information about the "paro" database, included by me for testing purposes in the "data" folder in thi= s .zip file, followed by a list of all the databases that embedded mysql finds in the data folder. It it doesn't work for you please don't hessitate to contact me again. The normal mysql is rather though for multi-user client-server applicatio= ns: it runs as a separate service and has be started before you can use your = c++ application that uses it. With EMBEDDED mysql in your dev-c++ programmes, you don't have to start mysql before you can run your programm... mysql doesn't even have to be installed on the machine you'll run your c++ application onto (it's already contained in your c++ programm). There are= 2 types of License for embedded mysql: the usual open source one (I think i= t's called GLP) and a commercial one if you don't want to realease your code with your programms (please see: www.mysql.org) An alternative to embedded mysql is: sqlite --> also an embedded database= , but mysql is the preferred database worldwide and can do a lot more thing= s than sqlite! -----Urspr=FCngliche Nachricht----- Von: Oliver Rogasch [mailto:o.r...@gm...] Gesendet: Dienstag, 9. M=E4rz 2004 17:11 An: Josep Subirana Betreff: Re: [Dev-C++] How to get application directory? Hello Joseph, i would like to know how to run this embedded mysql together with dev-c++= . Thx Oliver Rogasch |
|
From: Josep S. <sub...@ar...> - 2004-03-09 18:12:09
|
>>in Win32 I get
>>the path to the running application like this:
>>
>>char szBuf[512];
>>GetModuleFileName(NULL, szBuf, 512);
>>
>>(if the call succeeded, szBuf now contains the full path to the current
>>module (executable))
Hi Paul,
Thanks alot for your hint! I'm a bit new to API and I don't know with c++ if
I have to declare this function (GetModuleFileName()) in a header or what I
do have to do in order to being able to use this function you describe.
Could you help me on that too? (If I need a function declaration in my
header, could you please post it with the right variable types or point me
to a website where i can find those API function declarations???)
Thanks again,
Josep
BTW,
I've tried with the following code, but I don't know if the *working
directory* is always, at the beginning, the same as the directory where the
.exe file lies!!!
const long size = 1000L;
char *buf;
char *cwd;
//size = pathconf(".", _PC_PATH_MAX);
cwd = getcwd(buf, (size_t)size) ;
char flag[size] = "--datadir=";
char *subdir = "\\data";
char *foo = strcat (buf, subdir);
strcat(flag, foo);
int argn = 3;
char *arg[] = {
argv[0], "c++", flag
};
mysql_server_init(argn, arg, (char **)server_groups);
-----Ursprungliche Nachricht-----
Von: dev...@li...
[mailto:dev...@li...]Im Auftrag von P.D.
van Zelst
Gesendet: Dienstag, 9. Marz 2004 17:33
Cc: dev...@li...
Betreff: RE: [Dev-C++] How to get application directory?
For the original poster: Don't know if it will help you, but in Win32 I get
the path to the running application like this:
char szBuf[512];
GetModuleFileName(NULL, szBuf, 512);
(if the call succeeded, szBuf now contains the full path to the current
module (executable))
To Per:
Thanks :D I forgot that lots of things are file (or pseudo-file) based in
Linux. But it appears that /proc/self/exe is a symlink to the current
binary... which brings me to a second problem: How do I get the target of a
symlink as a string or something :) Whenever I'm programming for Linux I
constantly run into problems, cause I have no clue where to get MSDN-like
information for Linux or POSIX.
Regards,
Paul
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Per
Westermark
Sent: Tuesday, March 09, 2004 1:14 PM
To: sub...@ar...
Cc: dev...@li...
Subject: Re: [Dev-C++] How to get application directory?
If the application was started with a path, you might retrieve it as
the arg[0] parameter of main().
If not, you have to search the path for an application with the correct
name. I don't think there is a standard function to perform this. If I'm
wrong, I very much want to know the name of the function, since it would
be useful :)
On Linux, it is possible to heck in the /proc filesystem. There exists a
symbolic link:
/proc/<process_id>/exe -> /my/running/binary
That will specify which binary that is running.
It may also be accessed as:
/proc/self/exe -> /my/running/binary
to avoid the extra trouble of retrieving process id and dynamically create
the path to the symbolic link.
/Per W
On Tue, 9 Mar 2004 sub...@ar... wrote:
> What I actually wanted is the directory where the binary application is
stored...
> Anybody knows how to get it?
>
> Thanks again,
> Josep
>
> ----- Original Nachricht ----
> Von: Per Westermark <pw...@ia...>
> An: Kevin Wood <ke...@me...>
> Datum: 09.03.2004 10:28
> Betreff: Re: [Dev-C++] How to get application directory?
>
> > The question was which directory the application is running in - not
where
> > the application binary is stored.
> >
> > /Per W
> >
> > On Tue, 9 Mar 2004, Kevin Wood wrote:
> >
> > > getcwd() returns the current working directory, which is not
necessarily
> > > the same as the directory in which the application resides.
> > >
> > > At 08:10 09/03/04, Per Westermark wrote:
> > > >getcwd() or _getcwd().
> > > >
> > > >/Per W
> > > >
> > > >On Tue, 9 Mar 2004, Josep Subirana wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Do you know how to get the directory where your c++ application is
> > running
> > > > > in?
> > > > > This should be a simple question for most experienced c++
> > programmers!
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Josep
> > > > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by: IBM Linux Tutorials
> > > Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > > GenToo technologies. Learn everything from fundamentals to system
> > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > > _______________________________________________
> > > Dev-cpp-users mailing list
> > > Dev...@li...
> > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> > >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: IBM Linux Tutorials
> > Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > GenToo technologies. Learn everything from fundamentals to system
> > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
>
>
>
>
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Niklas W. <nik...@te...> - 2004-03-09 17:04:26
|
Hello,
When I do like this
While(cin >> number)
{
..
}
I would like to be able to end this while loop by pressing Ctrl-Z or
Ctrl-D.
But I can't when I create a dos window in DevC++.
Can anyone help?
Maybe some other key combination or maybe some setting in DevC++?
Regards
Niklas
|
|
From: Per W. <pw...@ia...> - 2004-03-09 16:57:05
|
To read contents of a link on Linux, just call readlink() To reatrieve information about a link - instead of the file it points to, use lstat() instead of stat(). /Per W On Tue, 9 Mar 2004, P.D. van Zelst wrote: > For the original poster: Don't know if it will help you, but in Win32 I get > the path to the running application like this: > > char szBuf[512]; > GetModuleFileName(NULL, szBuf, 512); > > (if the call succeeded, szBuf now contains the full path to the current > module (executable)) > > To Per: > Thanks :D I forgot that lots of things are file (or pseudo-file) based in > Linux. But it appears that /proc/self/exe is a symlink to the current > binary... which brings me to a second problem: How do I get the target of a > symlink as a string or something :) Whenever I'm programming for Linux I > constantly run into problems, cause I have no clue where to get MSDN-like > information for Linux or POSIX. > > Regards, > > > Paul > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf Of Per > Westermark > Sent: Tuesday, March 09, 2004 1:14 PM > To: sub...@ar... > Cc: dev...@li... > Subject: Re: [Dev-C++] How to get application directory? > > If the application was started with a path, you might retrieve it as > the arg[0] parameter of main(). > > If not, you have to search the path for an application with the correct > name. I don't think there is a standard function to perform this. If I'm > wrong, I very much want to know the name of the function, since it would > be useful :) > > On Linux, it is possible to heck in the /proc filesystem. There exists a > symbolic link: > /proc/<process_id>/exe -> /my/running/binary > That will specify which binary that is running. > > It may also be accessed as: > /proc/self/exe -> /my/running/binary > to avoid the extra trouble of retrieving process id and dynamically create > the path to the symbolic link. > > /Per W > > On Tue, 9 Mar 2004 sub...@ar... wrote: > > > What I actually wanted is the directory where the binary application is > stored... > > Anybody knows how to get it? > > > > Thanks again, > > Josep > > > > ----- Original Nachricht ---- > > Von: Per Westermark <pw...@ia...> > > An: Kevin Wood <ke...@me...> > > Datum: 09.03.2004 10:28 > > Betreff: Re: [Dev-C++] How to get application directory? > > > > > The question was which directory the application is running in - not > where > > > the application binary is stored. > > > > > > /Per W > > > > > > On Tue, 9 Mar 2004, Kevin Wood wrote: > > > > > > > getcwd() returns the current working directory, which is not > necessarily > > > > the same as the directory in which the application resides. > > > > > > > > At 08:10 09/03/04, Per Westermark wrote: > > > > >getcwd() or _getcwd(). > > > > > > > > > >/Per W > > > > > > > > > >On Tue, 9 Mar 2004, Josep Subirana wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > > Do you know how to get the directory where your c++ application is > > > running > > > > > > in? > > > > > > This should be a simple question for most experienced c++ > > > programmers! > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Josep > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.Net email is sponsored by: IBM Linux Tutorials > > > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > > > GenToo technologies. Learn everything from fundamentals to system > > > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > > > _______________________________________________ > > > > Dev-cpp-users mailing list > > > > Dev...@li... > > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: IBM Linux Tutorials > > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > > GenToo technologies. Learn everything from fundamentals to system > > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: P.D. v. Z. <pa...@my...> - 2004-03-09 16:48:47
|
For the original poster: Don't know if it will help you, but in Win32 I get the path to the running application like this: char szBuf[512]; GetModuleFileName(NULL, szBuf, 512); (if the call succeeded, szBuf now contains the full path to the current module (executable)) To Per: Thanks :D I forgot that lots of things are file (or pseudo-file) based in Linux. But it appears that /proc/self/exe is a symlink to the current binary... which brings me to a second problem: How do I get the target of a symlink as a string or something :) Whenever I'm programming for Linux I constantly run into problems, cause I have no clue where to get MSDN-like information for Linux or POSIX. Regards, Paul -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Per Westermark Sent: Tuesday, March 09, 2004 1:14 PM To: sub...@ar... Cc: dev...@li... Subject: Re: [Dev-C++] How to get application directory? If the application was started with a path, you might retrieve it as the arg[0] parameter of main(). If not, you have to search the path for an application with the correct name. I don't think there is a standard function to perform this. If I'm wrong, I very much want to know the name of the function, since it would be useful :) On Linux, it is possible to heck in the /proc filesystem. There exists a symbolic link: /proc/<process_id>/exe -> /my/running/binary That will specify which binary that is running. It may also be accessed as: /proc/self/exe -> /my/running/binary to avoid the extra trouble of retrieving process id and dynamically create the path to the symbolic link. /Per W On Tue, 9 Mar 2004 sub...@ar... wrote: > What I actually wanted is the directory where the binary application is stored... > Anybody knows how to get it? > > Thanks again, > Josep > > ----- Original Nachricht ---- > Von: Per Westermark <pw...@ia...> > An: Kevin Wood <ke...@me...> > Datum: 09.03.2004 10:28 > Betreff: Re: [Dev-C++] How to get application directory? > > > The question was which directory the application is running in - not where > > the application binary is stored. > > > > /Per W > > > > On Tue, 9 Mar 2004, Kevin Wood wrote: > > > > > getcwd() returns the current working directory, which is not necessarily > > > the same as the directory in which the application resides. > > > > > > At 08:10 09/03/04, Per Westermark wrote: > > > >getcwd() or _getcwd(). > > > > > > > >/Per W > > > > > > > >On Tue, 9 Mar 2004, Josep Subirana wrote: > > > > > > > > > Hi, > > > > > > > > > > Do you know how to get the directory where your c++ application is > > running > > > > > in? > > > > > This should be a simple question for most experienced c++ > > programmers! > > > > > > > > > > Thanks, > > > > > > > > > > Josep > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: IBM Linux Tutorials > > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > > GenToo technologies. Learn everything from fundamentals to system > > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IBM Linux Tutorials > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > GenToo technologies. Learn everything from fundamentals to system > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: <gen...@ya...> - 2004-03-09 14:38:43
|
hey, i think you're way over my head with this one. however, what i think is: you probably never included the <windows.h> header file, or else how on earth could it say it doesn't understand 'CALLBACK'. my guess is you probably built the application with the Borland equivalent of AppWizard. sorry, man, for now, dev-c++ only compiles native Win32 programs. application layers like VCL, OWL, and MFC have very little chance of working when built with dev-c++. if you want to learn Win32 coding 'the hard way', you can try using the tutorials at http://winprog.net. or you can use a toolkit like wxWidgets (www.wxwindows.org) or the FOX toolkit (www.fox-toolkit.org). --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now |
|
From: <cx...@vi...> - 2004-03-09 13:41:26
|
webmaster:
ÄúºÃ!
ÎÒÊÇÒ»Ãû³õѧÕߣ¬ÔÚѧϰ Dev-C++ ʱ£¬Ï£ÍûÄܹ»µÃµ½¸ü¶àµÄÔÚÏß°ïÖú£¬ÀýÈ磺Àà¡¢º¯Êý¡¢Ä£°åµÈµÄÓ÷¨¡¢Àý×Ó......¡£
ѯÎÊ: ÔÚÄÄÀï¿ÉÒÔÕÒµ½¸ü¶àµÄÔÚÏß°ïÖú£¿
¾´Çë´Í½Ì£¡Ð»Ð»£¡
______________________________________
===================================================================
|
|
From: Daniel G. <sp...@ho...> - 2004-03-09 13:03:35
|
Thanks Per, I think that example explains things better.
Daniel
:)
>From: Per Westermark <pw...@ia...>
>To: Daniel Glenfield <sp...@ho...>
>CC: stu...@li..., <Dev...@li...>
>Subject: Re: [Dev-C++] protected and private in c++ classes
>Date: Tue, 9 Mar 2004 12:59:44 +0100 (CET)
>
>I wrote terse, but was actually correct:
>"Private is only for methods of the class" as in: privately declared
>member fields and methods may only be accessed by members of that class :)
>
>I didn't say that only methods may use private. I meant that only methods
>of that class may acccess any private fields, methods, constructors, ...
>
>I don't think it's correct to say that methods are usually public. There
>are just as large reasons to keep methods protected or private as there
>are to keep variables protected or private.
>
>I think you missed a bit about inherritance of access rights to protected
>fields. The protected declarations will continue to be protected for
>multiple generations, unless one of the inherritances stops it, i.e.
>
>class A {
>protected:
> int a;
>};
>
>class B : public A {
> // a still protected
>};
>
>class C : public B {
> // a still protected
>};
>
>class D : private C {
> // a now private because parent C is private!
>};
>
>class E : public D {
> // No longer access to field a, since class D
> // declared it's parent relation as "private".
>};
>
>/Per W
>
>On Tue, 9 Mar 2004, Daniel Glenfield wrote:
>
> > I don't think that is quite correct.
> >
> > Without getting too nerdy, private specifies that the member variable or
> > method (methods are usually public, not private) can only be accessed by
>a
> > method of that class, and cannot be accessed directly.
> > So if I have a private member
> > int EmployeeID;
> > I cannot do
> >
> > MyObject.EmployeeID = 12345;
> > Because it is private. What I need is a public method like this
> >
> > void SetEmployeeID(int Num)
> > {
> > EmployeeID = Num;
> > }
> > Then I can do MyObject.SetEmployeeID(12345);
> >
> >
> > Protected means the members are public to that class, but if a class is
> > derived from it then they become private. e.g.
> >
> > class Person
> > {
> > protected:
> > double DNASequence;
> > }
> >
> > class Employee : public Person
> > {
> > // class Employee now has
> > // private : <<<< wrong
>
> // protected: <<<< still protected, since parent
> > // double DNASequence; <<< class was declared "public Person"
> >
> > }
>
> class Supervisor : private Employee
> {
> // class Supervisor also has PROTECTED
> // DNASequence, i.e.
>
> void clone(double newDNASequence) {
> // OK, since Supervisor is a descendant from Person, and
> // Empployee inherrited with public!
> // Supervisor Bhas access rights to DNASequence
> DNASequence = newDNASequence;
> }
>
> class MeanSupervisor : public Supervisor
> {
> void mutate(double amount) {
> // NOT ALLOWED, since Supervisor inherrited privately
> // from Employee.
> // MeanSupervisor does not have access rights to DNASequence
> DNASequence *= amount;
> }
> }
> >
> > Let me know if any of this sounds wrong.
> >
> > Daniel
> >
> >
> > >From: Per Westermark <pw...@ia...>
> > >To: studioartoni <stu...@li...>
> > >CC: Dev...@li...
> > >Subject: Re: [Dev-C++] protected and private in c++ classes
> > >Date: Tue, 9 Mar 2004 11:15:18 +0100 (CET)
> > >
> > >Private is only for methods of the class.
> > >
> > >Protected are also available to all inherriting classes.
> > >
> > >/Per W
> > >
> > >On Tue, 9 Mar 2004, studioartoni wrote:
> > >
> > > > Excuse the question,
> > > > but which is the difference between 'protected' and 'private' in c++
> > >classes?
> > > > Thank you.
> > > >
> > > >
> > >
> > >
> > >
> > >-------------------------------------------------------
> > >This SF.Net email is sponsored by: IBM Linux Tutorials
> > >Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > >GenToo technologies. Learn everything from fundamentals to system
> > >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > >_______________________________________________
> > >Dev-cpp-users mailing list
> > >Dev...@li...
> > >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
> > _________________________________________________________________
> > Find a cheaper internet access deal - choose one to suit you.
> > http://www.msn.co.uk/internetaccess
> >
> >
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by: IBM Linux Tutorials
>Free Linux tutorial presented by Daniel Robbins, President and CEO of
>GenToo technologies. Learn everything from fundamentals to system
>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://www.msn.co.uk/messenger
|
|
From: Bo F. <bof...@ma...> - 2004-03-09 12:49:36
|
Hi all. I've just installed dev-cpp on my WinXP. I want to move a program I made = with a Borland IDE to dev-cpp and here's my problem: The source includes mmsystem.h and I know I have to link to the = library...but where is it? I figure it's a dll (either the one in = c:\windows\system or c:\windows\system32). I tried a few things, but no = luck. Below is the compile log, and as you can see, the first two ( = (1)compiler is g++ and (2)paths looks ok) of the "basic 3" should be ok. = :-) Compiler: Default compiler Building Makefile: "E:\backup\Source\AlarmSys090304\Makefile.win" Executing make... make.exe -f "E:\backup\Source\AlarmSys090304\Makefile.win" all g++.exe -c main.cpp -o main.o -I"H:/Programmer/Dev-Cpp/include/c++" = -I"H:/Programmer/Dev-Cpp/include/c++/mingw32" = -I"H:/Programmer/Dev-Cpp/include/c++/backward" = -I"H:/Programmer/Dev-Cpp/include" =20 In file included from main.cpp:7: H:/Programmer/Dev-Cpp/include/mmsystem.h:899: syntax error before `;' = token H:/Programmer/Dev-Cpp/include/mmsystem.h:900: syntax error before `;' = token H:/Programmer/Dev-Cpp/include/mmsystem.h:901: `CALLBACK' was not = declared in=20 this scope H:/Programmer/Dev-Cpp/include/mmsystem.h:901: `YIELDPROC' was not = declared in=20 this scope H:/Programmer/Dev-Cpp/include/mmsystem.h:901: `MCIDEVICEID' was not = declared in=20 this scope H:/Programmer/Dev-Cpp/include/mmsystem.h:901: `DWORD' was not declared = in this=20 scope H:/Programmer/Dev-Cpp/include/mmsystem.h:901: typedef declaration = includes an=20 initializer H:/Programmer/Dev-Cpp/include/mmsystem.h:901: confused by earlier = errors, bailing out make.exe: *** [main.o] Error 1 Execution terminated |
|
From: Per W. <pw...@ia...> - 2004-03-09 12:30:58
|
If the application was started with a path, you might retrieve it as the arg[0] parameter of main(). If not, you have to search the path for an application with the correct name. I don't think there is a standard function to perform this. If I'm wrong, I very much want to know the name of the function, since it would be useful :) On Linux, it is possible to heck in the /proc filesystem. There exists a symbolic link: /proc/<process_id>/exe -> /my/running/binary That will specify which binary that is running. It may also be accessed as: /proc/self/exe -> /my/running/binary to avoid the extra trouble of retrieving process id and dynamically create the path to the symbolic link. /Per W On Tue, 9 Mar 2004 sub...@ar... wrote: > What I actually wanted is the directory where the binary application is stored... > Anybody knows how to get it? > > Thanks again, > Josep > > ----- Original Nachricht ---- > Von: Per Westermark <pw...@ia...> > An: Kevin Wood <ke...@me...> > Datum: 09.03.2004 10:28 > Betreff: Re: [Dev-C++] How to get application directory? > > > The question was which directory the application is running in - not where > > the application binary is stored. > > > > /Per W > > > > On Tue, 9 Mar 2004, Kevin Wood wrote: > > > > > getcwd() returns the current working directory, which is not necessarily > > > the same as the directory in which the application resides. > > > > > > At 08:10 09/03/04, Per Westermark wrote: > > > >getcwd() or _getcwd(). > > > > > > > >/Per W > > > > > > > >On Tue, 9 Mar 2004, Josep Subirana wrote: > > > > > > > > > Hi, > > > > > > > > > > Do you know how to get the directory where your c++ application is > > running > > > > > in? > > > > > This should be a simple question for most experienced c++ > > programmers! > > > > > > > > > > Thanks, > > > > > > > > > > Josep > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: IBM Linux Tutorials > > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > > GenToo technologies. Learn everything from fundamentals to system > > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IBM Linux Tutorials > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > GenToo technologies. Learn everything from fundamentals to system > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > |
|
From: <sub...@ar...> - 2004-03-09 12:19:07
|
What I actually wanted is the directory where the binary application is stored... Anybody knows how to get it? Thanks again, Josep ----- Original Nachricht ---- Von: Per Westermark <pw...@ia...> An: Kevin Wood <ke...@me...> Datum: 09.03.2004 10:28 Betreff: Re: [Dev-C++] How to get application directory? > The question was which directory the application is running in - not where > the application binary is stored. > > /Per W > > On Tue, 9 Mar 2004, Kevin Wood wrote: > > > getcwd() returns the current working directory, which is not necessarily > > the same as the directory in which the application resides. > > > > At 08:10 09/03/04, Per Westermark wrote: > > >getcwd() or _getcwd(). > > > > > >/Per W > > > > > >On Tue, 9 Mar 2004, Josep Subirana wrote: > > > > > > > Hi, > > > > > > > > Do you know how to get the directory where your c++ application is > running > > > > in? > > > > This should be a simple question for most experienced c++ > programmers! > > > > > > > > Thanks, > > > > > > > > Josep > > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IBM Linux Tutorials > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > GenToo technologies. Learn everything from fundamentals to system > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Per W. <pw...@ia...> - 2004-03-09 12:16:53
|
I wrote terse, but was actually correct:
"Private is only for methods of the class" as in: privately declared
member fields and methods may only be accessed by members of that class :)
I didn't say that only methods may use private. I meant that only methods
of that class may acccess any private fields, methods, constructors, ...
I don't think it's correct to say that methods are usually public. There
are just as large reasons to keep methods protected or private as there
are to keep variables protected or private.
I think you missed a bit about inherritance of access rights to protected
fields. The protected declarations will continue to be protected for
multiple generations, unless one of the inherritances stops it, i.e.
class A {
protected:
int a;
};
class B : public A {
// a still protected
};
class C : public B {
// a still protected
};
class D : private C {
// a now private because parent C is private!
};
class E : public D {
// No longer access to field a, since class D
// declared it's parent relation as "private".
};
/Per W
On Tue, 9 Mar 2004, Daniel Glenfield wrote:
> I don't think that is quite correct.
>
> Without getting too nerdy, private specifies that the member variable or
> method (methods are usually public, not private) can only be accessed by a
> method of that class, and cannot be accessed directly.
> So if I have a private member
> int EmployeeID;
> I cannot do
>
> MyObject.EmployeeID = 12345;
> Because it is private. What I need is a public method like this
>
> void SetEmployeeID(int Num)
> {
> EmployeeID = Num;
> }
> Then I can do MyObject.SetEmployeeID(12345);
>
>
> Protected means the members are public to that class, but if a class is
> derived from it then they become private. e.g.
>
> class Person
> {
> protected:
> double DNASequence;
> }
>
> class Employee : public Person
> {
> // class Employee now has
> // private : <<<< wrong
// protected: <<<< still protected, since parent
> // double DNASequence; <<< class was declared "public Person"
>
> }
class Supervisor : private Employee
{
// class Supervisor also has PROTECTED
// DNASequence, i.e.
void clone(double newDNASequence) {
// OK, since Supervisor is a descendant from Person, and
// Empployee inherrited with public!
// Supervisor Bhas access rights to DNASequence
DNASequence = newDNASequence;
}
class MeanSupervisor : public Supervisor
{
void mutate(double amount) {
// NOT ALLOWED, since Supervisor inherrited privately
// from Employee.
// MeanSupervisor does not have access rights to DNASequence
DNASequence *= amount;
}
}
>
> Let me know if any of this sounds wrong.
>
> Daniel
>
>
> >From: Per Westermark <pw...@ia...>
> >To: studioartoni <stu...@li...>
> >CC: Dev...@li...
> >Subject: Re: [Dev-C++] protected and private in c++ classes
> >Date: Tue, 9 Mar 2004 11:15:18 +0100 (CET)
> >
> >Private is only for methods of the class.
> >
> >Protected are also available to all inherriting classes.
> >
> >/Per W
> >
> >On Tue, 9 Mar 2004, studioartoni wrote:
> >
> > > Excuse the question,
> > > but which is the difference between 'protected' and 'private' in c++
> >classes?
> > > Thank you.
> > >
> > >
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by: IBM Linux Tutorials
> >Free Linux tutorial presented by Daniel Robbins, President and CEO of
> >GenToo technologies. Learn everything from fundamentals to system
> >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> >_______________________________________________
> >Dev-cpp-users mailing list
> >Dev...@li...
> >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
> _________________________________________________________________
> Find a cheaper internet access deal - choose one to suit you.
> http://www.msn.co.uk/internetaccess
>
>
|
|
From: Mats L. <mat...@to...> - 2004-03-09 11:40:03
|
The "OpenGL device" is your graphics card. What model and make is it? = Could it be that it's an older one? /M ----- Original Message -----=20 From: michele=20 To: dev-cpp-users=20 Sent: Tuesday, March 09, 2004 11:18 AM Subject: [Dev-C++] problem with Irrlicht ...but even when opengl works there is some problem... Could it = concerns with my dll or with my graphic-card-driver? (Sometimes it = causes bad loop.console: "OpenGL device only has one texture unit. = Disable multitexturing."). |