|
|
Thanks, norm,...I was wondering about the CALLBACKs too,...they seem like an anachronism. But, you see them used in virtually all windows code,...so, I assume that there must be an advantage to using this function. I'm wondering,...what exactly does the Visual C++ compiler do with them?
In Petzold's Programming Windows, the author states: The call-back function is a function in your program that is called from Windows. The best-known example of a CALLBACK function is the program's window procedure. You tell Windows the address of the windows procedure when registering the window class, and then Windows calls the function when sending messages to the program. Like a window procedure, a call-back function must be defined as CALLBACK because it is called by Windows from outside the code space of the program.
You know, I love geek-speak, but I'm not sure I understand it.
|
|
|
|
|
Nebulous Person wrote:
they seem like an anachronism
they're not an anachronism as much as they are a very powerful and advanced feature of C. yes they seem clumsy when compared to how you do similar things in C++, but Windows wasn't written in C++, it was written in C and Assembly.
in pure C++, you don't often need function pointers, since you can just pass an object and call members functions on that object; the object, in effect if not in reality, carries a function pointer for each of its member functions. but C has no "objects", so you have to pass the function pointers out in the open.
-c
“If it turns out that I’m actually the one who did it, then looking for the real killers would be a big old waste of time.”
-- OJ Simpson
|
|
|
|
|
Chris Losinger,
Ya know, I'm very new to C++ and Visual C++, but, I've found that reading the threads on this forum is probably the best source of information available to us 'code nitwits'. Thanks,...I appreciate the perspective. My brain is hemorhhaging intel.
|
|
|
|
|
You might want to check out all the recent C++ articles on creating delegates using STL, which are essentially a breed of C++-esque callback.
Though frowned upon in OOP, incidentally, you can use straight callback functions in C++. I've done it where a C program calls a DLL C function stub which is defined in a .cpp file, which in turn passes it onto an object instance, with a callback as a parameter. The C++ instance, after doing some work, later calls the callback. Pretty convoluted, but a project I worked on required it.
-- ian
"The greatest danger to humanity is humanity without an open mind." - Ian Mariano
http://www.ian-space.com/
|
|
|
|
|
How can I delete EOF in a file (in binary mode)?.
Thanks
|
|
|
|
|
you can't.
-c
“If it turns out that I’m actually the one who did it, then looking for the real killers would be a big old waste of time.”
-- OJ Simpson
|
|
|
|
|
I want to chek duplicate line in text file
Example:
If in "1.txt" has this data inside
50B82D3F9D3
2C051C76C7D
5804EBB2BB8
559AAC90CEE
DA64B9F10CC
B9A6A9866A9
AFF45E93F23
.
.
.
.
45788887454
B9A6A9866A9
This above text file has duplicate line
"B9A6A9866A9"
I want to write proram to check duplicate line.
Do you know how to do that? (Now I can use CStdioFile (ReadString, WriteString) and show Messagebox but not have idea to do that.)
Thank you for your answer.
|
|
|
|
|
is this for school ?
If you'd have to explain how to do this in your own words, without code, how would you anwser this, how would YOU solve the problem, once you know how to solve the problem, coding is easier. and it's from that point that I can/will help you !
Max.
|
|
|
|
|
two words: strcmp and fopen .
The rest is left as an exercise to the reader.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I would use ifstream to open the file, and then pass everything into a std::set, first checking if it is there. If it's there, I know that it is a duplicate, if all I want is to filter out duplicates, I am done. If I wanted to maintain order, I'd use a map and use the line number as the key.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
1) I have designed a primary Dialog Box, from which, on the selection of a menu command, i want to open another dialog box. In this case its just a File->Open command which should open a new modal dialog box to enter the filename/path. I added a new dialog by simply selecting one from insert->resource. I think i do need to define a new class for the dialog box, anyone agree? So once that has been done, how do i trigger the box from the main dialog? I was using something like
"CProgdlg::OnFileOpen{
CFildlg dlg;
dlg.DoModal();}"
but every time i compile or build it, it gives an error that the file (CFiledlg) is an undeclared identifier. Please Help.
2) Also, how does one make a set of multiple windows, like in installation file for programs, where a new dialog box is opened on pressing "next" and the earlier one is closed. The last box having "finish" instead of next, as always.
Cheers
Ayush
|
|
|
|
|
If CFildlg is a dialog you created you must #include "Fildlg.h" in this .cpp file. Otherwise if you meant to use MFC's CFileDialog then it is misspelled.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
1) How about:
A) Looks like you misspelled "CFiledlg" in the 2nd line of code.
B) Did you #include the header file for your secondary dialog?
2) You want a wizard, and that's not in the scope of an explanation here.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
The code i gave was an example, so its not from the cpp file.
unfortunately, i forgot to include the header. Silly me, i think i must stop long hours of programming, its make me forget simple things.
Thanks a ton,
Ayush
|
|
|
|
|
Using Platform Builder 2.12 on Win2K:
I wrote a DLL which ciompiles and links fine, except that CEPB refuses to generate a LIB file. I've compaered this new DLL with other existing DLL's, and I can't find anything wrong with the setting (even the checkbox labelled "Do not create .LIB file" is NOT checked), and the compiler settings include a "/implib:My.DLL" command.
Anyone?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Who thought that Dunn's articles were going to stop those postings ?
How low can you go ? (MS rant)
|
|
|
|
|
Um...
Majid Shahabfar wrote:
Hi Dear,
I say this to my wife. I'd recommend something a little less familiar for a web forum.
Majid Shahabfar wrote:
How can I cast a CString object to WCHAR* ?
Check out Michael Dunns articles on strings, he covers all of this very well.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
please help me explaining the problem. iv got a jpglib but the linker says so much problems when compiling.. where can i find something smaller, simpler to use - i just want to compress bmp to jpg. please.
no mfc.
regards for your help.
|
|
|
|
|
what are these linker errors ?
“If it turns out that I’m actually the one who did it, then looking for the real killers would be a big old waste of time.”
-- OJ Simpson
|
|
|
|
|
it says that there are problem with _beginthreadex and _endthreadex, smth like this. cant force this problem isnt there anything simpler to compress that bmp to jpg than using some library?
|
|
|
|
|
the problem is probably that your app and the library are built using different C run time libaries.
(in VC6) open Project / Settings, choose the JpegLib project, go to the C++ tab, choose the Code Generation category. note what it says in the "Use run-time library" combo.
no do the same for the application project. if they don't match, change the JpegLib project to match your app. then rebuild.
int01h wrote:
isnt there anything simpler to compress that bmp to jpg than using some library?
not without GDI+
-c
“If it turns out that I’m actually the one who did it, then looking for the real killers would be a big old waste of time.”
-- OJ Simpson
|
|
|
|
|
okay, could you tell me now what is the _main_ jpeglib webpage?i need the url cause the lib i have - i cant be sure if it is the newest/best/anything.
thanks
|
|
|
|
|
the latest JpegLib is 6b (written in 98). it is as solid a piece of software as i've ever seen. and what you're describing is not a JpegLib issue.
the main jpeglib homepage is www.ijg.org.
-c
“If it turns out that I’m actually the one who did it, then looking for the real killers would be a big old waste of time.”
-- OJ Simpson
|
|
|
|
|
Hi,
I have a dumb question.. I purchased a Active-X object from a 3rd party, once I add the active x object to my project and create the object etc.. as long as I include the required dll's and register them on a target system everything works as it should.
My question.. Is their a way to auto-load the dll's when the app is started? or better yet is there a way to static link the dll's into my project?
Thanks!
|
|
|
|