15,300 Posted Topics

Member Avatar for akshaydch11

[URL="http://msdn.microsoft.com/en-us/library/ms632644%28VS.85%29.aspx"]WM_SETTEXT[/URL]

Member Avatar for Ancient Dragon
0
55
Member Avatar for Tajna

1) check to see if db exists? That would be like checking if any other file exists, e.g. attempt to open it and if open failes then the db does not exist. 2) write a query to get all results, e.g. "SELECT * FROM MyTable" then view the results returned.

Member Avatar for Tajna
0
79
Member Avatar for kavy

[URL="http://lmgtfy.com/?q=win32+api+tutorials"]Click here[/URL]

Member Avatar for Ancient Dragon
0
24
Member Avatar for Talguy

>>std::list<Operation *> *OPlst; >>OPlst = new std::list<Operation *>; Why in the world is this a pointer??? It should be just this: [icode]std::list<Operation*> OPlst;[/icode]

Member Avatar for Talguy
0
118
Member Avatar for uNpReDiCtAbLe
Member Avatar for sfuo
0
136
Member Avatar for Frederick2

Yup! glad you are finally figuring that out! Never put a function call there which will always return the same value -- its better and faster to store the value in a variable and use that variable in the loop.

Member Avatar for Frederick2
0
125
Member Avatar for Flapjack

new operator causes an exception if it cannot allocate the memory, so your check for NULL will not do anything. You need to put that line in a try/catch block. As an alternative, you can use [b]nothrow[/b] ([URL="http://http://www.cplusplus.com/reference/std/new/nothrow/"]link[/URL]) and leave that check in your code. I would think you need …

Member Avatar for Flapjack
0
840
Member Avatar for iceshells
Member Avatar for revenge2

Just download the binaries from [URL="http://http://www.gtk.org/download-windows.html"]here[/URL], and unzip them into any directory you want. Then in your makefile use -I flag to point to that directory.

Member Avatar for revenge2
0
131
Member Avatar for Wolf CCMLG

static class data objects also have to be declared like normal globals. [code] #include "DivSales.h" #include <iostream> using namespace std; [color=red]DivSales::totalSales = 0;[/color] void DivSales::addTotal(int a, int b, int c, int d) { cout << "Enter 1st Quarter:" << endl; cin >> a; cout << "Enter 2nd Quarter:" << endl; …

Member Avatar for Wolf CCMLG
0
207
Member Avatar for sfuo

you have to overload the << operator [code] class MyClass { public: friend ofstream& operator<<(const ofstream& out, const MyClass& str); .. ... }; [/code]

Member Avatar for mrnutty
0
252
Member Avatar for edwar

The fopen() statement is the same, except with "w" open flag instead of "r" use fprintf() to write text lines.

Member Avatar for yellowSnow
0
104
Member Avatar for KonkaNok

Some c++ stl classes, such as string, vector, and list, return size_t in some of its methods. For example. std::vector size() returns size_t value. Some compilers (such as Microsoft) will produce warnings if you attempt to compare size_t with int or long.

Member Avatar for KonkaNok
0
148
Member Avatar for edwar

If you want the output to go to two places (screen and file) then you will have to print it twice. Put the code in a function then pass it the stream object (either an opened FILE* pointer or stdout)

Member Avatar for edwar
0
138
Member Avatar for metalclunch

In the test project you have either (1) include Engine.cpp so that it's compiled along with test.cpp, or (2) create either a DLL or static lib out of Engine.cpp, then link test project with that lib.

Member Avatar for metalclunch
0
122
Member Avatar for skirmish

[b]front[/b] is a function, so you need () [code] #include <iostream> #include <list> using namespace std; class Aircraft { public: Aircraft(int i = 0) { flightNo = i; } int getFlightNo() { return flightNo; } void setFlightNo(int i) { flightNo = i; } protected: int flightNo; }; int main() { …

Member Avatar for skirmish
0
128
Member Avatar for philastean
Member Avatar for Ancient Dragon
0
22
Member Avatar for yonghc

>>I still encounter problem with conversion of string variable to numeric variable using strtof() function call. It seems that that function requires a char instead of string for the conversion If you had bothered to read the methods available to std::string you would have seen c_str(), which returns const char*. …

Member Avatar for yonghc
0
414
Member Avatar for sknake
Member Avatar for AirGear

There are no compilers thatt will do it. If you are running MS-Windows then view Task Manager while the program is running and it will tell you how much memory it is consuming.

Member Avatar for AirGear
0
134
Member Avatar for forumdude123

Just tested it -- 1:15 minutes from the time I pressed the power-on button until the login screen appears. About another minute until the desktop is usable. But the time for that part would vary greatly from one computer to another due to what all is installed that has to …

Member Avatar for Suspishio
0
137
Member Avatar for Gaiety

The read should work, but the write doesn't because you are trying to write binary data to the console screen. The number will have to be converted to ascii readable characters first. [code] char buf[20]; sprintf(buf,"%d", num); fwrite(buf,strlen(buf),1,stdout); // but why?? this is the same as printf() [/code]

Member Avatar for codeguru_2009
0
1K
Member Avatar for hoke

No way around it if you want to use normal string handling functions found in string.h and stdio.h. You will have to treat the character array as containing binary data. Well, I suppose you could create the string to contain normal decimal values such as [icode]char num[] = "01";[/icode]

Member Avatar for Ancient Dragon
0
617
Member Avatar for Ancient Dragon

When I click on "Site Search" with empty search box the browser used to bring up another window that would let me select several options. That is no longer possible.

Member Avatar for Nick Evan
0
67
Member Avatar for ticktock

So, let me get this straight: you told your prof that you will write a program that you have no clue how to write??? Like biting off more than you can chew? On a scale of 0 to 100% how well do you know c++ or c ? Are you …

Member Avatar for ticktock
0
142
Member Avatar for phillipeharris
Member Avatar for majestic0110
Member Avatar for quicktpgo
1
268
Member Avatar for lotrsimp12345

O_RDWR is used by very low-level C _open() function. Most programmers today use higher-level FILE* functions in C or fstream c++ class. But if you read[URL="http://msdn.microsoft.com/en-us/library/z0kc8e3z%28VS.80%29.aspx"] this link[/URL] you will see that O_RDWR is NOT one of the pmode flags -- pmode refers to permissions and is useful only when …

Member Avatar for lotrsimp12345
0
537
Member Avatar for Jennifer84

you can't change the < operator to >, but you can change i to be greater than End and Step to negative, which I believe will accomplish the same thing.

Member Avatar for puluke
0
128
Member Avatar for fallopiano

[URL="http://www.codeproject.com/KB/GDI/barry_s_screen_capture.aspx"]read this[/URL] tutorial

Member Avatar for fallopiano
0
129
Member Avatar for sknake

Maybe the image is too big? I changed mine just yesterday with no problems.

Member Avatar for Dani
0
169
Member Avatar for omri374

[QUOTE=omri374;986825]Thanks! Since I don't know much about Multithreading,[/QUOTE] There's no better time than the present to learn. Write a simple console program that does nothing much more than create another thread and wait for it to finish. That is enough to show you how threads work -- its not really …

Member Avatar for omri374
0
383
Member Avatar for Oritm

Its done almost like you posted it. Post what you have tried so that we can see what you might be doing wrong. You have to include <string>, and its lower-case "string", not "String". C++ is case sensitive, so you have to be careful about using capital letters.

Member Avatar for Lerner
0
140
Member Avatar for xfreebornx

To delete an item from an array just move everything up one element so that the one you want to delete is overwritten. For instance, if you have an array of 10 integers and you want to delete the first one, then copy #1 to #0, #2 to #1, etc.

Member Avatar for VernonDozier
0
105
Member Avatar for crh0872

If you only want it to do something every hour, then put it to sleep for an hour - this is MS-Windows, *nix would be sleep() with lower-case 's'. [code] while ( 1 ) { Sleep(60*60*1000); // sleep for one hour // stuff } [/code]

Member Avatar for omri374
0
84
Member Avatar for tomtetlaw
Member Avatar for Salem

a) Flag Bad Post does not affect post count. b) Already asked for that awhile back but they shot it down.

Member Avatar for Dani
0
74
Member Avatar for picass0

Two ways to do it that I can think of right off the top of my head 1) after reading the entire line, use std::string's find() method to locate the first comma then you will have the id field. Something like this [code] std::string line = "paciss0:abc,123,myoffice"; // locate the …

Member Avatar for anupa
0
1K
Member Avatar for vileoxidation

>>int countCharacter(char desired, char[] list) The [] is in the wrong place -- should be [icode]char list[][/icode]

Member Avatar for vileoxidation
0
253
Member Avatar for kernel>panic

Your program makes zero sense. Why are you using ofstream to write to a dll ?????:icon_eek:

Member Avatar for VernonDozier
0
682
Member Avatar for edwar

Read the file into a linked list, sort it, then write it back out. That will work for files that are not very large. For really huge files (1+gig) there are file sort programs you can get (see google). a) Read the words into a linked list of structures. If …

Member Avatar for Ancient Dragon
0
106
Member Avatar for Thinka

Maybe that's the way to go :) But I don't think I'll try doing that with my computer.

Member Avatar for sneekula
0
115
Member Avatar for pymatio

I tried to compile that with vc++ 2008 Express on MS-Windows and got the following error. Maybe that is why your program seg faults, because there were compile errors that you failed to fix [quote] 1>c:\dvlp\test1\test1\test1.cpp(52) : error C2065: 'files' : undeclared identifier 1>c:\dvlp\test1\test1\test1.cpp(53) : error C2065: 'files' : undeclared …

Member Avatar for Ancient Dragon
0
236
Member Avatar for JETFUSION

>>This is what i have but not working????????? Well, what is it that is not working? Doesn't it compile? If not then what are the error message(s)? And what compiler are you using ?

Member Avatar for Salem
0
143
Member Avatar for myle

I implemented something like that (I think) many years ago with MS-DOS 6.X. It was a series of functions that performed context stack switching so that there could be any number of "threads". Unlike modern-day MS-Windows or *nix, the program would switch contexts only when requested by the currently running …

Member Avatar for myle
0
181
Member Avatar for Nathan Campos

eVC++ isn't really all that much different than VC++ 2008 Express. c++ is c++ is c++. Once you learn c++ on desktop its pretty easy to develop with eVC++. There are some things that eVC++ does not support (at least prior to version 4.0) -- some of them are: [list] …

Member Avatar for Frederick2
0
343
Member Avatar for AndrewWood

>>When using CreateProcess with any of the debug flags Do you mean the debug flags that can be set in the [b][URL="http://msdn2.microsoft.com/en-us/library/ms684863.aspx"]Process Creation Flags[/URL][/b] of the CreateProcess function ? BTW: I have never used this feature

Member Avatar for IanHannah
0
305
Member Avatar for Salem

The stats in Control Panel seems to have a few problems. >>Forum Threads Started: 3,668 I have not started that many threads! :icon_eek: According to the link "search all threads started by ...", I only started 190 threads.

Member Avatar for MosaicFuneral
1
984
Member Avatar for JETFUSION

Line 28: 1) use a different loop counter name because it is hiding the loop counter declared on line 18. 2) why does that loop begin at 2 instead of 0, such as like this? [icode]for(int j = 0; j < nrAttend; ++j) [/icode]

Member Avatar for tux4life
0
127
Member Avatar for francisabey

[QUOTE=insaniakq;930695]i used to use the recycler to hide files, then one day all the files disappeared, i swapped the hard drive to a new computer and that computer deleted the folder[/QUOTE] I'd say that wasn't the brightest place to hid files :) :)

Member Avatar for ym_chaitu
0
950

The End.