dev-cpp-users Mailing List for Dev-C++ (Page 454)
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: Dany P. W. <da...@qu...> - 2003-01-16 21:46:31
|
This code managed to compile yesterday, albeit returning with makefile
error:
=================================
#include <iostream>
int main()
{
std::cout << "Hello world!";
return 0;
}
=================================
Unfortunately when I tried today, it returned with the 70 compile errors
I originally had! What's going on here?!
Sorry to keep bothering you all with this insanely stupid code that I
can't get to compile.
Cheers,
D.
--
This mail is a natural product. The slight variations in
spelling and grammar enhance its individual character and
beauty and in no way are to be considered flaws or defects.
|
|
From: Michel W. <mic...@fr...> - 2003-01-16 21:06:56
|
Pruuel wrote: > How can I use my makefile from Dev C++? I think it's impossible with dev-c++. You have three solutions : 1. In project options you can add lines to the makedile.win created by dev-c++. (powerfull enought for the majority of applications) 2 .you could add dev-c++ in your user path and launch make from the command line. 3. You could also use minsys to have a shelll and in the post install give you dev-c++ directory as mingw installation directory. > I did not find such features. convert a makefile to a project is quite difficult because makefile are handmade. Perhaps automake should be more simple. Any volunter for a beautiful parser ? c8 |
|
From: Michel W. <mic...@fr...> - 2003-01-16 20:42:12
|
hello, You should use gui beacause gui is only command-less . You should have a libscrnsave.a library in your lib directory. Your source code should compile fine (you should have a beautiful blue "screen saver 1" on your screen. Adds these options in projects options-> general -> linker options -lscrnsave -o "Project.scr" If you don't have the .a library you can include a .a or .lib file in the same screen with "add library or object". bye |
|
From: Ioannis V. <no...@ho...> - 2003-01-16 19:14:15
|
-------Original Message-------=0D
=0D
From: Carlos Garc=EDa del Monte=0D
Date: Thursday, 16 January 2003 9:01:09 PM=0D
To: Dany P. Wu; dev-cpp-users-list=0D
Subject: Re: [Dev-C++] Compiling problems with 4.9.7.0 and GCC 3.2=0D
=0D
#include <iostream>=0D
=0D
using namespace std;=0D
=0D
int main()=0D
{=0D
whatever;=0D
}=0D
=0D
=0D
=3D=3D> And this is a nice attempt to defeat the namespace system (which =
is bad)
=0D
=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20
|
|
From: Ioannis V. <no...@ho...> - 2003-01-16 19:08:19
|
-------Original Message-------=0D
=0D
From: Per Westermark=0D
Date: Thursday, 16 January 2003 6:03:21 PM=0D
To: Ioannis Vranos=0D
Cc: dev...@li...=0D
Subject: Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc.=0D
=0D
Correction about strncpy=0D
strncpy(PaperTypes.PaperStrings,"Letter",42-1);=0D
PaperTypes.PaperStrings[42-1] =3D '\0';=0D
=0D
strncpy will not insert a null-termination in case the string gets=0D
clipped.=0D
=0D
However, in this case, I assume that the goal was an array of 42 strings,=
=0D
and not one string of max 42-1 characters.=0D
=0D
char *PaperTypes[42];=0D
=0D
and in that case it's allowed to do=0D
=0D
PaperTypes[0] =3D "Letter";=0D
PaperTypes[1] =3D "Legal";=0D
PaperTypes[2] =3D "A4";=0D
=2E..=0D
=0D
Normally then, You would do:=0D
=0D
// Number of elements of a static array.=0D
#define NELEM(a) (sizeof(a)/sizeof(*(a)))=0D
=0D
struct Format {=0D
int id,=0D
const char *name;=0D
} formats[] =3D {=0D
{1,"Letter"},=0D
{2,"Legal"},=0D
{3,"A4"}=0D
};=0D
=0D
=0D
int cmp(const void *a,const void *b) {=0D
const Format *pa =3D (const Format*)a;=0D
const Format *pb =3D (const Format*)b;=0D
=0D
return pa->id - pb->id;=0D
}=0D
=0D
int locate(const void *a,const void *b) {=0D
int key =3D *(const int*)a;=0D
const Format *fmt =3D (const Format*)b;=0D
=0D
return key - fmt->id;=0D
}=0D
=0D
qsort(formats,NELEM(formats),sizeof(*formats),cmp);=0D
=0D
int key =3D 2;=0D
Format *p =3D bsearch(&key,formats,NELEM(formats),sizeof(*formats),locate=
);=0D
=0D
/Per W=0D
=0D
=0D
=3D=3D> Yes, you are right. Probably i had my mind to something else at t=
he time
:) I used a char *array as a char array, etc.=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20 |
|
From: Pruuel <pr...@hy...> - 2003-01-16 19:04:01
|
How can I use my makefile from Dev C++? I did not find such features. |
|
From: <cg...@wo...> - 2003-01-16 18:59:39
|
#include <iostream>
using namespace std;
int main()
{
whatever;
}
In short: the line using namespace std; means that from that line till=20
it gets out of scope, whenever you use a function or a variable, if it=20
exists inside that namespace it is what you are willing to use and not=20
any other function or variable with the same name inside another=20
namespace, and you don't need apend the namespace before each of the=20
functions/variables from it you are using. Of course, if you have a=20
function with the same name in scope and declared outside any=20
namespace, then you will have a conflict between them.
The matter is the namespaces: for avoid problems with the possibility=20
that two different library vendors give the same name to some functions,=20
the declare them inside a namespace so whenever you have to use them you=20
need to declare to which namespace the function or member you're using=20
belongs.
So you have a .h form vendor A and another from vendor B
venA.h
namespace vendorA{
int myfunction();
char *mydata;
}
and venB.h
namespace vendorB{
int myfunction();
char *data;
}
So you can say:
I want the function from A, then I type
vendorA::myfunction();
but if you want the other, then you type
vendor::Bmyfunction();
But if you will use only one of them, or one preferably over the other,=20
you can say
using namespace vendorA;
in a place where it is on scope wherever you'll use its functions, that=20
declares that you want use the functions and members of the namespace=20
vendorA while using namespace vendorA; is in scope.
Then myfunction(); will be a call to vendorA::myfunction.
You can either modify that, which makes available all the functions (and=20
variables) inside the namespace, select only some of them, so in the=20
example, you can say:
#include <venA.h>
using namespace vendorA::myfunction();
int another_function_int_main_calls_from_another_source_file(char firstpa=
r){
myfunction();
vendorA::mydata; <-- Here simply mydata would not work, compiler would=20
report undefined variable.
This is a quick explanation as it comes to my mind right now, I hope you=20
understand it, although I've the feeling that it's not the best=20
explanation I could give you. If you want a clearer explanation, ask me=20
and then I'll answer with clearer explanation, this only intends to be a=20
quick explanation for avoid to forget answer waiting for a moment for=20
say things clearer.
Dany P. Wu wrote:
>>-----Original Message-----
>>From: dev...@li...=20
>>[mailto:dev...@li...] On Behalf=20
>>Of Carlos Garc=EDa del Monte
>>Sent: Thursday, 16 January 2003 11:53 p.m.
>>To: dev-cpp-users-list
>>Subject: Re: [Dev-C++] Compiling problems with 4.9.7.0 and GCC 3.2
>>
>>
>>If you use iostream instead iostream.h you must:
>>1) Add using namespace std; before main or as its first line
>> =20
>>
>
>Can you please explain this one to me? What do I have to do, exactly?
>
> =20
>
>>2) Each time you use a function or name from it you have to=20
>>write std::=20
>>just before it, in your example: std::cout
>>
>>The use of iostream.h is considered deprecated, so if you=20
>>want use it it=20
>>would be more comfortable if you add the compiler option=20
>>-Wno-deprecated, so the compiler won't send you a very long warning=20
>>about it.
>> =20
>>
>
>D.
>
>
> =20
>
|
|
From: Per W. <pw...@ia...> - 2003-01-16 16:04:31
|
Correction about strncpy
strncpy(PaperTypes.PaperStrings,"Letter",42-1);
PaperTypes.PaperStrings[42-1] = '\0';
strncpy will not insert a null-termination in case the string gets
clipped.
However, in this case, I assume that the goal was an array of 42 strings,
and not one string of max 42-1 characters.
char *PaperTypes[42];
and in that case it's allowed to do
PaperTypes[0] = "Letter";
PaperTypes[1] = "Legal";
PaperTypes[2] = "A4";
...
Normally then, You would do:
// Number of elements of a static array.
#define NELEM(a) (sizeof(a)/sizeof(*(a)))
struct Format {
int id,
const char *name;
} formats[] = {
{1,"Letter"},
{2,"Legal"},
{3,"A4"}
};
int cmp(const void *a,const void *b) {
const Format *pa = (const Format*)a;
const Format *pb = (const Format*)b;
return pa->id - pb->id;
}
int locate(const void *a,const void *b) {
int key = *(const int*)a;
const Format *fmt = (const Format*)b;
return key - fmt->id;
}
qsort(formats,NELEM(formats),sizeof(*formats),cmp);
int key = 2;
Format *p = bsearch(&key,formats,NELEM(formats),sizeof(*formats),locate);
/Per W
On Thu, 16 Jan 2003, Ioannis Vranos wrote:
> -------Original Message-------
>
> From: Daniel Glenfield
> Date: Thursday, 16 January 2003 11:09:47 AM
> To: pw...@ia...
> Cc: dev...@li...
> Subject: Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc.
>
> Thanks I'll do some research.
> Can you tell me how to put these values in to a struct?
>
> 1, "Letter"
> 2, "Letter(small)"
> 3, "Tabloid"
>
> etc. I'm having trouble with this.
>
> // I asssume C
>
> ==> #include <string.h>
>
>
> struct PAPER
> {
> int Num;
> char* PaperStrings[42][1];
>
> ==>The 1 thing is reduntant!
>
> ==> char *PaperStrings[42];
>
>
> } PaperTypes, *PaperStruct = &PaperTypes;
>
> PaperTypes.Num = 1;
>
> PaperTypes.PaperStrings[42][1] = "Letter";
>
>
> ==> strncpy(PaperTypes.PaperStrings, "Letter", 42);
>
>
> PaperStruct->PaperStrings[40][1] = "Letter(small)";
>
> ==> /* ... */
>
> As you can see this is very wrong. I feel an idiot, but all the examples of
> structs I have seen do not use arrays or do anything like this, so I don't
> know how to do it!
>
>
>
> ==> I also suggest "The C Programming Language" 2nd Edition by Brian
> Kernighan - Dennis Ritchie (the creator of C).
>
>
> Ioannis Vranos
>
> * Programming pages: http://www.noicys.freeurl.com
> * Alternative URL: http://run.to/noicys
|
|
From: Philippe de R. <phi...@ww...> - 2003-01-16 15:22:11
|
Hello,
I am trying to compile the code below, which comes from Schildt's
Windows 2000 Programming book and builds a screen-saver.
Unfortunately, I am not sure what to build the project as: Win32 GUI
(it has no GUI), Win32 Console (it is not a console app), Win32 Static
Lib (not a static lib), or Win32 DLL (not a DLL).
Furthermore, I had to import the SCRNSAVE.LIB from a demo copy of VC++,
since dev-C++ does not include such libraries.
What should I build my project as (Win32 GUI, Win32 Console, etc.)?
Where can you get LIBs on the Web when you compile a project with
Dev-C++ that requires one?
Many thanks.
Philippe de Rochambeau
========
listing 1
// A miminal screen saver.
#include <windows.h>
#include <scrnsave.h>
// This is the message displayed on the screen.
char str[80] = "Screen Saver #1";
// This is timer delay.
int delay = 200;
// Screen Saver Function
LRESULT WINAPI ScreenSaverProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
static HDC hdc;
static unsigned int timer;
static RECT scrdim;
static SIZE size;
static int X = 0, Y = 0;
static HBRUSH hBlkBrush;
static TEXTMETRIC tm;
switch(message) {
case WM_CREATE:
timer = SetTimer(hwnd, 1, delay, NULL);
hBlkBrush = (HBRUSH) GetStockObject(BLACK_BRUSH);
break;
case WM_ERASEBKGND:
hdc = GetDC(hwnd);
// get coordinates of screen
GetClientRect(hwnd, &scrdim);
// erase the screen
SelectObject(hdc, hBlkBrush);
PatBlt(hdc, 0, 0, scrdim.right, scrdim.bottom, PATCOPY);
// get and save height and length of string
GetTextMetrics(hdc, &tm);
GetTextExtentPoint32(hdc, str, strlen(str), &size);
ReleaseDC(hwnd, hdc);
break;
case WM_TIMER:
hdc = GetDC(hwnd);
// erase previous output
SelectObject(hdc, hBlkBrush);
PatBlt(hdc, X, Y, X + size.cx, Y + size.cy, PATCOPY);
// move string to new location
X += 10; Y += 10;
if(X > scrdim.right) X = 0;
if(Y > scrdim.bottom) Y = 0;
// output string
SetBkColor(hdc, RGB(0, 0, 0));
SetTextColor(hdc, RGB(0, 255, 255));
TextOut(hdc, X, Y, str, strlen(str));
ReleaseDC(hwnd, hdc);
break;
case WM_DESTROY:
KillTimer(hwnd, timer);
break;
default:
return DefScreenSaverProc(hwnd, message, wParam, lParam);
}
return 0;
}
// Placeholder Dialog Box Function.
BOOL WINAPI ScreenSaverConfigureDialog(HWND hdwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
return 0;
}
// No classes to register.
BOOL WINAPI RegisterDialogClasses(HANDLE hInst)
{
return 1;
}
listing 2
#include <windows.h>
#include <scrnsave.h>
ID_APP ICON SCRICON.ICO
STRINGTABLE
{
IDS_DESCRIPTION "My Screen Saver #1"
}
listing 3
// A Configurable Screen Saver
#include <windows.h>
#include <scrnsave.h>
#include <commctrl.h>
#include <cstring>
#include "scr.h"
#define DELAYMAX 999
#define MSGSIZE 80
// This is the screen saver's message.
char str[MSGSIZE+1] = "Screen Saver #2";
// This is timer delay.
long delay;
unsigned long datatype, datasize;
unsigned long result;
// This is a registry key.
HKEY hRegKey;
// Screen Saver Function
LRESULT WINAPI ScreenSaverProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
static HDC hdc;
static unsigned int timer;
static RECT scrdim;
static SIZE size;
static int X = 0, Y = 0;
static HBRUSH hBlkBrush;
static TEXTMETRIC tm;
switch(message) {
case WM_CREATE:
// open screen saver key or create, if necessary
RegCreateKeyEx(HKEY_CURRENT_USER,
"Control Panel\\Screen Saver.MyScrSaver",
0, "Screen Saver", 0, KEY_ALL_ACCESS,
NULL, &hRegKey, &result);
// if key was created
if(result==REG_CREATED_NEW_KEY) {
// set its initial value
delay = 100;
RegSetValueEx(hRegKey, "delay", 0,
REG_DWORD, (LPBYTE) &delay, sizeof(DWORD));
RegSetValueEx(hRegKey, "message", 0,
REG_SZ, (LPBYTE) str, strlen(str)+1);
}
else { // key was already in registry
// get delay value
datasize = sizeof(DWORD);
RegQueryValueEx(hRegKey, "delay", NULL,
&datatype, (LPBYTE) &delay, &datasize);
// get message
datasize = MSGSIZE;
RegQueryValueEx(hRegKey, "message", NULL,
&datatype, (LPBYTE) str, &datasize);
}
RegCloseKey(hRegKey);
timer = SetTimer(hwnd, 1, delay, NULL);
hBlkBrush = (HBRUSH) GetStockObject(BLACK_BRUSH);
break;
case WM_ERASEBKGND:
hdc = GetDC(hwnd);
// Get coordinates of screen
GetClientRect(hwnd, &scrdim);
// erase the screen
SelectObject(hdc, hBlkBrush);
PatBlt(hdc, 0, 0, scrdim.right, scrdim.bottom, PATCOPY);
// get and save height and length of string
GetTextMetrics(hdc, &tm);
GetTextExtentPoint32(hdc, str, strlen(str), &size);
ReleaseDC(hwnd, hdc);
break;
case WM_TIMER:
hdc = GetDC(hwnd);
// erase previous output
SelectObject(hdc, hBlkBrush);
PatBlt(hdc, X, Y, X + size.cx, Y + size.cy, PATCOPY);
// move string to new location
X += 10; Y += 10;
if(X > scrdim.right) X = 0;
if(Y > scrdim.bottom) Y = 0;
// output string
SetBkColor(hdc, RGB(0, 0, 0));
SetTextColor(hdc, RGB(0, 255, 255));
TextOut(hdc, X, Y, str, strlen(str));
ReleaseDC(hwnd, hdc);
break;
case WM_DESTROY:
KillTimer(hwnd, timer);
break;
default:
return DefScreenSaverProc(hwnd, message, wParam, lParam);
}
return 0;
}
// Configuration Dialog Box Function
BOOL WINAPI ScreenSaverConfigureDialog(HWND hdwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
static HWND hEboxWnd;
static HWND udWnd;
switch(message) {
case WM_INITDIALOG:
// open screen saver key or create, if necessary
RegCreateKeyEx(HKEY_CURRENT_USER,
"Control Panel\\Screen Saver.MyScrSaver",
0, "Screen Saver", 0, KEY_ALL_ACCESS,
NULL, &hRegKey, &result);
// if key was created
if(result==REG_CREATED_NEW_KEY) {
// set its initial value
delay = 100;
RegSetValueEx(hRegKey, "delay", 0,
REG_DWORD, (LPBYTE) &delay, sizeof(DWORD));
RegSetValueEx(hRegKey, "message", 0,
REG_SZ, (LPBYTE) str, strlen(str)+1);
}
else { // key was already in registry
// get delay value
datasize = sizeof(DWORD);
RegQueryValueEx(hRegKey, "delay", NULL,
&datatype, (LPBYTE) &delay, &datasize);
// get message
datasize = MSGSIZE;
RegQueryValueEx(hRegKey, "message", NULL,
&datatype, (LPBYTE) str, &datasize);
}
// create delay spin control
hEboxWnd = GetDlgItem(hdwnd, IDD_EB1);
udWnd = CreateUpDownControl(
WS_CHILD | WS_BORDER | WS_VISIBLE |
UDS_SETBUDDYINT | UDS_ALIGNRIGHT,
20, 10, 50, 50,
hdwnd,
IDD_UPDOWN,
hMainInstance,
hEboxWnd,
DELAYMAX, 1, delay);
// initialize edit box with current message
SetDlgItemText(hdwnd, IDD_EB2, str);
return 1;
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDOK:
// set delay value
delay = GetDlgItemInt(hdwnd, IDD_EB1, NULL, 1);
// get message string
GetDlgItemText(hdwnd, IDD_EB2, str, MSGSIZE);
// update registry
RegSetValueEx(hRegKey, "delay", 0,
REG_DWORD, (LPBYTE) &delay, sizeof(DWORD));
RegSetValueEx(hRegKey, "message", 0,
REG_SZ, (LPBYTE) str, strlen(str)+1);
// fall through to next case ...
case IDCANCEL:
RegCloseKey(hRegKey);
EndDialog(hdwnd, 0);
return 1;
}
break;
}
return 0;
}
// No classes to register.
BOOL WINAPI RegisterDialogClasses(HANDLE hInst)
{
return 1;
}
listing 4
// Dialog box for screen saver.
#include <windows.h>
#include <scrnsave.h>
#include "scr.h"
ID_APP ICON SCRICON.ICO
STRINGTABLE
{
IDS_DESCRIPTION "My Screen Saver #2"
}
DLG_SCRNSAVECONFIGURE DIALOGEX 18, 18, 110, 60
CAPTION "Set Screen Saver Options"
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
{
PUSHBUTTON "OK", IDOK, 20, 40, 30, 14
PUSHBUTTON "Cancel", IDCANCEL, 60, 40, 30, 14
EDITTEXT IDD_EB1, 5, 5, 24, 12, ES_LEFT | WS_TABSTOP | WS_BORDER
EDITTEXT IDD_EB2, 5, 20, 65, 12, ES_LEFT | WS_TABSTOP |
WS_BORDER | ES_AUTOHSCROLL
LTEXT "Delay in milliseconds", IDD_TEXT1, 35, 7, 100, 12
LTEXT "Message", IDD_TEXT2, 76, 22, 30, 12
}
listing 5
#define IDD_EB1 200
#define IDD_EB2 201
#define IDD_UPDOWN 202
#define IDD_TEXT1 203
#define IDD_TEXT2 204
listing 6
// Configuration Dialog Box Function
BOOL WINAPI ScreenSaverConfigureDialog(HWND hdwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
static HWND hEboxWnd;
static HWND udWnd;
switch(message) {
case WM_INITDIALOG:
// open screen saver key or create, if necessary
RegCreateKeyEx(HKEY_CURRENT_USER,
"Control Panel\\Screen Saver.MyScrSaver",
0, "Screen Saver", 0, KEY_ALL_ACCESS,
NULL, &hRegKey, &result);
// if key was created
if(result==REG_CREATED_NEW_KEY) {
// set its initial value
delay = 100;
RegSetValueEx(hRegKey, "delay", 0,
REG_DWORD, (LPBYTE) &delay, sizeof(DWORD));
RegSetValueEx(hRegKey, "message", 0,
REG_SZ, (LPBYTE) str, strlen(str)+1);
}
else { // key was already in registry
// get delay value
datasize = sizeof(DWORD);
RegQueryValueEx(hRegKey, "delay", NULL,
&datatype, (LPBYTE) &delay, &datasize);
// get message
datasize = MSGSIZE;
RegQueryValueEx(hRegKey, "message", NULL,
&datatype, (LPBYTE) str, &datasize);
}
// create delay spin control
hEboxWnd = GetDlgItem(hdwnd, IDD_EB1);
udWnd = CreateUpDownControl(
WS_CHILD | WS_BORDER | WS_VISIBLE |
UDS_SETBUDDYINT | UDS_ALIGNRIGHT,
20, 10, 50, 50,
hdwnd,
IDD_UPDOWN,
hMainInstance,
hEboxWnd,
DELAYMAX, 1, delay);
// initialize edit box with current message
SetDlgItemText(hdwnd, IDD_EB2, str);
return 1;
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDOK:
// set delay value
delay = GetDlgItemInt(hdwnd, IDD_EB1, NULL, 1);
// get message string
GetDlgItemText(hdwnd, IDD_EB2, str, MSGSIZE);
// update registry
RegSetValueEx(hRegKey, "delay", 0,
REG_DWORD, (LPBYTE) &delay, sizeof(DWORD));
RegSetValueEx(hRegKey, "message", 0,
REG_SZ, (LPBYTE) str, strlen(str)+1);
// fall through to next case ...
case IDCANCEL:
RegCloseKey(hRegKey);
EndDialog(hdwnd, 0);
return 1;
}
break;
}
return 0;
}
|
|
From: Ioannis V. <no...@ho...> - 2003-01-16 13:35:09
|
-------Original Message-------=0D
=0D
From: Daniel Glenfield=0D
Date: Thursday, 16 January 2003 11:09:47 AM=0D
To: pw...@ia...=0D
Cc: dev...@li...=0D
Subject: Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc.=0D
=0D
Thanks I'll do some research.=0D
Can you tell me how to put these values in to a struct?=0D
=0D
1, "Letter"=0D
2, "Letter(small)"=0D
3, "Tabloid"=0D
=0D
etc. I'm having trouble with this.=0D
=0D
// I asssume C=0D
=0D
=3D=3D> #include <string.h>=0D
=0D
=0D
struct PAPER=0D
{=0D
int Num;=0D
char* PaperStrings[42][1];=0D
=0D
=3D=3D>The 1 thing is reduntant!=0D
=0D
=3D=3D> char *PaperStrings[42];=0D
=0D
=0D
} PaperTypes, *PaperStruct =3D &PaperTypes;=0D
=0D
PaperTypes.Num =3D 1;=0D
=0D
PaperTypes.PaperStrings[42][1] =3D "Letter";=0D
=0D
=0D
=3D=3D> strncpy(PaperTypes.PaperStrings, "Letter", 42);=0D
=0D
=0D
PaperStruct->PaperStrings[40][1] =3D "Letter(small)";=0D
=0D
=3D=3D> /* ... */=0D
=0D
As you can see this is very wrong. I feel an idiot, but all the examples =
of =0D
structs I have seen do not use arrays or do anything like this, so I don'=
t =0D
know how to do it!=0D
=0D
=0D
=0D
=3D=3D> I also suggest "The C Programming Language" 2nd Edition by Brian
Kernighan - Dennis Ritchie (the creator of C).=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20 |
|
From: Ioannis V. <no...@ho...> - 2003-01-16 13:26:11
|
-------Original Message-------=0D =0D From: Daniel Glenfield=0D Date: Thursday, 16 January 2003 10:41:20 AM=0D To: dev...@li...=0D Subject: Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc.=0D =0D I'll have to go look all these up. I want to try the lookup table because= it =0D was recommended by a peer, and I don't know how to do it so two very good= =0D reasons there.=0D I'm using MFC, is STL included with that or do I need to #include some =0D header files?=0D =0D =0D =3D=3D> STL, which is a subset of the standard library (but the largest p= ortion of it, so many confuse the term "standard library" with "STL") is part of the core language so it is available to every ANSI/ISO C++ compliant compiler (from small embedded devices to large mainframes).=0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |
|
From: Ioannis V. <no...@ho...> - 2003-01-16 13:20:37
|
-------Original Message-------=0D =0D From: Dany P. Wu=0D Date: Thursday, 16 January 2003 9:39:54 AM=0D To: 'Ioannis Vranos'=0D Subject: RE: [Dev-C++] Compiling problems with 4.9.7.0 and GCC 3.2=0D =0D =0D Thank you very much for the above corrections. All of the previous=0D errors are now gone but there's another error now - something to do with=0D the Makefile:=0D =0D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=0D Compiler: Default compiler=0D Building Makefile: "F:\Dev-Cpp\Makefile.win"=0D Finding dependencies for file: F:\Dev-Cpp\D:\Documents and=0D Settings\Dany\My Documents\test.cpp=0D Executing make...=0D make.exe -f "F:\Dev-Cpp\Makefile.win" all=0D F:\Dev-Cpp\Makefile.win:25: *** multiple target patterns. Stop.=0D Execution terminated=0D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=0D =0D =0D =3D=3D> (I have no idea of makefiles.)=0D =0D =0D =0D This program seems to be quite different than the standard command line=0D compiler I used previously (Borland C++ v5.5). I'm quite new to=0D programming hence easily confused.=0D =0D Can someone please direct me to some tutorial or written material I can=0D use to study? The book I have now is obviously for an older version of=0D C++ or some such.=0D =0D =0D An excellent book for beginners is "Accelerated C++" by Andrew Koenig - Barbara Moo. However if you have finished some introductory book such as=20 Teach Yourself C++ in 21 Days" by Jesse Liberty (even if some outdated version) i suggest you go directly to the Light: "The C++ Programming Language" 3rd Edition or Special Edition by Bjarne Stroustrup (the creato= r of C++). Keep in mind that this book will take years to read it cover to cover thoroughly.=0D =0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |
|
From: Interia <up...@in...> - 2003-01-16 12:35:45
|
Hi. Does anybody know how to create text (for example text in about dialog ) = wchich looks and acts like internet link. Thanks. Upanie. |
|
From: <cg...@wo...> - 2003-01-16 10:57:52
|
If you use iostream instead iostream.h you must:
1) Add using namespace std; before main or as its first line
2) Each time you use a function or name from it you have to write std::
just before it, in your example: std::cout
The use of iostream.h is considered deprecated, so if you want use it it
would be more comfortable if you add the compiler option
-Wno-deprecated, so the compiler won't send you a very long warning
about it.
Dany P. Wu wrote:
>Hi everyone,
>
>This problem has probably come up for discussion numerous times before.
>It's certainly puzzled me to no end, being a learner at this whole C++
>business.
>
>I figured, by looking in the include directory, that I should use
>iostream instead of iostream.h
>
>That much seemed obvious but when I typed this typical beginner's code:
>
>==================================
>#include <iostream>
>
>main()
>{
> cout << "Hello world!";
> return(0);
>}
>==================================
>
>
|
|
From: Daniel G. <sp...@ho...> - 2003-01-16 10:43:05
|
I'm having trouble with my compare function. The compiler is complaining
that there is no conversion from char** to int. I don't get it!
I've created an array with data and now I want to loop through it until I
find a match for gKey in Array[Here][blank].
#include <iostream>
const char* gKey = "5";
// Forward declaration
int Compare( const char* Check1, char* Check2[41][2] );
int main(int argc, char** argv)
{
// Declare the struct and then initialise the array it contains
struct PAPER
{
char* PaperStrings[41][2];
} PaperTypes, *PaperStruct = &PaperTypes;
int StructSize = sizeof(PaperTypes);
std::cout << StructSize << std::endl;
PaperTypes.PaperStrings[0][0] = "1";
PaperTypes.PaperStrings[0][1] = "Paper Type: Letter";
PaperTypes.PaperStrings[1][0] = "2";
PaperTypes.PaperStrings[1][1] = "Paper Type: Letter(small)";
PaperTypes.PaperStrings[2][0] = "3";
PaperTypes.PaperStrings[2][1] = "Paper Type: Tabloid";
PaperTypes.PaperStrings[3][0] = "4";
PaperTypes.PaperStrings[3][1] = "Paper Type: Ledger";
PaperTypes.PaperStrings[4][0] = "5";
PaperTypes.PaperStrings[4][1] = "Paper Type: Legal";
PaperTypes.PaperStrings[5][0] = "6";
PaperTypes.PaperStrings[5][1] = "Paper Type: Statement";
PaperTypes.PaperStrings[6][0] = "7";
PaperTypes.PaperStrings[6][1] = "Paper Type: Executive";
PaperTypes.PaperStrings[7][0] = "8";
PaperTypes.PaperStrings[7][1] = "Paper Type: A3";
PaperTypes.PaperStrings[8][0] = "9";
PaperTypes.PaperStrings[8][1] = "Paper Type: A4";
PaperTypes.PaperStrings[9][0] = "10";
PaperTypes.PaperStrings[9][1] = "Paper Type: Statement";
PaperTypes.PaperStrings[10][0] = "11";
PaperTypes.PaperStrings[10][1] = "Paper Type: Executive";
// etc.
// Commented out, calling Compare to do search.
// bsearch(gKey, PaperStruct, StructSize, sizeof(char*), Compare(gKey,
PaperTypes.PaperStrings));
Compare(gKey, PaperTypes.PaperStrings);
return 0;
}
// Compare function
int Compare( const char* Check1, char* Check2[41][2] )
{
// Look for a match. Loop until found or Temp = 60
for (int Temp = 0; Temp < (sizeof(*Check2) || 60); Temp++)
{
if (*Check1 == Check2[Temp])
{
std::cout << "\nLookup was completed successfully!!!\n\n" <<
std::endl;
}
else
{
// Do nothing
}
}
return 1;
}
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
|
|
From: Mark S. <mar...@li...> - 2003-01-16 10:13:07
|
If there are any kind souls out there who are makefile experts who could take a look at the makefiles I be most appreciative. TIA Mark The libraries are: 1) meschach details here http://www.math.uiowa.edu/~dstewart/meschach/meschach.html 2) templates http://www.netlib.org/templates/ see sctemplates.tgz (single precision) or dctemplates.tgz (double precision) C code translated from Fortran using f2c -----Original Message----- From: Luigi Santillo [mailto:gi...@li...] Sent: 15 January 2003 07:10 To: dev...@li... Subject: Re: [Dev-C++] iterative matrix library On Tue, Jan 14, 2003 at 11:26:54AM -0000, Mark Smith wrote: > [...] > ? there are lots of *nix packages out there but I am having zero luck at > modifying the makefiles so I can compile and produce a static library. > [...] > mark Hi, Mark probably you could compile all the source files which come with the package and place them in one static library, that is, do manually what the makefile would otherwise automatically do for you. You could also post the makefile ... probably someone might help modifying it. -- >> gisan >> ------------------------------------------------------- This SF.NET email is sponsored by: A Thawte Code Signing Certificate is essential in establishing user confidence by providing assurance of authenticity and code integrity. Download our Free Code Signing guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://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.406 / Virus Database: 229 - Release Date: 21/10/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.406 / Virus Database: 229 - Release Date: 21/10/02 The information contained in this e-mail message (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s). If you are not an addressee, any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited. If you have received this communication in error, please contact us immediately so that we can correct the error. |
|
From: Daniel G. <sp...@ho...> - 2003-01-16 09:08:42
|
Thanks I'll do some research.
Can you tell me how to put these values in to a struct?
1, "Letter"
2, "Letter(small)"
3, "Tabloid"
etc. I'm having trouble with this.
struct PAPER
{
int Num;
char* PaperStrings[42][1];
} PaperTypes, *PaperStruct = &PaperTypes;
PaperTypes.Num = 1;
PaperTypes.PaperStrings[42][1] = "Letter";
PaperStruct->PaperStrings[40][1] = "Letter(small)";
As you can see this is very wrong. I feel an idiot, but all the examples of
structs I have seen do not use arrays or do anything like this, so I don't
know how to do it!
Can you help?
>From: Per Westermark <pw...@ia...>
>To: Daniel Glenfield <sp...@ho...>
>CC: dev...@li...
>Subject: Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc.
>Date: Thu, 16 Jan 2003 10:43:12 +0100 (CET)
>
>In MFC applications, you might decide to use CMap instead.
>
>/Per W
>
>On Thu, 16 Jan 2003, Daniel Glenfield wrote:
>
> > I'll have to go look all these up. I want to try the lookup table
>because it
> > was recommended by a peer, and I don't know how to do it so two very
>good
> > reasons there.
> > I'm using MFC, is STL included with that or do I need to #include some
> > header files?
> >
> >
> > >From: "Ioannis Vranos" <no...@ho...>
> > >To: <dev...@li...>
> > >Subject: Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc.
> > >Date: Wed, 15 Jan 2003 18:27:19 +0200 (GTB Standard Time)
> > >
> > >From standard library you can use map, etc.
> > >
> > >
> > >
> > >Ioannis Vranos
> > >
> > >* Programming pages: http://www.noicys.freeurl.com
> > >* Alternative URL: http://run.to/noicys
> > >
> > >
> > >-------Original Message-------
> > >
> > >From: Daniel Glenfield
> > >Date: Wednesday, 15 January 2003 5:59:53 PM
> > >To: dev...@li...
> > >Subject: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc.
> > >
> > >I'm trying to understand lookup tables and the bsearch, lsearch, qsort
> > >functions. I'm trying to create a structure with an integer and a text
> > >string, and I want to look up the number and get the text associated
>with
> > >it. for example, at the moment I have
> > >
> > >// BIG switch here
> > >switch (PaperSize) // can be 1 - 41
> > >{
> > >case 1: ListBox = "Paper Type: Letter";
> > >Listbox->AddString(ListBoxChoice);
> > >break;
> > >
> > >case 2: //... the same again
> > >//...
> > >case 41: // same again
> > >
> > >
> > >I'm trying to replace this with a lookup table but I'm finding it
>difficult
> > >- examples on the net about bsearch are not quite what I need.
> > >
> > >
> > >-------------------------------------------------------
> > >This SF.NET email is sponsored by: Take your first step towards giving
> > >your online business a competitive advantage. Test-drive a Thawte SSL
> > >certificate - our easy online guide will show you how. Click here to
>get
> > >started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
> > >_______________________________________________
> > >Dev-cpp-users mailing list
> > >Dev...@li...
> > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
> >
> > _________________________________________________________________
> > Help STOP SPAM: Try the new MSN 8 and get 2 months FREE*
> > http://join.msn.com/?page=features/junkmail
> >
> >
> >
> > -------------------------------------------------------
> > This SF.NET email is sponsored by: A Thawte Code Signing Certificate
> > is essential in establishing user confidence by providing assurance of
> > authenticity and code integrity. Download our Free Code Signing guide:
> > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
>
>-------------------------------------------------------
>This SF.NET email is sponsored by: A Thawte Code Signing Certificate
>is essential in establishing user confidence by providing assurance of
>authenticity and code integrity. Download our Free Code Signing guide:
>http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
|
|
From: Per W. <pw...@ia...> - 2003-01-16 08:50:21
|
In MFC applications, you might decide to use CMap instead. /Per W On Thu, 16 Jan 2003, Daniel Glenfield wrote: > I'll have to go look all these up. I want to try the lookup table because it > was recommended by a peer, and I don't know how to do it so two very good > reasons there. > I'm using MFC, is STL included with that or do I need to #include some > header files? > > > >From: "Ioannis Vranos" <no...@ho...> > >To: <dev...@li...> > >Subject: Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc. > >Date: Wed, 15 Jan 2003 18:27:19 +0200 (GTB Standard Time) > > > >From standard library you can use map, etc. > > > > > > > >Ioannis Vranos > > > >* Programming pages: http://www.noicys.freeurl.com > >* Alternative URL: http://run.to/noicys > > > > > >-------Original Message------- > > > >From: Daniel Glenfield > >Date: Wednesday, 15 January 2003 5:59:53 PM > >To: dev...@li... > >Subject: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc. > > > >I'm trying to understand lookup tables and the bsearch, lsearch, qsort > >functions. I'm trying to create a structure with an integer and a text > >string, and I want to look up the number and get the text associated with > >it. for example, at the moment I have > > > >// BIG switch here > >switch (PaperSize) // can be 1 - 41 > >{ > >case 1: ListBox = "Paper Type: Letter"; > >Listbox->AddString(ListBoxChoice); > >break; > > > >case 2: //... the same again > >//... > >case 41: // same again > > > > > >I'm trying to replace this with a lookup table but I'm finding it difficult > >- examples on the net about bsearch are not quite what I need. > > > > > >------------------------------------------------------- > >This SF.NET email is sponsored by: Take your first step towards giving > >your online business a competitive advantage. Test-drive a Thawte SSL > >certificate - our easy online guide will show you how. Click here to get > >started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > _________________________________________________________________ > Help STOP SPAM: Try the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: A Thawte Code Signing Certificate > is essential in establishing user confidence by providing assurance of > authenticity and code integrity. Download our Free Code Signing guide: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Daniel G. <sp...@ho...> - 2003-01-16 08:12:25
|
I'll have to go look all these up. I want to try the lookup table because it was recommended by a peer, and I don't know how to do it so two very good reasons there. I'm using MFC, is STL included with that or do I need to #include some header files? >From: "Ioannis Vranos" <no...@ho...> >To: <dev...@li...> >Subject: Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc. >Date: Wed, 15 Jan 2003 18:27:19 +0200 (GTB Standard Time) > >From standard library you can use map, etc. > > > >Ioannis Vranos > >* Programming pages: http://www.noicys.freeurl.com >* Alternative URL: http://run.to/noicys > > >-------Original Message------- > >From: Daniel Glenfield >Date: Wednesday, 15 January 2003 5:59:53 PM >To: dev...@li... >Subject: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc. > >I'm trying to understand lookup tables and the bsearch, lsearch, qsort >functions. I'm trying to create a structure with an integer and a text >string, and I want to look up the number and get the text associated with >it. for example, at the moment I have > >// BIG switch here >switch (PaperSize) // can be 1 - 41 >{ >case 1: ListBox = "Paper Type: Letter"; >Listbox->AddString(ListBoxChoice); >break; > >case 2: //... the same again >//... >case 41: // same again > > >I'm trying to replace this with a lookup table but I'm finding it difficult >- examples on the net about bsearch are not quite what I need. > > >------------------------------------------------------- >This SF.NET email is sponsored by: Take your first step towards giving >your online business a competitive advantage. Test-drive a Thawte SSL >certificate - our easy online guide will show you how. Click here to get >started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Help STOP SPAM: Try the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail |
|
From: Marc H. <ma...@e-...> - 2003-01-16 07:22:54
|
Click on Project (menu) -> Project Options -> Compiler (tab) -> Linker (tree) -> Generate Debugging Information = Yes. And then Recompile All. _____________________________ Marc Heiligers -----Original Message----- From: tomasino [mailto:tom...@ho...] Sent: 16 January 2003 06:40 AM To: dev...@li... Subject: [Dev-C++] Hello When I try to debug a proyect it shows me: "You need to put debugging mode on before debugging". Please help me on this. I'm cuban, forgive my English. Thanks. |
|
From: Marc H. <ma...@e-...> - 2003-01-16 07:19:28
|
Hi Niklas, I would send them with vRoach, but vRoach doesn't come up when it crashes in this way. In fact, even when vRoach opens up due to some crash, it doesn't successfully send data. I'm pretty sure the developers read this. _____________________________ Marc Heiligers -----Original Message----- From: Niklas Kyster Rasmussen [mailto:nik...@ho...] Sent: 15 January 2003 02:29 PM To: dev...@li... Subject: Re: [Dev-C++] Dev-Cpp crashes Hi :) I think bug reports have to be sendt with: vRoach.exe in the dev-cpp direktery! I'm not shure the any dev-c++ develepers read mail from this list... -Niklas btw, don't take my words for facks, I might be wrong ;o) >From: Marc Heiligers <ma...@e-...> >To: dev-cpp-users-list <dev...@li...> >Subject: [Dev-C++] Dev-Cpp crashes >Date: Wed, 15 Jan 2003 13:06:08 +0200 > >A note to the developers of Dev-Cpp (My gripe for the day): >I have found that the most frequent cause of a crash on my system (P3, >394MB, WinXP) is a tooltip popping up in the code window, and then >never going away. It seems to happen mainly if I am typing and the >mouse is over the code window (obviously over some code that will >generate a tooltip). The tooltip seems to be topmost for all windows, >as I can change application and >it still sits on top. This only happens occasionally, perhaps once a day, >and doesn't hamper my coding too much, and certainly won't make me stop >using Dev-Cpp. Just thought you'd like to know. > >_____________________________ >Marc Heiligers > > >------------------------------------------------------- >This SF.NET email is sponsored by: Take your first step towards giving >your online business a competitive advantage. Test-drive a Thawte SSL >certificate - our easy online guide will show you how. Click here to >get >started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Help STOP SPAM: Try the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail |
|
From: Ioannis V. <no...@ho...> - 2003-01-16 06:53:11
|
------Original Message-------=0D
=0D
From: Dany P. Wu=0D
Date: Thursday, 16 January 2003 7:38:20 AM=0D
To: dev...@li...=0D
Subject: [Dev-C++] Compiling problems with 4.9.7.0 and GCC 3.2=0D
=0D
Hi everyone,=0D
=0D
This problem has probably come up for discussion numerous times before.=0D
It's certainly puzzled me to no end, being a learner at this whole C++=0D
business.=0D
=0D
I figured, by looking in the include directory, that I should use=0D
iostream instead of iostream.h=0D
=0D
That much seemed obvious but when I typed this typical beginner's code:=0D
=0D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D
#include <iostream>=0D
=0D
main()=0D
=0D
=3D=3D> int main()=0D
=0D
{=0D
=3D=3D>std::cout << "Hello world!";=0D
return(0);=0D
}=0D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D
=0D
I got some humangous amount of errors, 70 I think. I apologise for the=0D
length of this log but I thought I better include it for the sake of=0D
completion. You guys probably know this already.=0D
=0D
The question is, where have I gone wrong? What's happening here? Any=0D
help would be immensely appreciated.=0D
=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20
|
|
From: Dany P. W. <da...@qu...> - 2003-01-16 05:37:56
|
Hi everyone,
This problem has probably come up for discussion numerous times before.
It's certainly puzzled me to no end, being a learner at this whole C++
business.
I figured, by looking in the include directory, that I should use
iostream instead of iostream.h
That much seemed obvious but when I typed this typical beginner's code:
==================================
#include <iostream>
main()
{
cout << "Hello world!";
return(0);
}
==================================
I got some humangous amount of errors, 70 I think. I apologise for the
length of this log but I thought I better include it for the sake of
completion. You guys probably know this already.
The question is, where have I gone wrong? What's happening here? Any
help would be immensely appreciated.
Cheers,
Dany.
<quote compile log>
Compiler: Default compiler
Executing g++.exe...
g++.exe "D:\Documents and Settings\Dany\My Documents\test.cpp" -o
"D:\Documents and Settings\Dany\My Documents\test.exe"
-I"F:\Dev-Cpp\include\c++" -I"F:\Dev-Cpp\include" -L"F:\Dev-Cpp\lib"
In file included from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/iostream:44:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/ios:44,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/iosfwd:44:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/iosfwd:45,
from F:/Dev-Cpp/include/c++/ios:44,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/stringfwd.h:44:28: bits/c++config.h: No such
file or directory
In file included from F:/Dev-Cpp/include/c++/iosfwd:46,
from F:/Dev-Cpp/include/c++/ios:44,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/fpos.h:44:24: bits/c++io.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/bits/fpos.h:45,
from F:/Dev-Cpp/include/c++/iosfwd:46,
from F:/Dev-Cpp/include/c++/ios:44,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/cwchar:49:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/iosfwd:46,
from F:/Dev-Cpp/include/c++/ios:44,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/fpos.h:60: 'streamoff' is used as a type,
but is
not defined as a type.
F:/Dev-Cpp/include/c++/bits/fpos.h:74: parse error before `__off'
F:/Dev-Cpp/include/c++/bits/fpos.h:75: missing ';' before right brace
F:/Dev-Cpp/include/c++/bits/fpos.h:77: semicolon missing after
declaration of `
std::fpos<_StateT>'
F:/Dev-Cpp/include/c++/bits/fpos.h: In constructor
`std::fpos<_StateT>::fpos()':
F:/Dev-Cpp/include/c++/bits/fpos.h:72: class `std::fpos<_StateT>' does
not have any field named `_M_off'
F:/Dev-Cpp/include/c++/bits/fpos.h: At global scope:
F:/Dev-Cpp/include/c++/bits/fpos.h:77: parse error before `(' token
F:/Dev-Cpp/include/c++/bits/fpos.h:77: ISO C++ forbids defining types
within
return type
F:/Dev-Cpp/include/c++/bits/fpos.h:77: syntax error before `(' token
F:/Dev-Cpp/include/c++/bits/fpos.h:79: syntax error before `&' token
F:/Dev-Cpp/include/c++/bits/fpos.h:82: syntax error before `&' token
F:/Dev-Cpp/include/c++/bits/fpos.h:86: syntax error before `operator'
F:/Dev-Cpp/include/c++/bits/fpos.h:89: syntax error before `+=' token
F:/Dev-Cpp/include/c++/bits/fpos.h:94: syntax error before `operator'
F:/Dev-Cpp/include/c++/bits/fpos.h:97: syntax error before `-=' token
F:/Dev-Cpp/include/c++/bits/fpos.h:102: parse error before `&' token
F:/Dev-Cpp/include/c++/bits/fpos.h:103: non-member function `bool
operator==(...)' cannot have `const' method qualifier
F:/Dev-Cpp/include/c++/bits/fpos.h:103: `bool operator==(...)' must have
an
argument of class or enumerated type
F:/Dev-Cpp/include/c++/bits/fpos.h:103: `bool operator==(...)' must take
exactly two arguments
F:/Dev-Cpp/include/c++/bits/fpos.h: In function `bool operator==(...)':
F:/Dev-Cpp/include/c++/bits/fpos.h:103: `_M_off' undeclared (first use
this
function)
F:/Dev-Cpp/include/c++/bits/fpos.h:103: (Each undeclared identifier is
reported
only once for each function it appears in.)
F:/Dev-Cpp/include/c++/bits/fpos.h:103: `__pos' undeclared (first use
this
function)
F:/Dev-Cpp/include/c++/bits/fpos.h: At global scope:
F:/Dev-Cpp/include/c++/bits/fpos.h:106: parse error before `&' token
F:/Dev-Cpp/include/c++/bits/fpos.h:107: non-member function `bool
operator!=(...)' cannot have `const' method qualifier
F:/Dev-Cpp/include/c++/bits/fpos.h:107: `bool operator!=(...)' must have
an
argument of class or enumerated type
F:/Dev-Cpp/include/c++/bits/fpos.h:107: `bool operator!=(...)' must take
exactly two arguments
F:/Dev-Cpp/include/c++/bits/fpos.h:110: parse error before `)' token
F:/Dev-Cpp/include/c++/bits/fpos.h:113: `streamoff' was not declared in
this
scope
F:/Dev-Cpp/include/c++/bits/fpos.h:113: parse error before `)' token
F:/Dev-Cpp/include/c++/bits/fpos.h: In function `void _M_position(...)':
F:/Dev-Cpp/include/c++/bits/fpos.h:113: `__off' undeclared (first use
this
function)
F:/Dev-Cpp/include/c++/bits/fpos.h: At global scope:
F:/Dev-Cpp/include/c++/bits/fpos.h:114: parse error before `}' token
F:/Dev-Cpp/include/c++/bits/fpos.h:117: syntax error before `;' token In
file included from F:/Dev-Cpp/include/c++/ios:46,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/char_traits.h:59: parse error before `;'
token
F:/Dev-Cpp/include/c++/bits/char_traits.h:60: parse error before `;'
token F:/Dev-Cpp/include/c++/bits/char_traits.h:113: parse error before
`;' token
F:/Dev-Cpp/include/c++/bits/char_traits.h:114: parse error before `;'
token
F:/Dev-Cpp/include/c++/bits/char_traits.h: In static member function
`static
int std::char_traits<char>::eof()':
F:/Dev-Cpp/include/c++/bits/char_traits.h:168: `EOF' undeclared (first
use this
function) In file included from F:/Dev-Cpp/include/c++/ios:47,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/cstdio:49:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/localefwd.h:45:28: bits/c++config.h: No such
file or directory
F:/Dev-Cpp/include/c++/bits/localefwd.h:46:80: bits/c++locale.h: No such
file or directory
In file included from F:/Dev-Cpp/include/c++/bits/localefwd.h:48,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/cctype:48:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/string:45:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/memory:54,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/stl_algobase.h:64:28: bits/c++config.h: No
such file or directory
In file included from F:/Dev-Cpp/include/c++/bits/stl_algobase.h:67,
from F:/Dev-Cpp/include/c++/memory:54,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/cstdlib:49:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/bits/stl_algobase.h:72,
from F:/Dev-Cpp/include/c++/memory:54,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/type_traits.h:54:28: bits/c++config.h: No
such file or directory
In file included from
F:/Dev-Cpp/include/c++/bits/stl_iterator_base_funcs.h:68,
from F:/Dev-Cpp/include/c++/bits/stl_algobase.h:74,
from F:/Dev-Cpp/include/c++/memory:54,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/concept_check.h:40:28: bits/c++config.h: No
such file or directory
In file included from F:/Dev-Cpp/include/c++/bits/stl_alloc.h:86,
from F:/Dev-Cpp/include/c++/memory:55,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/stl_threads.h:52:23: bits/gthr.h: No such
file or directory
In file included from F:/Dev-Cpp/include/c++/bits/stl_alloc.h:86,
from F:/Dev-Cpp/include/c++/memory:55,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/stl_threads.h: At global scope:
F:/Dev-Cpp/include/c++/bits/stl_threads.h:69: '__gthread_mutex_t' is
used as a
type, but is not defined as a type.
F:/Dev-Cpp/include/c++/bits/stl_threads.h:79:2: #error
__GTHREAD_MUTEX_INIT or __GTHREAD_MUTEX_INIT_FUNCTION should be defined
by gthr.h abstraction layer, report problem to lib...@gc....
F:/Dev-Cpp/include/c++/bits/stl_threads.h: In member function `void
std::_Refcount_Base::_M_incr()':
F:/Dev-Cpp/include/c++/bits/stl_threads.h:86: `_M_ref_count_lock'
undeclared
(first use this function)
F:/Dev-Cpp/include/c++/bits/stl_threads.h:86: `__gthread_mutex_lock'
undeclared
(first use this function)
F:/Dev-Cpp/include/c++/bits/stl_threads.h:88: `__gthread_mutex_unlock'
undeclared (first use this function)
F:/Dev-Cpp/include/c++/bits/stl_threads.h: At global scope:
F:/Dev-Cpp/include/c++/bits/stl_threads.h:158: '__gthread_mutex_t' is
used as a
type, but is not defined as a type.
F:/Dev-Cpp/include/c++/bits/stl_threads.h: In member function `void
std::_STL_mutex_lock::_M_acquire_lock()':
F:/Dev-Cpp/include/c++/bits/stl_threads.h:192: `_M_lock' undeclared
(first use
this function)
In file included from F:/Dev-Cpp/include/c++/memory:55,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/stl_alloc.h: At global scope:
F:/Dev-Cpp/include/c++/bits/stl_alloc.h:575: syntax error before `;'
token
F:/Dev-Cpp/include/c++/bits/stl_alloc.h:575: confused by earlier errors,
bailing out Execution terminated
<end quote compile log>
--
This mail is a natural product. The slight variations in
spelling and grammar enhance its individual character and
beauty and in no way are to be considered flaws or defects.
|
|
From: Luigi S. <gi...@li...> - 2003-01-16 05:33:34
|
On Tue, Jan 14, 2003 at 11:26:54AM -0000, Mark Smith wrote: > [...] > ? there are lots of *nix packages out there but I am having zero luck at > modifying the makefiles so I can compile and produce a static library. > [...] > mark Hi, Mark probably you could compile all the source files which come with the package and place them in one static library, that is, do manually what the makefile would otherwise automatically do for you. You could also post the makefile ... probably someone might help modifying it. -- >> gisan >> |
|
From: <cg...@wo...> - 2003-01-15 22:53:11
|
-------- Original Message -------- Subject: RE: [Dev-C++] I am having trouble with 5.0 Date: Wed, 15 Jan 2003 13:11:11 -0500 From: "Jeremy Petzold" <jpe...@ea...> To: 'Carlos Garc=EDa del Monte' <cg...@wo...> Will that get fixed by the time of the final release? Jeremy Petzold AIM: modmans2ndcoming -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Carlos Garc=EDa del Monte Sent: Wednesday, January 15, 2003 6:41 AM To: dev-cpp-users-list Subject: Re: [Dev-C++] I am having trouble with 5.0 You have to set the directories in the compiler options, iostream is in=20 include/c++/3.2/ (But I have them separately and I'm not sure you have=20 the same dir structure, however it would be just a matter of seacrh for it.) Jeremy Petzold wrote: > I have 4.0 installed and I can compile and run the programs fine, but=20 > I installed 5.0.....yes, I un-installed 4.0.......and then I went to tr= y to=20 > compile a hello world just to make sure it worked, and it could not=20 > find iostream. What did I do wrong? Should I try installing mingw=20 > separately? > ------------------------------------------------------- This SF.NET email is sponsored by: Take your first step towards giving=20 your online business a competitive advantage. Test-drive a Thawte SSL=20 certificate - our easy online guide will show you how. Click here to get started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |