dev-cpp-users Mailing List for Dev-C++ (Page 138)
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: Mic W. <wag...@ya...> - 2005-04-13 14:39:42
|
Greetings I am trying to compile a c++ file main.cpp and is getting an error [Linking error] undefined reference to Get(). main.cpp has an instruction to include a file Random1.h. The later gives the prototypes of Get(). The function itself is defined in Ramdom1.cpp I have two questions: 1- How do I link the file Random1.cpp 2-Is there a way to use something shorter than the long directive #include <C:\Documents and Settings\Gerard\Desktop\Math_home\Joshi\Test\Random1.h> Because, if I am working on a lot of files it becomes tedious. May be there is a way to tell the system where to look for files. --------------------------------- Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. |
|
From: <Mat...@Ve...> - 2005-04-13 14:26:41
|
Alright, I'll explain this for you really quick. When you include in C++, you include by filename. So, when the code says #include <iostream>, the <> means it's a system header in a standard directory like /usr/include/c++ or /usr/include for C headers on UNIX systems. On Windows the directories are a little "weird" but Dev-C++ takes care of it for you. This is different from Java, where the import keyword pulls stuff in by the name of the classes / packages you want. Personally, I have many more problems with the Java approach than the C++ approach, but that's just me. Your mileage may vary. Now, to include code of your own, place it in the same directory as the main file, and use "" instead of <>. For example, if you called the subten function's file subten.c, you would need #include "subten.c". Also, the compiler needs you to name files as .c or .cpp according to the kind of code you put in them, or it might get confused and try to compile some C++ as C, which will not usually work. If in doubt, call it a .cpp since C will compile as C++ 98/100 times. Hope this helps, Matt -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of Austin Scholze Sent: Tuesday, April 12, 2005 9:19 PM To: AAAAA Dev C++ mail list Subject: [Dev-C++] (no subject) <SNIP> #include "subten" </SNIP> ___________________________________________________________________ The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. |
|
From: Josh M. <mrl...@gm...> - 2005-04-13 13:23:26
|
Couldn't you use tmpnam()? Josh On 4/13/05, Per Westermark <pw...@ia...> wrote: > No, you will have to create the strings yourself with rand() or similar. >=20 > /Per W >=20 > On Wed, 13 Apr 2005, Georgia Ziwgou wrote: >=20 > > Hello! > > I would like to know if there is a function which produces random strin= gs. > > I need this because I want to create a file with 1000 random records th= at I will use in a SQL program with the order BULK_INSERT >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > 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: <ota...@ya...> - 2005-04-13 13:11:25
|
Hi Maxine, In Windows NT plataform not is possible access IO ports directly. For = this objective is need a device drive in kernel mode. Exist very much a = free software to facility this working, I'm using PortTalk, see web = sites to more information: http://www.beyondlogic.org/ http://cristal.sra.ufsc.br/~cabral/rogercom/ Ot=C3=A1vio Venezian J=C3=BAnior mailto:ota...@ya... http://www.otaviovj.cjb.net -----Mensagem original----- De: dev...@li... = [mailto:dev...@li...] Em nome de = maxime.desgrousilliers Enviada em: Tuesday, April 12, 2005 1:34 PM Para: dev-cpp-users Assunto: [Dev-C++] parallel port Hello, I would like to know how I can discuss with the port parrallel:send and receive a byte. Could you indicate the orders to me to be used as well as the files headers to include. I have tried to use the solution at http://geekhideout.com/iodll.shtml but when I compile my project with PortOut or PortIn I have got an error message which tell me that there is an error of segmentation (access violation). Could anyone help me? If it is possible can you post example of source which are successful for compilation. I must make that project in this two weeks, help me ! Thank you chexam Acc=C3=A9dez au courrier =C3=A9lectronique de La Poste : www.laposte.net = ;=20 3615 LAPOSTENET (0,34=E2=82=AC/mn) ; t=C3=A9l : 08 92 68 13 50 = (0,34=E2=82=AC/mn) ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id=14396&op=3Dick _______________________________________________ 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 --=20 No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 4/7/2005 =20 --=20 No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 4/7/2005 =20 |
|
From: Piotr O. S. <co...@si...> - 2005-04-13 10:25:25
|
Hi I supose You should use nn4.elf file instead ihex nn4.a43. Debugger need debug informations, which are striped when you convert from elf to ihex. Collins ----- Original Message ----- From: "Clive Brooks" <cli...@co...> To: <dev...@li...> Sent: Wednesday, April 13, 2005 12:56 AM Subject: [Dev-C++] problem with msp430-gcc and Dev-c++ > Help anybody, > > I am trying to get MSPGCC, the gcc port for the TI micro running > through DEV-C++ > I have linker setting "generate debugging information" on. > The code builds ok, compiler output for build all is :- > > ************************************************************** > Compiler: MSPGCC > Executing make clean > rm -f nn4.elf nn4.a43 nn4.lst nn4.o > > msp430-gcc -mmcu=msp430x123 -O2 -Wall -g -DTEST_SOURCE -c -o nn4.o > nn4.c > > msp430-gcc -mmcu=msp430x123 -o nn4.elf nn4.o > > msp430-objcopy -O ihex nn4.elf nn4.a43 > > msp430-objdump -dSt nn4.elf >nn4.lst > > Execution terminated > Compilation successful > **************************************************************** > > However when I run the debugger I get a message frame up saying > "Warning project is not compiled" > > What have I done wrong ? > > Thanks in advance. > > > Clive > > > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 12/04/2005 > > |
|
From: Per W. <pw...@ia...> - 2005-04-13 09:25:52
|
No, you will have to create the strings yourself with rand() or similar. /Per W On Wed, 13 Apr 2005, Georgia Ziwgou wrote: > Hello! > I would like to know if there is a function which produces random strings. > I need this because I want to create a file with 1000 random records that I will use in a SQL program with the order BULK_INSERT |
|
From: Georgia Z. <ziw...@ya...> - 2005-04-13 07:17:19
|
Hello! I would like to know if there is a function which produces random strings. I need this because I want to create a file with 1000 random records that I will use in a SQL program with the order BULK_INSERT --------------------------------- Do You Yahoo!? Αποκτήστε την δωρεάν σας@yahoo.gr διεύθυνση στο Yahoo! Mail. |
|
From: Per W. <pw...@ia...> - 2005-04-13 06:19:51
|
Don't put code in include files. Just put declarations there and code in
*.cpp files.
So:
subten.h:
int subten(int num);
subten.cpp:
#include "subten.h"
int subten(int num) {
return num - 10;
}
main.cpp:
#include <iostream>
#include "subten.h"
int main() {
...
a = subten(a);
...
}
Then add the new source file subten.cpp to your project, to make sure that
it gets compiled and linked into the application.
Note also, avoid "using namespace std" and instead just "wake up" the
individual items you need. And most importantly: don't do a big
global "using namespace std" in a header file. Note that the scope of the
using statement isn't limited to the include file but will "taint" the
source file that references the include file too.
Short note about include files. They are treated just as if all text in
them had been available in the *.cpp file. That is why they are called
include files :)
/Per W
On Wed, 13 Apr 2005, Austin Scholze wrote:
> Hi. I'm new to programming, and don't know all the terminology, so please go easy on me.
>
> I'm trying to figure out how to create a include file so I can use it's functions in my programs, by just including it.
>
> Here's my simple test program that didn't work in the least ^^
>
> __________________________________________________
>
> the program I tried to link to:
>
> #include<iostream>
>
> using namespace std;
>
>
> int subten(int num)
> {
> num -= 10;
> return num;
> }
>
> The program I tried to link to the above with:
>
> #include <iostream>
> #include "subten"
> using namespace std;
>
> main()
> {
>
> int a = 20;
> cout << a << endl;
> a=subten(a);
> cout << a;
>
> system("pause");
> }
>
> Ok, now please don't chew me out to bad for the mistakes that I made, and are common knowledge to everyone but me :p. thanks.
>
|
|
From: Austin S. <Aus...@co...> - 2005-04-13 04:19:31
|
Hi. I'm new to programming, and don't know all the terminology, so =
please go easy on me.
I'm trying to figure out how to create a include file so I can use it's =
functions in my programs, by just including it.
Here's my simple test program that didn't work in the least ^^=20
__________________________________________________
the program I tried to link to:
#include<iostream>
using namespace std;
int subten(int num)
{
num -=3D 10;
return num;
}
The program I tried to link to the above with:
#include <iostream>
#include "subten"
using namespace std;
main()
{
int a =3D 20;
cout << a << endl;=20
a=3Dsubten(a);
cout << a;
system("pause");
}
Ok, now please don't chew me out to bad for the mistakes that I made, =
and are common knowledge to everyone but me :p. thanks.
|
|
From: ymc014 <ym...@ym...> - 2005-04-12 23:57:52
|
Hi,
You can try wx-Devcpp at http://wxdsgn.sourceforge.net or wxWidgets =
at http://www.wxwidgets.org=20
ymc
----- Original Message -----=20
From: DAnielDAtcu=20
To: Dev-C++ List=20
Sent: Tuesday, April 12, 2005 7:53 PM
Subject: [Dev-C++] Visual tools
Sirs,
I am compelled by my bosses to use MS Visual Cabbage, but I hate it :)
What Visual tools has DevC++? I mean how do I to have my projects =
resources viewed, adding buttons and stuff on forms &c. ?
best regards, and excuse my style,
-------------------------------------------------------------------------=
-----
Die oben genannten wurden geschrieben bei //The above were written by
[||.||]: Dan...@ya...=20
|
|
From: Clive B. <cli...@co...> - 2005-04-12 22:56:32
|
Help anybody,
I am trying to get MSPGCC, the gcc port for the TI micro running
through DEV-C++
I have linker setting "generate debugging information" on.
The code builds ok, compiler output for build all is :-
**************************************************************
Compiler: MSPGCC
Executing make clean
rm -f nn4.elf nn4.a43 nn4.lst nn4.o
msp430-gcc -mmcu=msp430x123 -O2 -Wall -g -DTEST_SOURCE -c -o nn4.o
nn4.c
msp430-gcc -mmcu=msp430x123 -o nn4.elf nn4.o
msp430-objcopy -O ihex nn4.elf nn4.a43
msp430-objdump -dSt nn4.elf >nn4.lst
Execution terminated
Compilation successful
****************************************************************
However when I run the debugger I get a message frame up saying
"Warning project is not compiled"
What have I done wrong ?
Thanks in advance.
Clive
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 12/04/2005
|
|
From: Alfred P. R. <al...@ya...> - 2005-04-12 17:20:43
|
Hi Daniel, Visual tools are not available, to my knowledge, from the Dev-C++ at Bloodshed (I could be full of bovine excreta, BTW!). However there is a wxWidgets extension version, available at http://wxdsgn.sourceforge.net/. That has similar capabilities as VC. I've been using it for a few months, and though it had some subtle bugs, those apparently where fixed with the March - 20- 2005 , Beta 6.7 fix. Good Luck! Al DAnielDAtcu <dan...@pl...> wrote: Sirs, I am compelled by my bosses to use MS Visual Cabbage, but I hate it :) What Visual tools has DevC++? I mean how do I to have my projects resources viewed, adding buttons and stuff on forms &c. ? best regards, and excuse my style, Alfred P. Reaud |
|
From: <Mat...@Ve...> - 2005-04-12 16:37:12
|
My understanding was that compilers don't mangle C names in libraries, only
C++ ones.
Now I'm really confused!
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Gerson
Lara
Sent: Monday, April 11, 2005 11:39 PM
To: DEV
Subject: Re: [Dev-C++] Couldn`t link MinGW DLL to MSVC program
I have successfuly tested creating "dummy" dll with DEV-C++ 4.0 and using
them in VisualBasic 6.0,
the thing is the famous namemangling, what I do is looking at a .def file
that [i think] dllwrap
or dlltool creates in the same directory of the DLL. Finally, in VB I dont
use the same name that
in my C code, instead, I Use the mangled names that I obtain from the .def
file. May be that helps
just a little.
NOTE: this is valid for C code, if I try with C++ code [classes] the name
mangling turns too
confusing for me...
Hope This Helps...
--- Per Westermark <pw...@ia...> escribi=F3:=20
> It is possible to create DLL files exporting variables and functions -
> using "C" naming convention and mix between gcc and M$. However, you can't
> export/import classes or other C++ symbols (and often not structs either),
> since the C++ mangling - and the internal memory layout - is different
> between the compilers.
>=20
> Google on ABI (Application Binary Interface) and you will get more
> information about the problem.
>=20
> /Per W
>=20
> On Sun, 27 Mar 2005, Dmitry Sidorov wrote:
>=20
> > Hello dev-cpp-users.
> >
> > I have the following source files to build DLL with Dev-Cpp
> >
> >
> > // dll.h
> > #ifndef _DLL_H_
> > #define _DLL_H_
> >
> > #if BUILDING_DLL
> > # define DLLIMPORT __declspec (dllexport)
> > #else /* Not BUILDING_DLL */
> > # define DLLIMPORT __declspec (dllimport)
> > #endif /* Not BUILDING_DLL */
> >
> > class DLLIMPORT MyClass
> > {
> > public:
> > MyClass();
> > virtual ~MyClass(void);
> > };
> > #endif /* _DLL_H_ */
> >
> >
> > // dllmain.cpp
> > #include "dll.h"
> > #include <windows.h>
> >
> > MyClass::MyClass()
> > {
> > MessageBox( NULL, "MyClass construccted!!!", "test", 0 );
> > }
> > MyClass::~MyClass()
> > {
> > }
> > BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle.
*/ ,
> > DWORD reason /* Reason this function is
being called. */ ,
> > LPVOID reserved /* Not used. */ )
> > {
> > switch (reason)
> > {
> > case DLL_PROCESS_ATTACH:
> > break;
> >
> > case DLL_PROCESS_DETACH:
> > break;
> >
> > case DLL_THREAD_ATTACH:
> > break;
> >
> > case DLL_THREAD_DETACH:
> > break;
> > }
> >
> > /* Returns TRUE on success, FALSE on failure */
> > return TRUE;
> > }
> >
> > This is standard DLL project of Dev-Cpp with MessageBox function in
> > MyClass constructor
> >
> > I build DLL with Dev-Cpp and then build .LIB file by LIB.exe from the
> > MSVC installation.
> >
> > lib.exe /machine:i386 /def:libhellodll.def
> >
> > Then I create the following code in MSVC
> > // testdll.cpp : Defines the entry point for the console application.
> > //
> > #include "stdafx.h"
> > #include "dll.h"
> >
> > int _tmain(int argc, _TCHAR* argv[])
> > {
> > MyClass hello;
> > return 0;
> > }
> >
> > I also add libhellodll.lib to MSVC project
> > But when my testdll is linking I got the following errors
> >
> > testdll2 error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
> MyClass::MyClass(void)" (__imp_??0MyClass@@QAE@XZ) referenced in function
_main
> > testdll2 error LNK2019: unresolved external symbol
"__declspec(dllimport) public: virtual
> __thiscall MyClass::~MyClass(void)" (__imp_??1MyClass@@UAE@XZ) referenced
in function _main
> > testdll2 fatal error LNK1120: 2 unresolved externals
> >
> >
> > Then I tried to use dlltool from MinGW
> > dlltool.exe -d libhellodll.def --dllname hellodll.dll --output-lib
libhellodll.lib
> >
> > But I`ve got the same error
> > I also tried to use dlltool.exe with -U and -k flags, I`ve got the
> > same errors :(
> >
> > Can anybody help me?
> > Excuse me for my poor english
> >
> > --
> > Dmitry
> >
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> > _______________________________________________
> > 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
> >
>=20
>=20
>=20
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> 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
> =20
=09
______________________________________________=20
Renovamos el Correo Yahoo!: =A1250 MB GRATIS!=20
Nuevos servicios, m=E1s seguridad=20
http://correo.yahoo.es
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
_______________________________________________
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
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|
|
From: maxime\.desgrousilliers <max...@la...> - 2005-04-12 16:33:32
|
Hello, I would like to know how I can discuss with the port parrallel:send and receive a byte. Could you indicate the orders to me to be used as well as the files headers to include. I have tried to use the solution at http://geekhideout.com/iodll.shtml but when I compile my project with PortOut or PortIn I have got an error message which tell me that there is an error of segmentation (access violation). Could anyone help me? If it is possible can you post example of source which are successful for compilation. I must make that project in this two weeks, help me ! Thank you chexam=0A=0AAcc=E9dez au courrier =E9lectronique de La Poste : www.lapost= e.net ; =0A3615 LAPOSTENET (0,34=80/mn) ; t=E9l : 08 92 68 13 50 (0,34=80= /mn)=0A=0A |
|
From: DAnielDAtcu <dan...@pl...> - 2005-04-12 11:54:06
|
Sirs, I am compelled by my bosses to use MS Visual Cabbage, but I hate it :) What Visual tools has DevC++? I mean how do I to have my projects = resources viewed, adding buttons and stuff on forms &c. ? best regards, and excuse my style, -------------------------------------------------------------------------= ------- Die oben genannten wurden geschrieben bei //The above were written by [||.||]: Dan...@ya...=20 |
|
From: Per W. <pw...@ia...> - 2005-04-12 07:12:26
|
The name of functions and variables is the smallest problem, since the
name mangling may be deactivated for functions you cant to export. The big
problem is trying to share classes. There, you also have the memory layout
of the members of the class, memory layout and location of the virtual
method table, ...
Besides that, you have problems with variable passing to functions
(possible to fix with STDCALL), implementation of exceptions,
implementation of new/delete, ...
In short - a HUGE number of obstacles for mixing C++ code from different
compilers.
/Per W
On Tue, 12 Apr 2005, Gerson Lara wrote:
> I have successfuly tested creating "dummy" dll with DEV-C++ 4.0 and using=
them in VisualBasic 6.0,
> the thing is the famous namemangling, what I do is looking at a .def file=
that [i think] dllwrap
> or dlltool creates in the same directory of the DLL. Finally, in VB I don=
t use the same name that
> in my C code, instead, I Use the mangled names that I obtain from the .de=
f file. May be that helps
> just a little.
> NOTE: this is valid for C code, if I try with C++ code [classes] the name=
mangling turns too
> confusing for me...
> Hope This Helps...
>
> --- Per Westermark <pw...@ia...> escribi=F3:
> > It is possible to create DLL files exporting variables and functions -
> > using "C" naming convention and mix between gcc and M$. However, you ca=
n't
> > export/import classes or other C++ symbols (and often not structs eithe=
r),
> > since the C++ mangling - and the internal memory layout - is different
> > between the compilers.
> >
> > Google on ABI (Application Binary Interface) and you will get more
> > information about the problem.
> >
> > /Per W
> >
> > On Sun, 27 Mar 2005, Dmitry Sidorov wrote:
> >
> > > Hello dev-cpp-users.
> > >
> > > I have the following source files to build DLL with Dev-Cpp
> > >
> > >
> > > // dll.h
> > > #ifndef _DLL_H_
> > > #define _DLL_H_
> > >
> > > #if BUILDING_DLL
> > > # define DLLIMPORT __declspec (dllexport)
> > > #else /* Not BUILDING_DLL */
> > > # define DLLIMPORT __declspec (dllimport)
> > > #endif /* Not BUILDING_DLL */
> > >
> > > class DLLIMPORT MyClass
> > > {
> > > public:
> > > MyClass();
> > > virtual ~MyClass(void);
> > > };
> > > #endif /* _DLL_H_ */
> > >
> > >
> > > // dllmain.cpp
> > > #include "dll.h"
> > > #include <windows.h>
> > >
> > > MyClass::MyClass()
> > > {
> > > MessageBox( NULL, "MyClass construccted!!!", "test", 0 );
> > > }
> > > MyClass::~MyClass()
> > > {
> > > }
> > > BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle=
=2E */ ,
> > > DWORD reason /* Reason this function is=
being called. */ ,
> > > LPVOID reserved /* Not used. */ )
> > > {
> > > switch (reason)
> > > {
> > > case DLL_PROCESS_ATTACH:
> > > break;
> > >
> > > case DLL_PROCESS_DETACH:
> > > break;
> > >
> > > case DLL_THREAD_ATTACH:
> > > break;
> > >
> > > case DLL_THREAD_DETACH:
> > > break;
> > > }
> > >
> > > /* Returns TRUE on success, FALSE on failure */
> > > return TRUE;
> > > }
> > >
> > > This is standard DLL project of Dev-Cpp with MessageBox function in
> > > MyClass constructor
> > >
> > > I build DLL with Dev-Cpp and then build .LIB file by LIB.exe from the
> > > MSVC installation.
> > >
> > > lib.exe /machine:i386 /def:libhellodll.def
> > >
> > > Then I create the following code in MSVC
> > > // testdll.cpp : Defines the entry point for the console application.
> > > //
> > > #include "stdafx.h"
> > > #include "dll.h"
> > >
> > > int _tmain(int argc, _TCHAR* argv[])
> > > {
> > > MyClass hello;
> > > return 0;
> > > }
> > >
> > > I also add libhellodll.lib to MSVC project
> > > But when my testdll is linking I got the following errors
> > >
> > > testdll2 error LNK2019: unresolved external symbol "__declspec(dllimp=
ort) public: __thiscall
> > MyClass::MyClass(void)" (__imp_??0MyClass@@QAE@XZ) referenced in functi=
on _main
> > > testdll2 error LNK2019: unresolved external symbol "__declspec(dllimp=
ort) public: virtual
> > __thiscall MyClass::~MyClass(void)" (__imp_??1MyClass@@UAE@XZ) referenc=
ed in function _main
> > > testdll2 fatal error LNK1120: 2 unresolved externals
> > >
> > >
> > > Then I tried to use dlltool from MinGW
> > > dlltool.exe -d libhellodll.def --dllname hellodll.dll --output-lib li=
bhellodll.lib
> > >
> > > But I`ve got the same error
> > > I also tried to use dlltool.exe with -U and -k flags, I`ve got the
> > > same errors :(
> > >
> > > Can anybody help me?
> > > Excuse me for my poor english
> > >
> > > --
> > > Dmitry
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > SF email is sponsored by - The IT Product Guide
> > > Read honest & candid reviews on hundreds of IT Products from real use=
rs.
> > > Discover which products truly live up to the hype. Start reading now.
> > > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> > > _______________________________________________
> > > 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
> > >
> >
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users=
=2E
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> > _______________________________________________
> > 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
> >
>
>
>
> ______________________________________________
> Renovamos el Correo Yahoo!: =A1250 MB GRATIS!
> Nuevos servicios, m=E1s seguridad
> http://correo.yahoo.es
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> 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: Gerson L. <ja...@ya...> - 2005-04-12 06:39:02
|
I have successfuly tested creating "dummy" dll with DEV-C++ 4.0 and using them in VisualBasic 6.0,
the thing is the famous namemangling, what I do is looking at a .def file that [i think] dllwrap
or dlltool creates in the same directory of the DLL. Finally, in VB I dont use the same name that
in my C code, instead, I Use the mangled names that I obtain from the .def file. May be that helps
just a little.
NOTE: this is valid for C code, if I try with C++ code [classes] the name mangling turns too
confusing for me...
Hope This Helps...
--- Per Westermark <pw...@ia...> escribió:
> It is possible to create DLL files exporting variables and functions -
> using "C" naming convention and mix between gcc and M$. However, you can't
> export/import classes or other C++ symbols (and often not structs either),
> since the C++ mangling - and the internal memory layout - is different
> between the compilers.
>
> Google on ABI (Application Binary Interface) and you will get more
> information about the problem.
>
> /Per W
>
> On Sun, 27 Mar 2005, Dmitry Sidorov wrote:
>
> > Hello dev-cpp-users.
> >
> > I have the following source files to build DLL with Dev-Cpp
> >
> >
> > // dll.h
> > #ifndef _DLL_H_
> > #define _DLL_H_
> >
> > #if BUILDING_DLL
> > # define DLLIMPORT __declspec (dllexport)
> > #else /* Not BUILDING_DLL */
> > # define DLLIMPORT __declspec (dllimport)
> > #endif /* Not BUILDING_DLL */
> >
> > class DLLIMPORT MyClass
> > {
> > public:
> > MyClass();
> > virtual ~MyClass(void);
> > };
> > #endif /* _DLL_H_ */
> >
> >
> > // dllmain.cpp
> > #include "dll.h"
> > #include <windows.h>
> >
> > MyClass::MyClass()
> > {
> > MessageBox( NULL, "MyClass construccted!!!", "test", 0 );
> > }
> > MyClass::~MyClass()
> > {
> > }
> > BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
> > DWORD reason /* Reason this function is being called. */ ,
> > LPVOID reserved /* Not used. */ )
> > {
> > switch (reason)
> > {
> > case DLL_PROCESS_ATTACH:
> > break;
> >
> > case DLL_PROCESS_DETACH:
> > break;
> >
> > case DLL_THREAD_ATTACH:
> > break;
> >
> > case DLL_THREAD_DETACH:
> > break;
> > }
> >
> > /* Returns TRUE on success, FALSE on failure */
> > return TRUE;
> > }
> >
> > This is standard DLL project of Dev-Cpp with MessageBox function in
> > MyClass constructor
> >
> > I build DLL with Dev-Cpp and then build .LIB file by LIB.exe from the
> > MSVC installation.
> >
> > lib.exe /machine:i386 /def:libhellodll.def
> >
> > Then I create the following code in MSVC
> > // testdll.cpp : Defines the entry point for the console application.
> > //
> > #include "stdafx.h"
> > #include "dll.h"
> >
> > int _tmain(int argc, _TCHAR* argv[])
> > {
> > MyClass hello;
> > return 0;
> > }
> >
> > I also add libhellodll.lib to MSVC project
> > But when my testdll is linking I got the following errors
> >
> > testdll2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall
> MyClass::MyClass(void)" (__imp_??0MyClass@@QAE@XZ) referenced in function _main
> > testdll2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual
> __thiscall MyClass::~MyClass(void)" (__imp_??1MyClass@@UAE@XZ) referenced in function _main
> > testdll2 fatal error LNK1120: 2 unresolved externals
> >
> >
> > Then I tried to use dlltool from MinGW
> > dlltool.exe -d libhellodll.def --dllname hellodll.dll --output-lib libhellodll.lib
> >
> > But I`ve got the same error
> > I also tried to use dlltool.exe with -U and -k flags, I`ve got the
> > same errors :(
> >
> > Can anybody help me?
> > Excuse me for my poor english
> >
> > --
> > Dmitry
> >
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&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
> >
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&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
>
______________________________________________
Renovamos el Correo Yahoo!: ¡250 MB GRATIS!
Nuevos servicios, más seguridad
http://correo.yahoo.es
|
|
From: Per W. <pw...@ia...> - 2005-04-11 16:07:06
|
You really can not call write() until you have checked the result of the
recv() call. If recv() returns an error, you add -1 to totalRcvd but you
then make assumptions about what write() would do for a write of length
-1.
One other thing. Don't repeat your loop only breaking on bytesRecv=0. That
would get you in an infinite loop in case you get a permanent error on the
socket. The only time it is meaningful to repeat the recv() call is if
errno gets set to EAGAIN or EINTR.
A better loop would look something like:
int nRead,nWritten,nTotal = 0;
for (;;) {
nRead = recv(sock,recvbuf,DATA_BUFSIZE,0);
if (nRead < 0) {
if (errno == EAGAIN || errno == EINTR) continue;
printf("Failed recv() - (%s)\n",strerror(errno));
return -1;
}
if (nRead == 0) {
// end of file
break;
}
nWritten = write(fd,recvbuf,nRead);
if (nWritten != nRead) {
printf("Failed write() - (%s)\n",strerror(errno));
return -1;
}
nTotal += nWritten;
}
return 0;
/Per W
On Mon, 11 Apr 2005, Dmitry Sidorov wrote:
> Hello, dev-cpp-users.
>
> I try to save binary data recieved from TCP socket into the file
>
> ...
>
> #define DATA_BUFSIZE 4096
>
> long totalRcvd = 0;
> long nFileSize = 0;
> int bytesRecv = SOCKET_ERROR;
> char recvbuf[DATA_BUFSIZE];
> int fd = open( "filename", O_CREAT|O_WRONLY );
> while( bytesRecv == SOCKET_ERROR || bytesRecv > 0 ) {
> bytesRecv = recv( sock, recvbuf, DATA_BUFSIZE, 0 );
> totalRcvd += bytesRecv;
> nFileSize += write( fd, recvbuf, bytesRecv );
> }
> close( fd );
>
> totalRcvd and nFileSize are equal
> nFileSize value is valid (I sent the same quantity of bytes to socket)
>
> But real file size is bigger as nFileSize
> And it is broken :(
>
> When I use fopen, fwrite and fclose functions the result is rhe same
>
> Why?
>
>
> --
> Dmitry
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&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: Alfred P. R. <al...@ya...> - 2005-04-11 13:04:41
|
Could it be that you are not using the binary file switch. For fopen it would be a b suffix as in
"wb"Create a binary file for writing
I don't have my reference available for open, however it would probably be O_BINARY or O_BIN or some such thing.
Dmitry Sidorov <si...@si...> wrote:
Hello, dev-cpp-users.
I try to save binary data recieved from TCP socket into the file
...
#define DATA_BUFSIZE 4096
long totalRcvd = 0;
long nFileSize = 0;
int bytesRecv = SOCKET_ERROR;
char recvbuf[DATA_BUFSIZE];
int fd = open( "filename", O_CREAT|O_WRONLY );
while( bytesRecv == SOCKET_ERROR || bytesRecv > 0 ) {
bytesRecv = recv( sock, recvbuf, DATA_BUFSIZE, 0 );
totalRcvd += bytesRecv;
nFileSize += write( fd, recvbuf, bytesRecv );
}
close( fd );
totalRcvd and nFileSize are equal
nFileSize value is valid (I sent the same quantity of bytes to socket)
But real file size is bigger as nFileSize
And it is broken :(
When I use fopen, fwrite and fclose functions the result is rhe same
Why?
--
Dmitry
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&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
Alfred P. Reaud
|
|
From: Dmitry S. <si...@si...> - 2005-04-11 08:33:39
|
Hello, dev-cpp-users.
I try to save binary data recieved from TCP socket into the file
...
#define DATA_BUFSIZE 4096
long totalRcvd = 0;
long nFileSize = 0;
int bytesRecv = SOCKET_ERROR;
char recvbuf[DATA_BUFSIZE];
int fd = open( "filename", O_CREAT|O_WRONLY );
while( bytesRecv == SOCKET_ERROR || bytesRecv > 0 ) {
bytesRecv = recv( sock, recvbuf, DATA_BUFSIZE, 0 );
totalRcvd += bytesRecv;
nFileSize += write( fd, recvbuf, bytesRecv );
}
close( fd );
totalRcvd and nFileSize are equal
nFileSize value is valid (I sent the same quantity of bytes to socket)
But real file size is bigger as nFileSize
And it is broken :(
When I use fopen, fwrite and fclose functions the result is rhe same
Why?
--
Dmitry
|
|
From: Jason B. <red...@ya...> - 2005-04-09 23:13:12
|
I know this is a bit of a large subject, but I just need to get some basics to begin. I haven't worked with C very long so I don't know the best way to insert the Python header file and how to get two different directories to work together. My C compiler is in C:\Dev-Cpp and the Python modules are included in C:\Python24. If I could just get a good idea on where to start, that would be great. Thanks. |
|
From: Bill H. <clu...@ya...> - 2005-04-09 11:27:18
|
I'm having trouble getting the data out of my Dialog Box.
I'm a Newbie, but have read all the Tutorials, HowTos and Manuals I can
find but have only become more confused.
Without exception the Tutorials indicate how to include a Cancel and OK
button, and perhaps a few other Controls and simply state that adding
other controls and retrieving the Data is easy and various texts seem to
outline different methods.
I don't have any trouble with OK and Cancel etc., but when I come to the
Data part, I have no luck at all. It may be that I have missed
something. In fact I probably have, but I have spent several days trying
to solve the problem on my own and would now welcome some assistance..
I shall eventually use SQLite as a database, but am currently just using
a binary file until I can get the Data retrieval problem sorted out.
The application I am working on is a simple General Ledger Accounting
programme.
The data is read into the Dialog Box displays perfectly. I just cannot
get the modified data out of the Dialog Box.
Here (hopefully) is enough snippets from the programme for someone who
knows what they are doing to determine what my problem is:
CORP.h an include file defining a structure to hold the individual Data
Items for the main Company file.
The types will not all be char. but currently I am just using the one
data type for simplicity.
struct CORP {
char corp_name[41];
char corp_address1[41];
char corp_address2[41];
char corp_city[41];
char corp_state[31];
char corp_zip[21];
char corp_capitalacct[7];
char corp_reacct[7];
char corp_yrend[5];
char corp_currfm[3];
char corp_init[4];
char corp_accntnts[41];
char corp_id[9];
char corp_dir[41];
};
DLGCORPEDIT.h
#define IDD_CORP_EDIT_DLG 1100
#define IDC_CORPEDIT_NAME 1101
#define IDC_CORPEDIT_ADDRESS1 1102
#define IDC_CORPEDIT_ADDRESS2 1103
#define IDC_CORPEDIT_CITY 1104
#define IDC_CORPEDIT_STATE 1105
#define IDC_CORPEDIT_ZIP 1106
#define IDC_CORPEDIT_CAPITALACCT 1107
#define IDC_CORPEDIT_RE 1108
#define IDC_CORPEDIT_YREND 1109
#define IDC_CORPEDIT_FM 1110
#define IDC_CORPEDIT_INIT 1111
#define IDC_CORPEDIT_ACCNTNTS 1112
#define IDC_CORPEDIT_ID 1113
#define IDC_CORPEDIT_DIR 1114
#define IDC_CORPEDIT_DAT_NAME 1115
#define IDC_CORPEDIT_DAT_ADDRESS1 1116
#define IDC_CORPEDIT_DAT_ADDRESS2 1117
#define IDC_CORPEDIT_DAT_CITY 1118
#define IDC_CORPEDIT_DAT_STATE 1119
#define IDC_CORPEDIT_DAT_ZIP 1120
#define IDC_CORPEDIT_DAT_REACCT 1121
#define IDC_CORPEDIT_DAT_CAPITALACCT 1122
#define IDC_CORPEDIT_DAT_YREND 1123
#define IDC_CORPEDIT_DAT_CURRFM 1124
#define IDC_CORPEDIT_DAT_INIT 1125
#define IDC_CORPEDIT_DAT_ACCNTNTS 1126
#define IDC_CORPEDIT_DAT_ID 1127
#define IDC_CORPEDIT_DAT_DIR 1128
RSRC.rc (Fragment for the EditCorp Dialog Box)
IDD_CORP_EDIT_DLG DIALOGEX 6,6,428,200
CAPTION "Edit Company"
FONT 8,"MS Sans Serif"
STYLE 0x10CF0000
EXSTYLE 0x00000000
BEGIN
CONTROL "Name",IDC_CORPEDIT_NAME,"Static",0x50000200,18,7,24,11,0x00000000
CONTROL
"Address1",IDC_CORPEDIT_ADDRESS1,"Static",0x50000200,18,25,36,11,0x00000000
CONTROL
"Address2",IDC_CORPEDIT_ADDRESS2,"Static",0x50000200,18,44,34,11,0x00000000
CONTROL "City",IDC_CORPEDIT_CITY,"Static",0x50000200,18,62,18,11,0x00000000
CONTROL
"State",IDC_CORPEDIT_STATE,"Static",0x50000200,18,81,22,11,0x00000000
CONTROL "Postal
Code",IDC_CORPEDIT_ZIP,"Static",0x50000200,250,81,42,11,0x00000000
CONTROL "Capital
Account",IDC_CORPEDIT_CAPITALACCT,"Static",0x50000200,18,99,54,11,0x00000000
CONTROL "Retained Earnings
Account",IDC_CORPEDIT_RE,"Static",0x50000200,202,99,94,11,0x00000000
CONTROL "Year End
Month",IDC_CORPEDIT_YREND,"Static",0x50000200,18,118,58,11,0x00000000
CONTROL "Current Fiscal
Month",IDC_CORPEDIT_FM,"Static",0x50000200,154,118,70,11,0x00000000
CONTROL "GL
Initialized",IDC_CORPEDIT_INIT,"Static",0x50000200,310,118,44,11,0x00000000
CONTROL
"Accountants",IDC_CORPEDIT_ACCNTNTS,"Static",0x50000200,18,136,46,11,0x00000000
CONTROL "Short
Identifier",IDC_CORPEDIT_ID,"Static",0x50000200,16,153,46,11,0x00000000
CONTROL "Data
Directory",IDC_CORPEDIT_DIR,"Static",0x50000200,182,153,50,11,0x00000000
CONTROL "",IDC_CORPEDIT_DAT_NAME,"Edit",0x50010000,86,7,320,11,0x00000200
CONTROL
"",IDC_CORPEDIT_DAT_ADDRESS1,"Edit",0x50010000,86,25,320,11,0x00000200
CONTROL
"",IDC_CORPEDIT_DAT_ADDRESS2,"Edit",0x50010000,86,44,320,11,0x00000200
CONTROL "",IDC_CORPEDIT_DAT_CITY,"Edit",0x50010000,86,62,320,11,0x00000200
CONTROL "",IDC_CORPEDIT_DAT_STATE,"Edit",0x50010000,86,81,148,11,0x00000200
CONTROL "",IDC_CORPEDIT_DAT_ZIP,"Edit",0x50010000,310,81,96,11,0x00000200
CONTROL
"",IDC_CORPEDIT_DAT_CAPITALACCT,"Edit",0x50010000,86,99,98,11,0x00000200
CONTROL "",IDC_CORPEDIT_DAT_REACCT,"Edit",0x50010000,312,99,96,11,0x00000200
CONTROL "",IDC_CORPEDIT_DAT_YREND,"Edit",0x50010000,88,118,50,11,0x00000200
CONTROL
"",IDC_CORPEDIT_DAT_CURRFM,"Edit",0x50010000,238,118,54,11,0x00000200
CONTROL "",IDC_CORPEDIT_DAT_INIT,"Edit",0x58010000,368,118,40,11,0x00000200
CONTROL
"",IDC_CORPEDIT_DAT_ACCNTNTS,"Edit",0x50010000,88,136,320,11,0x00000200
CONTROL "",IDC_CORPEDIT_DAT_ID,"Edit",0x58010000,88,153,82,11,0x00000200
CONTROL "",IDC_CORPEDIT_DAT_DIR,"Edit",0x58010000,248,155,160,11,0x00000200
CONTROL "OK",IDOK,"Button",0x50010000,276,180,58,13,0x00000000
CONTROL "Cancel",IDCANCEL,"Button",0x50010000,348,180,60,13,0x00000000
END
MAIN.CPP - Dialog CallBack fragment
BOOL CALLBACK caglDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM
lParam)
{
switch(Message)
{
case WM_INITDIALOG:
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_NAME, "My New Company");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_ADDRESS1, "My Court");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_ADDRESS2, "Suite 803");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_CITY, "Antibes");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_STATE, "Alpes Maritimes");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_ZIP, "06600");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_REACCT, "803999");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_CAPITALACCT, "803000");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_YREND, "07");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_CURRFM, "0504");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_INIT, "No");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_ACCNTNTS, "Audit & Cie");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_ID, "MYCO_001");
SetDlgItemText(hwnd, IDC_CORPEDIT_DAT_DIR, "data");
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
EndDialog(hwnd, IDOK);
break;
case IDCANCEL:
EndDialog(hwnd, IDCANCEL);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}
MAIN.CPP - Message Handler-Dialog CallBack fragment
/* This function is called by the Windowsfunction DispatchMessage( ) */
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam,
LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_COMMAND:
switch( wParam )
{
case IDM_FILENEW:
case IDM_FILEOPEN:
case IDM_FILESAVE:
case IDM_FILESAVEAS:
case IDM_FILEPRINT:
case IDM_FILEPAGESETUP:
case IDM_FILEPRINTSETUP:
case IDM_EDITUNDO:
case IDM_EDITCUT:
case IDM_EDITCOPY:
case IDM_EDITPASTE:
case IDM_EDITDELETE:
MessageBox( hwnd, (LPSTR) "Function Not Yet Implemented.",
(LPSTR) szClassName,
MB_ICONINFORMATION | MB_OK );
return 0;
case IDM_HELPCONTENTS:
WinHelp( hwnd, (LPSTR) "Gl-Help.HLP",
HELP_CONTENTS, 0L );
return 0;
case IDM_HELPSEARCH:
WinHelp( hwnd, (LPSTR) "Gl-help.HLP",
HELP_PARTIALKEY, 0L );
return 0;
case IDM_HELPHELP:
WinHelp( hwnd, (LPSTR) "Gl-Help.HLP",
HELP_HELPONHELP, 0L );
return 0;
case IDM_FILEEXIT:
SendMessage( hwnd, WM_CLOSE, 0, 0L );
return 0;
case IDM_CORP_SELECT:
iReturnValue = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_CORP_SEL_DLG), hwnd, caglDlgProc);
// report success or failure
// pull messageboxes when code finalized
// on IDOK and IDCANCEL
if(iReturnValue == IDOK){
MessageBox(hwnd, "Dialog exited with IDOK.",
"Notice",
MB_OK | MB_ICONINFORMATION);
} else if(iReturnValue == IDCANCEL){
MessageBox(hwnd, "Dialog exited with
IDCANCEL.", "Notice",
MB_OK | MB_ICONINFORMATION);
} else if(iReturnValue == -1){
MessageBox(hwnd, "Dialog failed!", "Error",
MB_OK | MB_ICONINFORMATION);
}
// break;
// Other menu commands...
MessageBox( hwnd, (LPSTR) "Function Not Yet Implemented.",
(LPSTR) szClassName,
MB_ICONINFORMATION | MB_OK );
return 0;
case IDM_CORP_EDIT:
iReturnValue = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_CORP_EDIT_DLG), hwnd, caglDlgProc);
// report success or failure
// pull messageboxes when code finalized
// on IDOK and IDCANCEL
if(iReturnValue == IDOK){
typedef struct CORP company;
FILE* fh_ThisCorp;
company NewCorp;
system( "mkdir c:\\data" );
strcpy(szDataPath, "\\data\\newcorp.dat");
fh_ThisCorp = fopen(szDataPath, "wb");
strcpy(NewCorp.corp_name, "1123MY_NEW_COMPANY");
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_NAME, NewCorp.corp_name, 40);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_ADDRESS1, NewCorp.corp_address1, 40);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_ADDRESS2, NewCorp.corp_address2, 40);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_CITY, NewCorp.corp_city, 40);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_STATE, NewCorp.corp_state, 30);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_ZIP, NewCorp.corp_zip, 20);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_REACCT, NewCorp.corp_reacct, 7);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_CAPITALACCT,
NewCorp.corp_capitalacct, 7);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_YREND, NewCorp.corp_yrend, 5);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_CURRFM, NewCorp.corp_currfm, 3);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_INIT, NewCorp.corp_init, 3);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_ACCNTNTS, NewCorp.corp_accntnts, 40);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_ID, NewCorp.corp_id, 8);
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_DIR, NewCorp.corp_dir, 40);
fwrite(&NewCorp, sizeof(company), 1, fh_ThisCorp);
fclose(fh_ThisCorp);
MessageBox(hwnd, "Dialog exited with IDOK.",
"Notice",
MB_OK | MB_ICONINFORMATION);
} else if(iReturnValue == IDCANCEL){
MessageBox(hwnd, "Dialog exited with
IDCANCEL.", "Notice",
MB_OK | MB_ICONINFORMATION);
} else if(iReturnValue == -1){
MessageBox(hwnd, "Dialog failed!", "Error",
MB_OK | MB_ICONINFORMATION);
}
// break;
// Other menu commands...
MessageBox( hwnd, (LPSTR) "Rest of Function Not Yet
Implemented.",
(LPSTR) szClassName,
MB_ICONINFORMATION | MB_OK );
return 0;
case IDM_CORP_ADD:
iReturnValue = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_CORP_EDIT_DLG), hwnd, caglDlgProc);
// report success or failure
// pull messageboxes when code finalized
// on IDOK and IDCANCEL
if(iReturnValue == IDOK){
MessageBox(hwnd, "Dialog exited with IDOK.",
"Notice",
MB_OK | MB_ICONINFORMATION);
} else if(iReturnValue == IDCANCEL){
MessageBox(hwnd, "Dialog exited with
IDCANCEL.", "Notice",
MB_OK | MB_ICONINFORMATION);
} else if(iReturnValue == -1){
MessageBox(hwnd, "Dialog failed!", "Error",
MB_OK | MB_ICONINFORMATION);
}
// break;
// Other menu commands...
MessageBox( hwnd, (LPSTR) "Function Not Yet Implemented.",
(LPSTR) szClassName,
MB_ICONINFORMATION | MB_OK );
return 0;
case IDM_CORP_DELETE:
MessageBox( hwnd, (LPSTR) "Function Not Yet Implemented.",
(LPSTR) szClassName,
MB_ICONINFORMATION | MB_OK );
return 0;
case IDM_CORP_RESTORE:
MessageBox( hwnd, (LPSTR) "Function Not Yet Implemented.",
(LPSTR) szClassName,
MB_ICONINFORMATION | MB_OK );
return 0;
case IDM_HELPABOUT:
MessageBox (NULL, "By Bill Henderson", "Version
0.01", 1);
return 0;
}
break;
case WM_CLOSE:
DestroyWindow( hwnd );
return 0;
case WM_DESTROY:
PostQuitMessage (0);
return 0;
break;
default: /* for messages that we don't deal with */
return DefWindowProc(hwnd, message, wParam, lParam);
}
return 0;
}
Despite attempts to use:
GetDlgItemText(hwnd, IDC_CORPEDIT_DAT_NAME, NewCorp.corp_name, 40);
all that I have in my "newcorp.dat" file after running the programme is
what was placed there as a test or contol value by the line preceding my
attempt to retrieve the data edited in the Dialog Box.
strcpy(NewCorp.corp_name, "1123MY_NEW_COMPANY");
Generally, apart from the Data Retrieval problem, everything seems to
work perfectly.
If anyone can help me out, please acept my thanks in advance.
Bill Henderson
|
|
From: Daniel K. O. <dan...@ya...> - 2005-04-08 14:52:59
|
gpuime wrote:
> double ln(double x) throw(char*){
> if(x<=0) throw "ln error" ; return log(x) ; }
You are throwing a "const char*", not a "char*".
Change your exception specification to "const char*".
Daniel K. O.
|
|
From: gpuime <gp...@pa...> - 2005-04-08 11:02:51
|
Hello all,
in this tiny program throw causes a crash, but I don't see why......
#include <iostream>
#inclde <cmath>
double ln(double x) throw(char*){
if(x<=0) throw "ln error" ; return log(x) ; }
int main(){
for(x=10;x>-11;x-=10){
try{ cout<<ln(x)<<endl ; }
catch(char *s){ cout<<s ; }
} }
|
|
From: Alfred P. R. <al...@ya...> - 2005-04-08 03:58:32
|
It depends on the widget you are using for the text input. Both wxWidgets and FLTK have that capability if I remember correctly. If it's a console application, then you have to disable the automatic echo feature by using a combination of kbhit()(?) and getch() and then echoing * instead of the character or by using some similar function set. A little more information would be helpful. LETCHUMANAN SAMINADAN <arl...@ya...> wrote: Dear all, Thank you for your kindness, I really appreciate that...... I manage to get the current time and date source code.... If I want my password to be viewed like ******** , Is there any ways for me to make my password like that in c source code..... From, Letchu... Yahoo! Mobile - Download the latest ringtones, games, and more! Alfred P. Reaud |