1,174 Posted Topics

Member Avatar for Suzie999

>> I'm now off to learn how to compile to dll in C++, maybe it will hook me Assuming you have some version of Visual Studio, you might go through MSDN's [URL="http://msdn.microsoft.com/en-us/library/ms235636%28VS.80%29.aspx"]Walkthrough: Creating and Using a Dynamic Link Library[/URL]. It's close to the simplest console app/dll configuration that one can …

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for phummon

I think you'd rather want to use [icode]execvp()[/icode], see [URL="http://www.opengroup.org/onlinepubs/009695399/functions/exec.html"]exec()[/URL] - scroll down to [B]Using execvp()[/B], there's a minimum usage example.

Member Avatar for mitrmkar
0
284
Member Avatar for jrhitokiri

>> when I iterate through login_times, all of them have the same time value asctime() uses a single static buffer and returns a pointer to this buffer every time you call it. In other words, all pointers that you store in the [icode]login_times[/icode] array, point to the very same location …

Member Avatar for jrhitokiri
0
237
Member Avatar for ASTA LAVISTA

This very much looks like a 'trick' question of some sorts. So assuming that the requirements are that 1) the output must be zero (0) and 2) only the comment block is to be modified .. it can be done in standard C++, here's a hint, replace [code] void function(int …

Member Avatar for ASTA LAVISTA
0
412
Member Avatar for Dazaa

>> the compiler is about a year or 2 old. >> Its a C++/C compiler. gcc Most likely the code is not a compiled as C, but C++ instead. In C, you don't need to cast return value from malloc(), and moreover, you [URL="http://c-faq.com/malloc/mallocnocast.html"]shouldn't do that[/URL].

Member Avatar for sree_ec
0
178
Member Avatar for TinhornAdeniyi

I think kes166 pointed out your problems. I'd just suggest that when you compile your programs, pass the following switches to the compiler (via Dev-C++ IDE) [icode]-Wall -Wextra -pedantic[/icode] That will enable most of the warnings and generally also warns about (some) non-standard code (like variable length arrays, which you …

Member Avatar for mitrmkar
0
220
Member Avatar for fire_

Since this is MFC, see [URL="http://msdn.microsoft.com/en-us/library/x9y44b47%28v=VS.80%29.aspx"]CComboBox::AddString()[/URL] [icode]GetDlgItem()[/icode] returns a [icode]CWnd *[/icode], meaning that you need a typecast to [icode]CComboBox *[/icode]. For example [code] CComboBox * pCombo = (CComboBox *) GetDlgItem(IDC_COMBO1); pCombo->AddString("Text"); [/code]

Member Avatar for Ancient Dragon
0
117
Member Avatar for broli100

[URL="http://www.cplusplus.com/reference/clibrary/cstdio/perror/"]perror()[/URL] might come in handy, so perhaps try [code] void uloz2D(char nazevsouboru[]) { // You don't need the NAZEVPR2 variable here printf("%s\n", nazevsouboru); FILE *soubor2 = fopen(nazevsouboru, "w"); if(soubor2) { fprintf(soubor2,"A"); fclose(soubor2); } else { // Failed, what's the reason? perror(nazevsouboru); } } [/code] Are you sure about your last …

Member Avatar for broli100
0
224
Member Avatar for Peter_morley

>> ...When i try to get that date back again in the Actor class >> by the code inception = dateInception.getCharacteristics(); >> I get a result that is like 123441234/1234234234/1234234. By looking at the code (your first post), this line you mention, only exists within the Actor's constructor, meaning that …

Member Avatar for Peter_morley
0
152
Member Avatar for neoraghav

>> dude, i'm creating win32 console application...... Ancient Dragon's suggestion will work provided that you [icode]#include <windows.h>[/icode] If you don't want to pull in the windows.h header, a more lightweight solution would be to use C run-time function [URL="http://msdn.microsoft.com/en-us/library/1z319a54%28v=VS.100%29.aspx"]_chmod()[/URL]. To use that function, you need to [icode]#include <io.h>[/icode].

Member Avatar for neoraghav
0
2K
Member Avatar for johnray31

Looks like the troubles start from line #35 onwards. You could shorten the comparison like so .. [code] bool operator() (const PdpNetworkLocalKey& lhs, const PdpNetworkLocalKey& rhs) const { if(lhs.ip == rhs.ip) // Todo: Use lhs.isLocal and rhs.isLocal here to order the items as you like return ???; else // Order …

Member Avatar for mitrmkar
1
128
Member Avatar for fire_

Assuming this is on Windows, you can load the bitmap with LoadBitmap()/LoadImage(), and then set it using the [URL="http://msdn.microsoft.com/en-us/library/bb761822%28v=VS.85%29.aspx"]BM_SETIMAGE Message[/URL]. The button needs the BS_BITMAP style bit set, but I believe your dialog editor takes care of that.

Member Avatar for mitrmkar
0
589
Member Avatar for litsluv

> .. but I don't know how. I will research it and try to fix my question. The code tag instructions in the [link](http://www.daniweb.com/forums/thread78060.html) seem to be a bit out-of-sync. Here's a version which should work as of this writing ... **Use code tags!** The easiest way to do this …

Member Avatar for Adak
0
209
Member Avatar for sakthi@daniweb

>> i tried the following statements they also give same output printf() discards the excess arguments, hence the output is identical in all the three cases. By the way, please write in full English to make it easier to understand what you are saying. [EDIT] I think your code snippet …

Member Avatar for planetmirchi
0
170
Member Avatar for Jsplinter

>> This compiles, but it is not working. The loop condition is backwards (has [icode]![/icode]). You are complicating the reading, to read a [icode]double[/icode] at a time .. [code] ifstream myfileIN("data2.bin", ios_base::binary); double dub; // As long as sizeof(double) bytes is read .. while(myfileIN.read(reinterpret_cast<char*>(&dub), sizeof(dub)).gcount() == sizeof(dub)) { dq.push_back(dub); } …

Member Avatar for Jsplinter
0
2K
Member Avatar for cableguy31

A suggestion, you might use [icode]stringstream[/icode] for extracting the two fields, that would work for both TAB and SPACE -separated fields. That would be along the lines of .. [code] #include <sstream> // for stringstream // Function to perform lookup in provided MAC to hostname file string search_eaddr(const string & …

Member Avatar for cableguy31
0
215
Member Avatar for winnie89

You can split a string literal to multiple lines like so .. [code] // A single string literal cout << "This program will " "add, subtract, multiply, or " "divide two numbers inputted " "by the user." << endl; [/code]

Member Avatar for mitrmkar
0
213
Member Avatar for NicAx64

>> I go menu->[B]settings->build settings[/B]->select gnu-g++ in the left tree->switch-> >> and change the -l to the -lmapi32 Those are general build settings, shouldn't you rather add the mapi32 library to the current project's configuration? That would be; from the menu, select Workspace / Open active project settings / Linker, …

Member Avatar for mitrmkar
0
145
Member Avatar for nigelmercier

All the three lines of code below have [URL="http://c-faq.com/ansi/undef.html"]undefined behaviour[/URL] and are to be avoided [code] digit[curpos] = ((digit[curpos]++) % 10); p = (p++) % 10; // doesn't work x = (++x) % 10; // works [/code] See [URL="http://c-faq.com/expr/seqpoints.html"]comp.lang.c FAQ list · Question 3.8[/URL]

Member Avatar for mitrmkar
0
346
Member Avatar for vbx_wx

> deprecated conversion from string constant to ‘char*’ The string literals are constants, so using [icode]const[/icode] is in order, like so [code] const char * months[] = {"january","february","march","april"}; [/code]

Member Avatar for LordNemrod
0
133
Member Avatar for Frederick2

From the VS 6 Help menu, select Keyboard Map and then Edit instead of 'bound commands', that'll display the commands/bindings you want.

Member Avatar for Frederick2
0
202
Member Avatar for paula_m

All the pointers in the [icode]reg[/icode] array end up pointing to the one and only buffer [icode]line[/icode] that you have. So, every time fgets() grabs new data, any pre-set pointers in the array automatically point to the newly fetched data - the previous data is simply overwritten.

Member Avatar for samkaraja
0
214
Member Avatar for PixelExchange

>> Does anyone know the event that causes the carriage return animation to play? I believe you've coined a new term for a thing which is more commonly known as a [I]caret[/I]. Perhaps read up about [URL="http://msdn.microsoft.com/en-us/library/ms646968%28v=VS.85%29.aspx"]Carets[/URL] and see if it's possible to achieve what you want.

Member Avatar for PixelExchange
0
145
Member Avatar for dexter1984

The errors boil down to the RationalInfo() function, even though you are not calling it from anywhere, the compiler wants it to be OK, so fix it first or remove it if don't need it [CODE] int RationalInfo (int initialArray[][B][MAX][/B]) { [B]// You still need to declare the variables a …

Member Avatar for Maxwell175
0
141
Member Avatar for caribedude

Since you are using the same [icode]ifstream[/icode] object throughout the do/while -loop, you need to call [icode]tempsynth.clear()[/icode] whenever .open() fails. Otherwise the object remains in fail state and makes no attempt to open any further files. By the way, are you initializing the random number generator (i.e. calling [icode]srand()[/icode])?.

Member Avatar for caribedude
0
283
Member Avatar for zhuimeng

>> I could say i find the limit of microsoft's product in engineering computing. Perhaps see [URL="http://msdn.microsoft.com/en-us/library/aa366778%28v=VS.85%29.aspx"]Memory Limits for Windows Releases[/URL].

Member Avatar for zhuimeng
0
170
Member Avatar for bobbuilder67

[QUOTE=bobbuilder67;1119087]So does anyone know of how I should edit stdafx.h to get his program to work?[/QUOTE] Unfortunately editing stdafx.h will do no good. It is a MFC program you have there, and the VC Express won't be able to compile it like jonsca ^said^. If you know someone, who's familiar …

Member Avatar for sarah_10
0
2K
Member Avatar for titan5

Line #75, connects the last node to the one specified (i.e. temp2) - why? Probably not what you want.

Member Avatar for titan5
0
103
Member Avatar for fizzle

>> I gave up and used a bash call .. Maybe give it another try .. adding a [icode]curl_easy_perform(curl)[/icode] call there might work wonders ;)

Member Avatar for mitrmkar
0
184
Member Avatar for BobbieJean

>> 'book_list' : undeclared identifier In Main.cpp line #26, the missing variable has been commented out, so you need to remove the comments to have the [icode]book_list[/icode] declared. [code] ... // Declare the book list and an STL linked list variable list <BookRecord> book_list; ... [/code] On a side note, …

Member Avatar for jonsca
0
193
Member Avatar for aldrin12

>> Here is the same code similar to the C code in C++ to save you the bother. >> Thread Solved. Sorry, but I think you should [URL="http://www.daniweb.com/forums/thread78060.html"]Read This Before Posting[/URL] .. scroll down to the "Don't give away code!" section.

Member Avatar for Stefano Mtangoo
0
201
Member Avatar for jeffpro

To me it's unclear what the program actually is about precisely, but would [URL="http://msdn.microsoft.com/en-us/library/ms648383%28v=VS.85%29.aspx"]ClipCursor()[/URL] be accepted?

Member Avatar for mitrmkar
0
101
Member Avatar for Lukezzz

[QUOTE=pigg;805622] Yes, as your advice, i add the output of "n", the result is "1026".(it should be 0x402) By the MSDN: 0x402 An unknown error occurred. This is typically due to an invalid path in the source or destination. This error does not occur on Windows Vista and later. So …

Member Avatar for JuliaSh
0
4K
Member Avatar for Excizted

Would it be possible to provide a compilable example program only including the few (?) necessary classes? Have you tried this code with other compilers?

Member Avatar for Excizted
0
196
Member Avatar for vttuning

>> i was able to fix more errors! Nice. >> there is only one left! Even better, I think the error comes from the line #19. Since [icode]Aux[/icode] and [icode]Actual[/icode] both are of type [icode]CNoFila *[/icode], I'm [I]guessing[/I] that your intention was to write .. [code] // Set Aux to …

Member Avatar for vttuning
0
133
Member Avatar for wiegmale

See [URL="http://www.parashift.com/c++-faq-lite/templates.html#faq-35.16"][35.16] Why do I get linker errors when I use template friends?[/URL]

Member Avatar for mitrmkar
0
157
Member Avatar for idb_study

>> I have got core dump by [I]running this code[/I] I'm echoing what griswolf said .. post [I]the actual code[/I] that gave/gives you the core dump. The code you've posted should not compile with any compiler - because of the missing ')' (line #8). Anyhow, assuming that your crashing program …

Member Avatar for mitrmkar
0
305
Member Avatar for BLKelsey

>> Error 1 - error C2011: 'Controller' : 'class' type redefinition 9 An unfortunate space character has slipped in, preventing the definition of the intended [icode]CONTROLLER_H[/icode] macro .. Controller.h [code] #ifndef CONTROLLER_H // #define CONTROLLER _H // <--- wrong #define CONTROLLER_H // <--- right #include "LevelFolders.h" ... [/code]

Member Avatar for mitrmkar
0
135
Member Avatar for vbx_wx

If your compiler supports [icode]long long[/icode], you may [LIST] [*] get lucky with [icode]std::stringstream[/icode] [*] have [icode]strtoll()[/icode] at your disposal [/LIST] Though, as Banfa noted, your code will not be standard C++.

Member Avatar for mitrmkar
0
242
Member Avatar for tomtetlaw

>> I am getting a really weird unhandled exception What is the exact error message? (there are many exceptions) Are you using Visual Studio?

Member Avatar for tomtetlaw
0
130
Member Avatar for vaina74

>> [I]test.cpp:3:18: error: stream:[/I] There isn't a header file named <stream> in standard C++. Looks like you'd rather want to; #include <string>

Member Avatar for vaina74
0
225
Member Avatar for Stefano Mtangoo

It should be [icode]__declspec[/icode], so .. [code] #define PLUGIN_EXPORTABLE __declspec(dllexport) [/code] >> Also I don't understand what the warning below means >> warning: no newline at end of file You need to add a new-line character at the end of the file. If you don't, your C++ program has undefined …

Member Avatar for Stefano Mtangoo
0
342
Member Avatar for darelet

At least the [icode]stats[/icode] constructor needs some attention, see the comments below. [code] <snip> while(i<(d_data->nCols*d_data->nRows)){ d_data->data[i]=datap->data[i]; // 'i' gets incremented too early here i++; // Upon last iteration; i == d_data->nCols*d_data->nRows, which is wrong uchar n = datap->data[i]; // .. then, the damage is done here ... d_data->data[i]=n; uchar m …

Member Avatar for mitrmkar
0
383
Member Avatar for vuki27

WinBGI [I]might[/I] do the job. See vegaseat's code snippet; [URL="http://www.daniweb.com/code/snippet216433.html"]Add WinBGI Graphics to your Console[/URL]. There's a link to a site from where you can get what's needed -- note that you also need to get a new compiler.

Member Avatar for mitrmkar
0
171
Member Avatar for vipin.sachan

Also note that HP-UX's malloc() may fail if you e.g. have previously tampered with the allocated memory. See [URL="http://docs.hp.com/en/B2355-60105/malloc.3C.html"]http://docs.hp.com/en/B2355-60105/malloc.3C.html[/URL] - scroll down to DIAGNOSTICS.

Member Avatar for mitrmkar
0
188
Member Avatar for mybluehair

Looks like nbaztec and jonsca sorted your problems out. However, I'd like to point out a basic thing that you've been doing wrong, namely "number_of_users = ++number_of_users". Do not write code like that, see [URL="http://c-faq.com/expr/ieqiplusplus.html"]comp.lang.c FAQ list · Question 3.3 [/URL]

Member Avatar for nbaztec
0
406
Member Avatar for aianne

I'm guessing that [ICODE]initgraph()[/ICODE] fails there and the program just silently exits (i.e. calls exit(1)). [EDIT] After looking up [URL="http://www.cs.colorado.edu/~main/bgi/doc/initgraph.html"]initgraph()[/URL] it's clear that the teacher gave you a bad example (perhaps intentionally?). Anyway, you have to change the call to [ICODE]initgraph()[/ICODE] so that it matches the function's signature.

Member Avatar for Adak
0
312
Member Avatar for Narue

Just a suggestion in case this ICODE button re-appears. Would it be possible to display it as e.g. "INLINE", instead of the previous "ICODE"? I think that would cut down the number of posts with code snippets encased in ICODE tags (there are lots of those).

Member Avatar for TrustyTony
0
152
Member Avatar for iamthwee

[QUOTE=iamthwee] I trying to get the [I]LAST modified[/I] [/QUOTE] Then you want to use [icode]ftLastWriteTime[/icode]. [QUOTE] to decide which text file is the most recent[/QUOTE] You can directly compare the FILETIMEs using [URL="http://msdn.microsoft.com/en-us/library/ms724214%28v=VS.85%29.aspx"]CompareFileTime()[/URL]

Member Avatar for Radical Edward
0
1K
Member Avatar for rootchord

[QUOTE=rootchord] In function ‘bool operator<(const Student&, const Student&)’: ../src/Student.cpp:25: error: passing ‘const Student’ as ‘this’ argument of ‘int Student::getscore()’ discards qualifiers [/QUOTE] Your compiler is trying to tell you that you want to declare the getscore() and getname() methods as [ICODE]const[/ICODE]. So, instead of stripping away constness, you might rather …

Member Avatar for rootchord
0
640

The End.