dev-cpp-users Mailing List for Dev-C++ (Page 705)
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: Brian B. <bcb...@ya...> - 2001-04-09 22:30:39
|
Hi,
Thank you all for this information, it helped greatly.
Respectfully,
Brian
You are not wrong Elias. All Callback functions must
be static. The windows calling procedure does not know
about the implicit 'this' pointer that is passed to
every non-static class member function. With out the
'this' pointer, the appropriate instance of the class
can not be called.
Static functions do not have a this pointer and are
unaware of a specific class instance. You must always
find a way to pass or store a pointer to your class if
you need it when a callback is fired.
--- Elias Pschernig <eli...@ao...> wrote:
> ...
> >
> > class akorichedit{
> > private:
> > //...
> > WNDPROC wpOrigRichEditProc;
> > LRESULT CALLBACK RichEditSubclassProc(HWND hwnd,
> UINT
> > uMsg, WPARAM wParam, LPARAM lParam);
> > //...
> > public:
> > void create();
> > //...
> > };
> >
> ...
>
> I think callback functions have to be static. (I
> remember reading
> something about this in one of the microsoft
> examples - but maybe i'm
> wrong)
>
> Elias Pschernig
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
>
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.145 / Virus Database: 69 - Release Date:
5/4/00
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
|
|
From: Wendel <we...@ha...> - 2001-04-09 18:27:06
|
Hi Lorenz, Thkz for your help and attention! :-) Best Regards, [ ]'s |
|
From: Devin S. <dev...@bu...> - 2001-04-09 16:08:13
|
What does your DEV project file say? I can compare it to a "normal" one and see if there is a line in there that shouldn't be in there. I am using 4.01 with no problem. Devin ----- Original Message ----- From: "Phil Schulz" <fy...@us...> To: <dev...@li...> Sent: Saturday, April 07, 2001 5:23 PM Subject: [Dev-C++] Resource file not compiling > I just upgraded to Dev-C++ 4.01 version and now no new projects will > compile. I keep getting errors when the resource file tries to build. > Projects I created before upgrading compile with no problem (when I code > them right... :-) > > the resource log says: > C:\DEV-C++\BIN\windres: unrecognized option `--use-temp-file' > Usage: C:\DEV-C++\BIN\windres [options] [input-file] [output-file] > <snip manual help> > C:\DEV-C_~1\BIN\windres: supported targets: pe-i386 pei-i386 srec > symbolsrec tekhex binary ihex > > the compile log says: > C:\DEV-C++\BIN\windres --include-dir C:\DEV-C++\INCLUDE\ --include-dir > C:\DEV-C++\INCLUDE\G__~1 --include-dir C:\DEV-C++\INCLUDE\ > --use-temp-file -I rc > -O coff -i C:\DEV-C++\PROGRAMS\NEWFOL~1\RSRC.RC -o > <snip> > etc. > > I don't know why it's setting the --USE-temp-file if the program can't > understand it. > What settings can I change to set this? > > I've checked the FAQ at Bloodshed, and the forum at SourceForge with no > luck. > > > Phil > > P.S. Hurry! I've got homework due Thursday! :-( > -- > Fy...@us... > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: <csc...@gm...> - 2001-04-09 15:47:40
|
Hallo Richard, > > I'm a bit confused as to why, in any examples I see, a > main.cpp file uses #include "MyClass.h": shouldn't the > main.cpp file require both the class declaration and > its definition? > the compiler needs to know the class declaration to generate a function call. If you call a function (don't matters if it is in a class or not), the compiler needs to know how many arguments from which type in which order must be pushed onto the stack before the call. The compiler will generate code that does this. Then the compiler will generate the code actually does the call. Finally, the compiler must know the return type from the function in order to generate code that pops it off the stack. The compiler doesn't need to know the function definition to generate a function call. chris |
|
From: Lorenzo <co...@in...> - 2001-04-09 15:12:40
|
You can use the function:
char *getenv(const char *name);
Ex.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char *szTmp = getenv("TMP");
printf("TMP: %s\n", szTmp);
return 0;
}
|
|
From: Ioannis V. <no...@ya...> - 2001-04-09 14:53:51
|
In the case of a class there is no reason to have 2 files, since it can only defined once (in one file, or manually many times in separate files but using exactly the same definition-a habbit leading to troubles. Only #includes of the definition is the right way). So my guess is that in the implementation file he #includes the .h file (or the opposite). Ioannis * Ioannis Vranos * Programming pages: http://members.nbci.com/noicys * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of > Richard Southworth > Sent: Monday, April 09, 2001 10:09 AM > To: dev...@li... > Subject: [Dev-C++] Header Files > > > Hi. > > I'd be grateful if someone could write a few lines to > help me understand header files. > > I know that #include is used to read source code from > a file into the current file, and that MyClass.h holds > the declaration of a class whereas MyClass.cpp holds > the definition of the class. The MyClass.cpp file has > a #include "MyClass.h" so that it reads in the class > declaration. > > I'm a bit confused as to why, in any examples I see, a > main.cpp file uses #include "MyClass.h": shouldn't the > main.cpp file require both the class declaration and > its definition? > > Many thanks. > > Richard > > ____________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk > or your free @yahoo.ie address at http://mail.yahoo.ie > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Wendel <we...@ha...> - 2001-04-09 14:49:28
|
Hi all, ps.: Sorry for my poor english. I'm start to programming...and i'm learn C! :-) I need fo help! Somebody know how to can i do in C to see and get a valeu of one envinronment of O.S ?? :-) I need that it work with NT/9x ! :-) Example... in commando mode (DOS) suppose that i want know the value of enverionment "tmp" then i do: c:\>echo %tmp% c:\>TEMP c:\> How to do it in C ?? Eg.: How to get the value of envinonment tmp and attribute it to a variable of my program ?? Suppose that i had created: char recive_env; And i want get the value of tmp in the operation system and attribute to "recive_env" in my program...to do comparations... How to do it ?? Somebody can help me ?? Give me a example?? Thkz for all Best Regards, [ ]'s |
|
From: Richard A. <dic...@ho...> - 2001-04-09 10:32:55
|
>I'd be grateful if someone could write a few lines to >help me understand header files. there are basically two stages to the 'build' process - compiling and linking. In the first stage, the compiler looks at each source code (.cpp) file separately, and produces an object (.o) file from it. Because it deals with each file separately, it can't see the definitions of functions and classes in other source code files, so we have to help it along by #including header files which provide a brief rundown of the functions and classes that the compiler should *assume* exist in the other source code files (the header files give details of function argument lists, return types, functions provided by classes etc. so the compiler can check you've used the properly, but not what they actually do). In the second stage, the linker (usually a program called ld.exe) is given all of the object files produced by the compiler at once, along with any library (.a) files (such as the standard C or C++ libraries, various windows api libraries, opengl etc.) that it needs, and it glues them all together to produce the final .exe or .dll or whatever you're trying to create. >I know that #include is used to read source code from >a file into the current file, and that MyClass.h holds >the declaration of a class whereas MyClass.cpp holds >the definition of the class. The MyClass.cpp file has >a #include "MyClass.h" so that it reads in the class >declaration. >I'm a bit confused as to why, in any examples I see, a >main.cpp file uses #include "MyClass.h": shouldn't the >main.cpp file require both the class declaration and >its definition? (the compiler only needs to know the declaration of MyClass when compiling main.cpp - the linker will sort out connecting the function calls in main.cpp to the function definitions in MyClass.cpp) this obscure build mechanism can help to reduce build time - if you've only editted one .cpp file since the last build, you only need to compile that one file (it's object file will be the only one that's out of date) and then link the new object file with the old ones from the other source code files. in big projects this makes an enormous difference to build time. unfortunatly dev-c++ doesn't do this - it recompiles every .cpp file every time you build :O( anyway, hope this helps, richard _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. |
|
From: <ric...@ya...> - 2001-04-09 08:09:08
|
Hi. I'd be grateful if someone could write a few lines to help me understand header files. I know that #include is used to read source code from a file into the current file, and that MyClass.h holds the declaration of a class whereas MyClass.cpp holds the definition of the class. The MyClass.cpp file has a #include "MyClass.h" so that it reads in the class declaration. I'm a bit confused as to why, in any examples I see, a main.cpp file uses #include "MyClass.h": shouldn't the main.cpp file require both the class declaration and its definition? Many thanks. Richard ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie |
|
From: Elias P. <eli...@ao...> - 2001-04-08 21:43:11
|
> I have read in some previous article on this topic that someone > used Microsoft's htmlhelp.lib, perhaps origanally for Visual C++. > Could you explain how to do it and what's your experience with > Microsoft's libraries (.lib files) in Dev-CPP. Thank you. I need > to use some libs originally for Visual C++ too. > I only know, .lib files are no problem if they are just import libraries and the actual code is in a .dll. If not, the mingw linker only understands .lib files if they are simple and written in C i think. (Just add the .lib to further object files in dev-c++ then) If you need more information about the difference between .a and .lib files, and when they work with mingw, you can probably get more information at www.mingw.org and in the mingw mailing list. I'm subscribed there, and it seems to be a frequent topic. I just checked the recent topics (as i normally ignore most messages), and last week someone even posted about a htmlhelp.a. Elias Pschernig |
|
From: Bolek V. <vr...@pa...> - 2001-04-08 19:33:47
|
I have read in some previous article on this topic that someone used
Microsoft's htmlhelp.lib, perhaps origanally for Visual C++. Could you
explain how to do it and what's your experience with Microsoft's
libraries (.lib files) in Dev-CPP. Thank you. I need to use some libs
originally for Visual C++ too.
--
============================================================
Ing. Boleslav Vrany
Stanice techniku DDM hl. m. Prahy
Pod Juliskou 2a
Praha 6 - Dejvice
16000
Czech Republic
tel. (420 2) 243 10 240
|
|
From: Elias P. <eli...@ao...> - 2001-04-08 13:17:26
|
> Thanks for your reply, > > I am using basically the same setup as you, when I use the Help > Menu in my program (which calls the HtmlHelp() function) nothing > happens. I have found that the function returns 0 (by using an if > statement and a message box). > > I get the following errors in the linker section: > C:\DEV-C_~1\BIN\ld.exe: C:\Dev-C++\Lib\htmlhelp.lib > (release/init.obj): > warning: ignoring duplicate section `.text' > C:\DEV-C_~1\BIN\ld.exe: C:\Dev-C++\Lib\htmlhelp.lib > (release/init.obj): > warning: ignoring duplicate section `.text' > > Is this the problem? What is the newest version of the linker? > Where can I get it? Can I have a copy of some sources where I get no warnings, so probably it's the problem, it sounds like the htmlhelp is ignored or something like that. ld -v says 2.10.91 (Jan 26 2001) for me, i think it's a beta version - but at least it can link the htmlhelp.lib file. I got it from the mingw site, direct link is: http://prdownloads.sourceforge.net/mingw/ld-2.10.91-20010126.zip > HTMLHELP works so I can test them on my computer? I uploaded a simple test program which works for me: http://www.elias.f2s.com/dev/test.c > Thanks, > Ramana > PS I've been having trouble sending to the list... I get error: > cannot route back to sender. I sent this in a different email > account. Any idea what's wrong? Don't know, I only have problems with Outlook Express sending my emails under different names :) Elias Pschernig |
|
From: Ramana K. <xr...@ho...> - 2001-04-08 02:23:02
|
Thanks for your reply, I am using basically the same setup as you, when I use the Help Menu in my program (which calls the HtmlHelp() function) nothing happens. I have found that the function returns 0 (by using an if statement and a message box). I get the following errors in the linker section: C:\DEV-C_~1\BIN\ld.exe: C:\Dev-C++\Lib\htmlhelp.lib(release/init.obj): warning: ignoring duplicate section `.text' C:\DEV-C_~1\BIN\ld.exe: C:\Dev-C++\Lib\htmlhelp.lib(release/init.obj): warning: ignoring duplicate section `.text' Is this the problem? What is the newest version of the linker? Where can I get it? Can I have a copy of some sources where HTMLHELP works so I can test them on my computer? Thanks, Ramana PS I've been having trouble sending to the list... I get error: cannot route back to sender. I sent this in a different email account. Any idea what's wrong? _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. |
|
From: Phil S. <fy...@us...> - 2001-04-07 23:51:24
|
I just upgraded to Dev-C++ 4.01 version and now no new projects will compile. I keep getting errors when the resource file tries to build. Projects I created before upgrading compile with no problem (when I code them right... :-) the resource log says: C:\DEV-C++\BIN\windres: unrecognized option `--use-temp-file' Usage: C:\DEV-C++\BIN\windres [options] [input-file] [output-file] <snip manual help> C:\DEV-C_~1\BIN\windres: supported targets: pe-i386 pei-i386 srec symbolsrec tekhex binary ihex the compile log says: C:\DEV-C++\BIN\windres --include-dir C:\DEV-C++\INCLUDE\ --include-dir C:\DEV-C++\INCLUDE\G__~1 --include-dir C:\DEV-C++\INCLUDE\ --use-temp-file -I rc -O coff -i C:\DEV-C++\PROGRAMS\NEWFOL~1\RSRC.RC -o <snip> etc. I don't know why it's setting the --USE-temp-file if the program can't understand it. What settings can I change to set this? I've checked the FAQ at Bloodshed, and the forum at SourceForge with no luck. Phil P.S. Hurry! I've got homework due Thursday! :-( -- Fy...@us... |
|
From: Jack E. <je...@el...> - 2001-04-07 22:44:56
|
Confirm 983466. |
|
From: Sam <sch...@ho...> - 2001-04-07 14:17:48
|
Hi there,=20
I am trying to add an error handler for a C program for a class =
assignment. we haven't gone over errorhandling but i'm getting that =
awful message
"This program has performed and illegal operation and will be shut down" =
in regards to this statement.
if((fp =3D fopen("data.dat", "r")) =3D=3D NULL)
basically if no file exits to read, I get the message.
What I have so far is below, but I keep getting a message from the =
compiler stating that _HARD_IGNORE not declared. I thought this was a =
constant in the dos.h library??
way confused....does it make sense to do this at all?
void handler(unsigned device_error, unsigned error_code,
unsigned *device_header)
{
cputs("Critical error resuming program\n");
_hardreturn(_HARDERR_IGNORE); =20
}
|
|
From: Ioannis V. <no...@ya...> - 2001-04-07 12:47:01
|
In C: #include <stdlib.h> int *p=malloc(sizeof(*p)); /* Allocates one int in free store */ *p=5; /* assigns the value 5. */ free(p); /* frees the allocated memory */ p=malloc(10*sizeof(*p)); /* or p=malloc(10*sizeof(int)); they are both the same */ /* Allocates an arrray of 10 integers in free store */ p[0]=5; p[7]=8; free(p); ----------------------------------------------------------------- In C++: #include <new> int *p=new int; *p=8; delete p; p=new int[10]; p[0]=7; p[1]=8; delete[] p; Ioannis * Ioannis Vranos * Programming pages: http://members.nbci.com/noicys * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of > Nathan Smith > Sent: Friday, April 06, 2001 2:21 PM > To: dev...@li... > Subject: Re: [Dev-C++] Extending an array > > > Know any URLs with examples on how to do it? I am still learning > all this... |
|
From: Elias P. <eli...@ao...> - 2001-04-07 11:57:59
|
> > >
> hChildPB=CreateWindow("LISTBOX","",WS_CHILD | WS_CLIPSIBLINGS |
LBS_NOTIFY
> | WS_VSCROLL, 10,40,148,180,hwnd,NULL,g_hInst,0);
>
> above is how I create it.
>
>
> case WM_COMMAND:
> switch( wParam )
Well, this is the problem. According to the Win32 API docs, the
WM_COMMAND has the following parameters:
wNotifyCode = HIWORD(wParam); // notification code
wID = LOWORD(wParam); // control identifier
hwndCtl = (HWND) lParam; // handle of control
Just replace wParam by HIWORD(wParam) and everything should work.
> {
> case LBN_SELCHANGE:
> MessageBox(hwnd,"it worked","I wish :(",MB_OK);
> break;
>
> then rest of my WM_COMMAND case which all works.
>
> but the messagebox is never displayed.
Elias Pschernig
|
|
From: Michael P. <mdp...@ya...> - 2001-04-07 03:23:27
|
You are not wrong Elias. All Callback functions must
be static. The windows calling procedure does not know
about the implicit 'this' pointer that is passed to
every non-static class member function. With out the
'this' pointer, the appropriate instance of the class
can not be called.
Static functions do not have a this pointer and are
unaware of a specific class instance. You must always
find a way to pass or store a pointer to your class if
you need it when a callback is fired.
--- Elias Pschernig <eli...@ao...> wrote:
> ...
> >
> > class akorichedit{
> > private:
> > //...
> > WNDPROC wpOrigRichEditProc;
> > LRESULT CALLBACK RichEditSubclassProc(HWND hwnd,
> UINT
> > uMsg, WPARAM wParam, LPARAM lParam);
> > //...
> > public:
> > void create();
> > //...
> > };
> >
> ...
>
> I think callback functions have to be static. (I
> remember reading
> something about this in one of the microsoft
> examples - but maybe i'm
> wrong)
>
> Elias Pschernig
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
>
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
|
|
From: Nathan S. <str...@ho...> - 2001-04-07 03:09:52
|
>
>
> > >
> > >
> > > > Opps, I do have the LBS_NOTIFY style but I never receive the
> > message. I am
> > > > processing it as a part of WM_COMMAND message
> > > >
> > >
> > > any know how?
> > >
> > > I have a listbox with LBS_NOTIFY style but my app receives no
> > messages when
> > > a user selects an item in the listbox.
> > >
> >
> > For me, a WM_COMMAND message is sent to the window procedure, with the
> > LBN_SELCHANGE notification code. So, to get more help, you will have
> > to post the part of the code where you process the WM_COMMAND message,
> > and maybe the code which creates the listbox. Somewhere there must be
> > a bug in your code.
> >
> > Elias Pschernig
> >
> >
hChildPB=CreateWindow("LISTBOX","",WS_CHILD | WS_CLIPSIBLINGS | LBS_NOTIFY
| WS_VSCROLL, 10,40,148,180,hwnd,NULL,g_hInst,0);
above is how I create it.
case WM_COMMAND:
switch( wParam )
{
case LBN_SELCHANGE:
MessageBox(hwnd,"it worked","I wish :(",MB_OK);
break;
then rest of my WM_COMMAND case which all works.
but the messagebox is never displayed.
|
|
From: Alan T. <ala...@3n...> - 2001-04-07 01:50:47
|
Nathan,
Can you use a vector or other container that is easily =
and safely extended? Perhaps an array is a bad choice for what you`re =
trying to do. See =
http://www.icce.rug.nl/docs/cplusplus/cplusplus08.html#l112 for vectors =
and http://www.icce.rug.nl/docs/cplusplus/cplusplus08.html#l109 for C++ =
abstract containers.
Below is an example of how to use the vector container (for =
a vector of strings). Alan
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main()
{
vector<string> v;
ifstream in ("Fillvector.cpp");
string line;
while (getline(in, line))
v.push_back(line); // Add line to the end
// Add line numbers:
for (int i=3D0; i < v.size(); i++)
cout << i << ": " << v[i] << endl;
=20
system("PAUSE");
return 0;
}
Message: 2
From: "Nathan Smith" <str...@ho...>
To: "Dev C++" <dev...@li...>
Date: Fri, 6 Apr 2001 14:09:46 +1000
Subject: [Dev-C++] Extending an array
Reply-To: dev...@li...
Is there a way at runtime, after an array has been populated to extend =
it?
Like I have char stuff[40][17] and I want to extend it to =
stuff[xxxx][17]?
|
|
From: Richard A. <dic...@ho...> - 2001-04-07 00:26:45
|
>Hi,
>When trying to subclass an richedit control within a
>class, I ran accross a problem. When I include a
>subclass procedure in a class (the code shown below),
>I get the error (Generated by Dev-C++): "aggregate
>value used where an integer was expected", yet when I
>include the subclass procedure outside the class, it
>runs fine. How can I solve this?
>
>class akorichedit{
>private:
>//...
>WNDPROC wpOrigRichEditProc;
>LRESULT CALLBACK RichEditSubclassProc(HWND hwnd, UINT
>uMsg, WPARAM wParam, LPARAM lParam);
>//...
>public:
>void create();
>//...
>};
>
>void akorichedit::create(){
>//... ERROR BELOW
>wpOrigRichEditProc =(WNDPROC) SetWindowLong(
> (HWND)_hwnd, // handle of window
> (int)GWL_WNDPROC, // offset of value to set
> (LONG)RichEditSubclassProc
> ); // LINE 130
>//... ERROR ABOVE
>}
You can't take the address of a member function and pass it around like
this, unfortunatly, because the 'address' of the function is independent of
the object (i.e. instance) for which it's called.
This sort of situation arises most often when you're mixing C code expecting
callbacks and C++ code providing function objects... the only workaround
that I can see is to have a global function (which you give to
SetWindowLong) which is a friend of the akorichedit class, and calls various
functions of the class in response to being called itself...
of course, the function will need to know which class its being called for
each time. I usually use the window's user data to store the object's
address (use SetWindowLong with GWL_USERDATA).
hth,
richard
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
|
|
From: Nathan S. <str...@ho...> - 2001-04-06 23:47:18
|
----- Original Message -----
From: "Pschernig" <psc...@ao...>
To: <dev...@li...>
Sent: Saturday, April 07, 2001 8:36 AM
Subject: Re: [Dev-C++] ListBox selections
> >
> >
> > > Opps, I do have the LBS_NOTIFY style but I never receive the
> message. I am
> > > processing it as a part of WM_COMMAND message
> > >
> >
> > any know how?
> >
> > I have a listbox with LBS_NOTIFY style but my app receives no
> messages when
> > a user selects an item in the listbox.
> >
>
> For me, a WM_COMMAND message is sent to the window procedure, with the
> LBN_SELCHANGE notification code. So, to get more help, you will have
> to post the part of the code where you process the WM_COMMAND message,
> and maybe the code which creates the listbox. Somewhere there must be
> a bug in your code.
>
> Elias Pschernig
>
>
hChildPB=CreateWindow("LISTBOX","",WS_CHILD | WS_CLIPSIBLINGS | LBS_NOTIFY
| WS_VSCROLL, 10,40,148,180,hwnd,NULL,g_hInst,0);
above is how I create it.
case WM_COMMAND:
switch( wParam )
{
case LBN_SELCHANGE:
itoa(10,TempText,10);
MessageBox(hwnd,TempText,TempText,MB_OK);
break;
then rest of my WM_COMMAND case which all works.
|
|
From: Pschernig <psc...@ao...> - 2001-04-06 22:36:17
|
> > > > Opps, I do have the LBS_NOTIFY style but I never receive the message. I am > > processing it as a part of WM_COMMAND message > > > > any know how? > > I have a listbox with LBS_NOTIFY style but my app receives no messages when > a user selects an item in the listbox. > For me, a WM_COMMAND message is sent to the window procedure, with the LBN_SELCHANGE notification code. So, to get more help, you will have to post the part of the code where you process the WM_COMMAND message, and maybe the code which creates the listbox. Somewhere there must be a bug in your code. Elias Pschernig |
|
From: Elias P. <eli...@ao...> - 2001-04-06 22:32:56
|
...
>
> class akorichedit{
> private:
> //...
> WNDPROC wpOrigRichEditProc;
> LRESULT CALLBACK RichEditSubclassProc(HWND hwnd, UINT
> uMsg, WPARAM wParam, LPARAM lParam);
> //...
> public:
> void create();
> //...
> };
>
...
I think callback functions have to be static. (I remember reading
something about this in one of the microsoft examples - but maybe i'm
wrong)
Elias Pschernig
|