1,174 Posted Topics

Member Avatar for bpacheco1227

[QUOTE=bpacheco1227;652832]Any guidance on how to polish this code up would be greatly appreciated. [/QUOTE] The code needs proper, consistent indentation.

Member Avatar for mitrmkar
0
200
Member Avatar for dipumali

[QUOTE=dipumali;659212]hi i am dipali i am trying to store multiple objects in file but it will store only one object with the help of read & write function plz tell me solution.[/QUOTE] Maybe you open the file so that it gets truncated every time, i.e. the [I]mode[/I] parameter is wrong? …

Member Avatar for mitrmkar
0
86
Member Avatar for FTProtocol

You need to change e.g. [ICODE]if(Addition = true)[/ICODE] to [ICODE]if(Addition == true)[/ICODE]

Member Avatar for FTProtocol
0
98
Member Avatar for TheBeast32

Try replacing the line [ICODE]PaintRoutine(hwnddc, GetPixel(hDC, pt.x + x, pt.y + y), 1, 1, 1 + x, 1 + y);[/ICODE] with [ICODE]SetPixel(hwnddc, x, y, GetPixel(hDC, pt.x + x, pt.y + y));[/ICODE]

Member Avatar for TheBeast32
0
144
Member Avatar for jerryjerry

How about managing the [ICODE]id[/ICODE] in the [ICODE]Base[/ICODE] class, i.e. [code] class Base { public: explicit Base() : id(object_count++) {} static int object_count; protected: int id; }; int Base::object_count = 0; class child: public Base { public: child(int val){} }; int main() { child c(1); return 0; } [/code]

Member Avatar for jerryjerry
0
292
Member Avatar for plike922

[code] ... double CelsiusToFahrenheit(double c); ... int main() { ... } double CelsiusToFahrenheit(double c) [COLOR="Red"];[/COLOR] // <- remove the semicolon { return (9.0 / 5.0 * c + 32); }[/CODE]

Member Avatar for VernonDozier
0
234
Member Avatar for ThomsonGB

[QUOTE=ThomsonGB;654437] Linking... sub_proc.obj : error LNK2019: unresolved external symbol __imp__InitializeSecurityDescriptor@8 referenced in function _process_init [/QUOTE] You need to link with Advapi32.lib.

Member Avatar for ThomsonGB
0
487
Member Avatar for manzoor

[QUOTE=manzoor;655049]I meant the project in the link How would you compile that ?[/QUOTE] That project uses MFC which is not included in the Express Editions, meaning that you cannot compile it.

Member Avatar for manzoor
0
116
Member Avatar for OmniX

You might use stringstream ... [code] #include <vector> #include <string> #include <sstream> using namespace std; int main() { int a = 1; int b = 2; int c = 3; int d = 4; int e = 5; int f = 6; vector<string> abcd; stringstream sstrm; sstrm << a << …

Member Avatar for OmniX
0
505
Member Avatar for greyghost86

A radical suggestion, instead of coding the games inside the switch, make the games functions and do something like [code=cplusplus] while(1) { cout << "A: To Play the number guessing game." << endl; cout << "B: To Play the letter game." << endl; cout << "C: To quit program." << …

Member Avatar for Salem
0
185
Member Avatar for TheBeast32

[ICODE]#include <winresrc.h>[/ICODE] in the .rc file, that way the definitions of e.g. [ICODE]DS_MODALFRAME[/ICODE] and [ICODE]WS_POPUP[/ICODE] will be known. In addition to that, add [ICODE]#define IDC_STATIC -1[/ICODE] in the resource.h file.

Member Avatar for TheBeast32
0
128
Member Avatar for mansangeet

[QUOTE=mansangeet;654429]need help in php coding !!!!!!!!!!!!!!! not able to send values to database................. hav checked the code many times............ when i apply conditions in my code ...it simply stops sending values to database... plz help.........[/QUOTE] This is a C++ forum, but [URL="http://www.daniweb.com/forums/forum17.html"]here[/URL] is a dedicated forum for PHP. Try posting …

Member Avatar for nav33n
0
77
Member Avatar for karang

The [ICODE]InitDocStruct()[/ICODE] function seems OK to me. So the problem probably is in the actual printing code you have.

Member Avatar for mitrmkar
0
129
Member Avatar for 11silversurfer1

[QUOTE=11silversurfer1;652120]sorry that doesn't work. I am trying to draw a line from where my mouse is when i click to where it is when i let go, if that helps. if i do it at 0,0 its fine but as i go further across and down the line isn't where …

Member Avatar for 11silversurfer1
0
328
Member Avatar for raja289

[QUOTE=raja289;653203]just shows last student records ten time instead of each student . [/QUOTE] Isn't that quite obvious if you take a close look at the loop, [code] for(k=1;k<=10;k++) { // do this ten times ... // ask the user for the file name <-> [COLOR="Red"]shouldn't you[/COLOR] // [COLOR="Red"]open the file …

Member Avatar for raja289
0
410
Member Avatar for gangsta gama

[CODE] #include<iostream> using namespace std; [COLOR="Red"]int main() [/COLOR]// <- This line simply just MUST // NOT be here .. there is no way around it [/code]

Member Avatar for gangsta gama
0
263
Member Avatar for ninjaneer

[QUOTE=ninjaneer;653451]by that I mean I added the DLL's path to the additional dependencies directory...?[/QUOTE] PATH does not mean the 'additional dependencies directory'. Windows searches for the .dll at run-time as specified in [URL="http://msdn.microsoft.com/en-us/library/ms682586.aspx"]Dynamic-Link Library Search Order[/URL] PS. You can check your PATH environment variable simply by typing [ICODE]PATH[/ICODE] in a …

Member Avatar for ninjaneer
0
236
Member Avatar for Wiki_Tiki

[QUOTE=Wiki_Tiki;653541] 'This is a test'. When you save it and then open it in notepad, this is what it looks like: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}} \viewkind4\uc1\pard\fs20 this is a test\par } see? a whole lot of crap is added to the text file. How can I fix this? [/QUOTE] The content is …

Member Avatar for Wiki_Tiki
0
109
Member Avatar for masterjiraya

First of all, please use [I]code tags[/I] when you post your code. You have an extra curly brace there ... [code] [COLOR="Red"]// }[/COLOR] <- extra curly brace here ~Quadrilateral() // Call Destructor { cout << "\n\nThe Base Class Rectangle has been destroyed!" << endl; }; [/code] [EDIT] Oh well, niek_e …

Member Avatar for Alex Edwards
0
92
Member Avatar for karang

I think the library you need is [I]libcomdlg32.a[/I]. Generally, when you get linker errors related to Windows API functions, lookup the function's documentation in MSDN, scroll down to the bottom of page where you can find the name of the required .lib (i.e. in this case: [I]Import library Comdlg32.lib[/I]). That …

Member Avatar for mitrmkar
0
939
Member Avatar for karang

Shouldn't you be using [ICODE]pi2->pDevMode->dmFields = [B]DM_ORIENTATION[/B];[/ICODE] instead of [ICODE]pi2->pDevMode->dmFields = DM_PAPERSIZE;[/ICODE]

Member Avatar for karang
0
127
Member Avatar for karang

[QUOTE=karang;652311]But I am getting linker error. " [Linker error] undefined reference to `OpenPrinterA@12' " [/QUOTE] You (may) need to [ICODE]#include <winspool.h>[/ICODE] If you are not using a MS compiler, you need to link with libwinspool.a, otherwise winspool.lib.

Member Avatar for Ancient Dragon
0
536
Member Avatar for Evan M

[QUOTE=Evan M;650998] Apparently, calling TTF_Quit before TTF_CloseFont will cause the error. Is there any easy way around this?[/QUOTE] You might also consider using [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/atexit.html"]atexit()[/URL]

Member Avatar for Evan M
0
237
Member Avatar for bwspoon

You might use debug version of the Wininet.dll, it is available at [URL="http://www.microsoft.com/downloads/thankyou.aspx?familyId=57ad7099-de71-4b1c-8147-725545454146&displayLang=en"]http://www.microsoft.com/downloads/thankyou.aspx?familyId=57ad7099-de71-4b1c-8147-725545454146&displayLang=en[/URL]

Member Avatar for mitrmkar
0
93
Member Avatar for karang

Obviously you don't have a class named [ICODE]CMyView[/ICODE], so you cannot use the provided example as is. Instead you could e.g. make the provided example a stand-alone function and use it as such, i.e. simply [code] BOOL GetPageSize(CSize &nRetVal) { // rest of the example code here ... } [/code]

Member Avatar for mitrmkar
0
96
Member Avatar for henpecked1

[QUOTE=henpecked1;649277]error C2511: 'Contributor::Contributor(std::string,double,Contributor::gender,int)' : overloaded member function not found in 'Contributor' see declaration of 'Contributor'[/QUOTE] In the class declaration, you probably meant to have [I]a member variable[/I] like [ICODE]gender Sex;[/ICODE] instead of [ICODE]enum gender;[/ICODE]

Member Avatar for henpecked1
0
108
Member Avatar for edouard89
Member Avatar for winterx

Please, use [URL="http://www.daniweb.com/forums/misc-explaincode.html"]code tags[/URL] when you post code. See the comments ... [code] double getdaysmissedavg(int num_employees, int days_missed) { int numemployees=0; int daysmissed=0; double daysmissedavg=0; // every time you call this function, you effectively calculate // '0/0' which results in error (you must not divide by zero) // shouldn't you …

Member Avatar for HarryGabriel91
0
1K
Member Avatar for sangham

[QUOTE=Prabakar;648197]I have read about Object Serialization in my JAVA book. Could it be possible with C++?[/QUOTE] See e.g. [URL="http://www.parashift.com/c++-faq-lite/serialization.html"]here[/URL]

Member Avatar for mitrmkar
0
97
Member Avatar for pdk123
Re: help

[QUOTE=pdk123;646490]how do i use it ?[/QUOTE] [URL="http://www.daniweb.com/forums/misc-explaincode.html"]see here[/URL]

Member Avatar for Prabakar
0
193
Member Avatar for shaunkuro

Do you really have the following line as is in the code? [ICODE]} log.h (a header file)[/ICODE] If you do, then there's the error.

Member Avatar for mitrmkar
0
315
Member Avatar for camproject

[QUOTE=camproject;647772]I have written the below code to create a modaless dialog.what to do to view the dialog?it just blinks and goes away... [code]combodlg cd= new combodlg(this); cd.Create(IDD_DIALOG1, this); cd.ShowWindow(SW_SHOW);[/code][/QUOTE] The constructor of the dialog can be like [code] combodlg::combodlg(CWnd* pParent /*=NULL*/) { VERIFY(Create(IDD_DIALOG1, pParent)); } [/code] and to use the …

Member Avatar for mitrmkar
0
76
Member Avatar for jack1234

[QUOTE=CoolGamer48;647408]I'm pretty sure that exists too. I also love this one (not sure if its in Windows API or DirectX): [CODE=C++] #define 1 TRUE #define 0 FALSE [/CODE] [/QUOTE] Actually it would be [code] #define TRUE 1 #define FALSE 0 [/code]

Member Avatar for CoolGamer48
0
127
Member Avatar for camproject

[QUOTE=camproject;647197]i have to add only one line at a time.what i need is add he item in second dialog to first dialog's combo box as soon as I hit "Add" button each time.[/QUOTE] You might change the second dialog's constructor to take e.g. a pointer to the first dialog's CComboBox …

Member Avatar for mitrmkar
0
122
Member Avatar for mikesharp

[QUOTE=mikesharp;645469]I compiled it and ran it as an exe file :( sorry this is not my area,[/QUOTE] Say your .html file's full path is: "d:\folder\file.html", then the following command should do [code] // open the .html in default browser system("start file://d:/folder/file.html"); [/code]

Member Avatar for mikesharp
0
392
Member Avatar for vs49688

Generally you use the [URL="http://msdn.microsoft.com/en-us/library/ms648029(VS.85).aspx"]MAKEINTRESOURCE[/URL] macro to convert the resource id. However, the [ICODE]createStream()[/ICODE] probably isn't capable of playing a resource.

Member Avatar for mitrmkar
0
322
Member Avatar for 13L4D3

[QUOTE=13L4D3;646397]if possible cud u provide me with some links.[/QUOTE] [URL="http://www.learncpp.com/cpp-tutorial/136-basic-file-io/"]Basic file I/O[/URL] Googled [URL="http://www.google.com/search?q=odbc+c%2B%2B+wrapper&ie=utf-8&oe=utf-8&aq=t"]odbc c++ wrapper[/URL]

Member Avatar for mitrmkar
0
112
Member Avatar for Shadoninja

[QUOTE=Shadoninja;645876]Is there a command that hides the dos window while the program executes??[/QUOTE] You might be looking for something like this [url]http://www.codeproject.com/KB/winsdk/runsilent.aspx[/url]

Member Avatar for Prabakar
0
788
Member Avatar for Black Magic
Member Avatar for Jennifer84

You might want to set the [ICODE]HideSelection[/ICODE] property of the [ICODE]RichTextBox[/ICODE] to false.

Member Avatar for mitrmkar
0
97
Member Avatar for SunshineLuvr

You have an extra semicolon in couple of places, e.g. [code] // the following effectively first reads all the available input and only after that advances further ... while(fin>>aemployeename>>apaystat>>ahoursworked>>ahourlyrate)[COLOR="Red"];[/COLOR]{ [/code] If you would have a do/while construct, then you'd need the semicolon, i.e. [code] do { // something } while(something) …

Member Avatar for mitrmkar
1
584
Member Avatar for Jennifer84

You might try something like the following, it removes all spaces that precede an '>'. [code] const std::string srch = " >"; std::string::size_type pos; while(std::string::npos != (pos = Line123.find(srch))) { Line123.erase(pos, 1); } [/code]

Member Avatar for Jennifer84
0
83
Member Avatar for tootypegs

[QUOTE=tootypegs;644002]I would also like its modified time and date.[/QUOTE] See e.g. [URL="http://msdn.microsoft.com/en-us/library/ms724902(VS.85).aspx"]RegQueryInfoKey()[/URL]

Member Avatar for mitrmkar
0
103
Member Avatar for balla4eva33

[QUOTE=CoolGamer48;643648] ... The exception to this rule is when the member is static and integral.[/QUOTE] The exception to this rule is when the member is static and integral and [I][COLOR="Red"]const[/COLOR][/I].

Member Avatar for CoolGamer48
0
154
Member Avatar for Jennifer84

[QUOTE=Jennifer84;643748] I dont know why this is happening and what could be done about that. [code] form2->TopMost::set(true); [/code][/QUOTE] It is happening because that is what the above line does. Maybe you could instead try to use the Form2's Owner property, i.e. [code] Form2 ^form2 = gcnew Form2; // Form1 owns …

Member Avatar for Jennifer84
0
122
Member Avatar for mikelle

Are you sure about the input file's name ?? [code] fin.open("readLab5.[COLOR="Red"]cpp[/COLOR]"); [/code] You almost got the code tags right, however next time you might want to utilize the "Preview Post" button to make sure that the code tags really are right.

Member Avatar for ivailosp
0
121
Member Avatar for FTProtocol

The prototype and the definition mismatch .. [CODE] int ConvertANSI(char sChar [COLOR="Red"][][/COLOR] ); int ConvertANSI(char szText [] ) { return static_cast<int>(szText[0]); }[/CODE]

Member Avatar for mitrmkar
0
85
Member Avatar for camproject

[QUOTE=camproject;642594]i want to delete a particular row from the file.i have three values written in the single line. i have to select a value from a combo box where one of the values was written at the time of writing it to the file.how could i accomplish this?ie,how could i …

Member Avatar for camproject
0
201
Member Avatar for FTProtocol

You have obviously gotten confused about the syntax of returning a value in VB, e.g. Instead of doing [code] GetRandomNumberInRange = szS + Lower; [/code] you should [I]return[/I] the resulting value at that point. And change the [ICODE]GetRandomNumberInRange()[/ICODE]'s signature too, so that it returns int.

Member Avatar for FTProtocol
0
166
Member Avatar for Black Magic

[QUOTE=Black Magic;642948]Hey, I have been trying to learn C++ for a few months know but I'm still not 100%. I've got a good book and all that just do get a bit confused. The thing is I want to learn GUI but i'm not sure what to do. Should I …

Member Avatar for William Hemsworth
0
138

The End.