1,174 Posted Topics

Member Avatar for kleinsun

[QUOTE=kleinsun;816674] But this operation always fails. Could anybody give me a little hint? Thanks![/QUOTE] [URL="http://msdn.microsoft.com/en-us/library/ms679360(VS.85).aspx"]GetLastError()[/URL] gives you an error code (defined in winerror.h), which might prove to be useful.

Member Avatar for mitrmkar
0
2K
Member Avatar for marcosjp

[QUOTE=marcosjp;817147] Is it possible to detect the Windows version (or at least detect if it's XP or Vista) from a C++ code?[/QUOTE] Yes it is. See [URL="http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx"]Getting the System Version[/URL]

Member Avatar for mitrmkar
0
147
Member Avatar for replic

To get 'non-destructive writes', open the file specifying also the [ICODE]ios::in[/ICODE] mode.

Member Avatar for replic
0
238
Member Avatar for FTProtocol

[QUOTE=FTProtocol;667999]Just wondering if theres a function to get the window title of your browser. Like if you were to visit [url]www.myspace.com[/url] your window title would be: [url]www.myspace.com[/url] - Mozilla Firefox or w/e browser you happen to use. Is there a way to get the title of a window?[/QUOTE] Use [ICODE]GetWindowText()[/ICODE] …

Member Avatar for fskreuz
0
1K
Member Avatar for amt_muk

[QUOTE=amt_muk;753309] [B]..\source\CRaterEDRFile.cpp(276) : error C3861: 'open': identifier not found[/B] [/QUOTE] Microsoft has renamed it to _open(), see [url]http://msdn.microsoft.com/en-us/library/ms235491.aspx[/url]

Member Avatar for mitrmkar
0
125
Member Avatar for kodak

It appears as if you might have stumbled upon the virtualization feature of Windows Vista. Try looking it up on the MSDN.

Member Avatar for kodak
0
122
Member Avatar for 666kennedy

[URL="http://www.cplusplus.com/reference/clibrary/cstdlib/rand.html"]Here[/URL] is a reference for rand() along with a simple example of its usage.

Member Avatar for ArkM
0
155
Member Avatar for Stefano Mtangoo

To see how the _declspec(dllexport) and _declspec(dllimport) are supposed to be used, try creating a new 'dynamic link library' project in CodeBlocks. When you build the DLL project, remember to define the BUILD_DLL macro (do it via the project's build options). There are a couple of errors, see below [code] …

Member Avatar for Stefano Mtangoo
0
366
Member Avatar for robgeek

[QUOTE=robgeek;746214] The error says: "initialization skipped by case label."[/QUOTE] You can circumvent that [COLOR="Red"]by[/COLOR] ... [code] int main() { ... switch(option) { case 'h': case 'H': [COLOR="Red"]{[/COLOR] // new scope begins here ... ... ifstream input("Help.txt"); ... [COLOR="Red"]}[/COLOR] // ... and ends here break; ... } return 0; } [/code]

Member Avatar for robgeek
0
4K
Member Avatar for koushal.vv

There are two images in the icon resource, you either have to modify both of them or simply delete one image.

Member Avatar for mitrmkar
0
208
Member Avatar for vickzbrit

Wouldn't it be easiest to add 'standard' ON_UPDATE_COMMAND_UI handlers for those two sub-menus, i.e. you'd have something along the lines of: [code] ON_UPDATE_COMMAND_UI(IDM_SUBMENU1, OnUpdateSubmenu1) ON_UPDATE_COMMAND_UI(IDM_SUBMENU2, OnUpdateSubmenu2) ... void SomeClass::OnUpdateSubmenu1(CCmdUI* pCmdUI) { pCmdUI->Enable( ... ) } void SomeClass::OnUpdateSubmenu2(CCmdUI* pCmdUI) { pCmdUI->Enable( ... ) } [/code]

Member Avatar for vickzbrit
0
1K
Member Avatar for brechtjah

You are not getting the window text properly, it should be [code=cpp] char editControl_Content[2]; // the following gets one char into editControl_Content[0] and sets // editControl_Content[1] to '\0' int charCount = GetWindowText(GetDlgItem(hwnd, LOWORD(wParam)), editControl_Content, 2); if(charCount > 0) { // got a char ... } [/code] And further on, when …

Member Avatar for brechtjah
0
169
Member Avatar for Xarver

[QUOTE=Xarver;729920]I still need help here. :|[/QUOTE] Assuming that SDL is unable to load the image, you might place a call to [URL="http://sdl.beuc.net/sdl.wiki/SDL_GetError"]SDL_GetError()[/URL] immediately after the line: [ICODE]background = load_image("background.bmp");[/ICODE] to get a description of the cause of the failure.

Member Avatar for Xarver
0
354
Member Avatar for Kamal_Java
Member Avatar for mitrmkar
0
156
Member Avatar for andyT

[QUOTE=andyT;724057] [code] double *lvec; lvec = new double[COLOR="Red"]([/COLOR]numrows[COLOR="red"])[/COLOR]; [/code][/QUOTE] [COLOR="Red"]That[/COLOR] allocates you a single double, initialized with the value of [ICODE]numrows[/ICODE]. In that case, you delete that double by: [ICODE]delete lvec;[/ICODE] Anyhow, you need to do ... [code] // try allocating numrows doubles ... double *lvec = new double [numrows]; …

Member Avatar for andyT
0
180
Member Avatar for amerninja2

You'll probably find [URL="http://msdn.microsoft.com/en-us/library/ms685035(VS.85).aspx"]Reading Input Buffer Events[/URL] useful.

Member Avatar for amerninja2
0
319
Member Avatar for uim_1977

About code tags ... you don't have to type in the line numbers in the code you post, just specify [ICODE]cplusplus[/ICODE] as the syntax i.e. [noparse][code=cplusplus] // code pasted here ... [/code] [/noparse]

Member Avatar for uim_1977
0
187
Member Avatar for something else

[QUOTE=something else;722396]any ideas please [/QUOTE] Microsoft has documented the compiler/linker errors/warnings, so you can try looking them up in the MSDN or in the IDE's help, if you have it installed. See [URL="http://msdn.microsoft.com/en-us/library/aa734003(VS.60).aspx"]Compiler Error C2601[/URL]

Member Avatar for grumpier
0
127
Member Avatar for uim_1977

Try with these [COLOR="Red"]changes[/COLOR] [code] //CUSTOMERDLL.H #ifndef DllH #define DllH #include "customerForm.h" [COLOR="Red"]extern [/COLOR]TCustomerF* DllCustomer; //--------------------------------------------------------------------- void __fastcall Search (AnsiString, AnsiString, TIBTable*); extern "C" __declspec(dllexport) __stdcall void CreateCustomer(TComponent *Owner); //--------------------------------------------------------------------- #endif [/code] [code] //--------------------------------------------------------------------------- //CUSTOMERDLL.CPP #include <vcl.h> #include <windows.h> #pragma hdrstop #pragma argsused #include "customerdll.h" [COLOR="Red"]TCustomerF* DllCustomer = NULL;[/COLOR] int …

Member Avatar for mitrmkar
0
159
Member Avatar for Liszt

[QUOTE=Liszt;719073] As I have put the filter to "LastWrite" why does the event shoot 2 times because I limit it to just LastWrite and are not using the "LastAccess" also.[/QUOTE] I guess that your editor makes calls to Windows API functions that cause the event to occur twice. You might …

Member Avatar for Liszt
0
253
Member Avatar for Ancient Dragon

I think you are using a 32-bit toolset (VS Express) and trying to link with the 64-bit version of libmysql.lib. The 32-bit version of libmysql.lib comes with those missing symbols, what you have is the 64-bit library.

Member Avatar for Ancient Dragon
0
82
Member Avatar for sladesan

[QUOTE=sladesan;715306]I have made a few changes so I putting the copy of the code in and yes I am still getting the same problem. [/QUOTE] Rather use [ICODE]new[/ICODE] instead of [ICODE]malloc()[/ICODE] for allocating the [ICODE]scout[/ICODE] structures (because [ICODE]scout[/ICODE] contains a [ICODE]std::string[/ICODE] member variable)

Member Avatar for stilllearning
0
169
Member Avatar for NinjaLink

You most definitely want to take the [ICODE]inData.open("Unknown.txt");[/ICODE] and [ICODE]inData.close();[/ICODE] out of the for() loop. Open the file before you enter the loop and close the file after the loop has finished.

Member Avatar for VernonDozier
0
109
Member Avatar for kenji

[QUOTE=kenji;713576]Tried what you said but getting the same result. :-/[/QUOTE] Perhaps your intention was to replace also a '\v' with a space but you forgot to do it?

Member Avatar for stilllearning
0
76
Member Avatar for killdude69

The following should work ... [code] LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_CREATE: // ... create the richedit window here -> hWndRichEdit // set event mask ... SendMessage(hWndRichEdit, EM_SETEVENTMASK, (WPARAM)0 (LPARAM)ENM_MOUSEEVENTS); break; case WM_NOTIFY: { const MSGFILTER * pF = (MSGFILTER …

Member Avatar for killdude69
0
846
Member Avatar for adityasaten

[QUOTE=niek_e;699618]Or if you want to type in even less characters: [code=c] printf("*\n***\n******\n*******\n*********\n"); [/code] I typed 8 characters less (double quotes) and saved myself up to 3 seconds of time :)[/QUOTE] Hmm .. or even less [code=c] puts("*\n***\n******\n*******\n*********"); [/code]

Member Avatar for abhijeetcn
0
119
Member Avatar for Jennifer84

I think you are after ... [code] typedef List<String^> Vec1; typedef List<Vec1^> Vec2; Vec2 List1; for( int j = 0; j < 1000; j++ ) { List1.Add(gcnew Vec1()); for( int i = 0; i < 1000; i++ ) { List1[j]->Add("0"); } } [/code]

Member Avatar for Jennifer84
0
169
Member Avatar for gangsta1903

[QUOTE=gangsta1903;702798]ok,I put those checkings but there still seems no problem,but no output too... I tried char* instead of strings but it still didnt work...[/QUOTE] One fix to the reading problem is to re-open the file, or alternatively you might implement something similar to [URL="http://www.cplusplus.com/reference/iostream/istream/seekg.html"]seekg()[/URL] to set position of the [I]get …

Member Avatar for gangsta1903
0
141
Member Avatar for unk45

[QUOTE=unk45;702862]ok makes sense..but why is it temp[0]...in other words shouldnt it be the last index and as of my understanding with index 0 isnt it looking at element 0??[/QUOTE] [ICODE]temp[0][/ICODE] is actually in the ivailosp's program, however you must use what niek_e told, which is: [ICODE]temp[count] = '\0';[/ICODE].

Member Avatar for unk45
0
275
Member Avatar for cam875

You should initialize [ICODE]ElementAmount[/ICODE] to zero. Note that if you compile with the [ICODE]-pedantic[/ICODE] option, you'll get an error about variable-size array usage, i.e. you might want to change ... [code] char binary[ElementAmount]; [/code] to [code] char * binary = new char[ElementAmount]; [/code]

Member Avatar for cam875
0
61
Member Avatar for launic

Change `s.erase(pos, pos);` to `s.erase(pos, 1);`. The second parameter tells how many characters to remove at index `pos`. [EDIT] Seems I was late ...

Member Avatar for mitrmkar
0
166
Member Avatar for san_sarangkar

You might try something like ... [code] #include <iostream> using namespace std; struct test { void myfunction() { cout << "myfunction()\n"; } test() { myfunction(); } }; static test testing; int myfunction2() { cout << "myfunction2\n" << endl; return 43; } static int test2 = myfunction2(); int main(void) { cout …

Member Avatar for ArkM
0
321
Member Avatar for gin1026

[QUOTE=gin1026;699928] regarding the question again, i will now continue to find the solution, so, instead of using namespace, can anyone give me some clue how to implement the clocking code in .c files? thanks1[/QUOTE] Use [ICODE]#include <time.h>[/ICODE], and use [ICODE]clock_t[/ICODE] and [ICODE]clock()[/ICODE] instead of [ICODE]std::clock_t[/ICODE] and [ICODE]std::clock()[/ICODE].

Member Avatar for gin1026
0
523
Member Avatar for Jennifer84

Results of double_to_string() is somewhat off due to a missing zero ... [QUOTE] void double_to_string() { std::clock_t start = std::clock() ; for(int i = 0; i < 200000[COLOR="Red"]0[/COLOR]; i++) { [/QUOTE]

Member Avatar for mitrmkar
0
154
Member Avatar for chanda gul

[QUOTE=chanda gul;698144] DWORD dwFilePointer = SetFilePointer(h,0,0, FILE_BEGIN); [/QUOTE] That gives you the [URL="http://en.wikipedia.org/wiki/Master_boot_record"]master boot record[/URL] (MBR). Based on the [URL="http://www.ntfs.com/partition-table.htm"]partition table[/URL]s within the MBR, you can locate the boot sector that you are looking for (i.e. figure out the number of sectors you have to bypass before landing on the …

Member Avatar for mitrmkar
0
123
Member Avatar for daviddoria

[QUOTE=Athos84;689025]mouse function is not defined into two files.. what can I do?[/QUOTE] That error occurs also if you have implemented the mouse() function in a header file (.h) and include that header file in two or more source files (.cpp). So, you should move the [I]implementation[/I] of the mouse() function …

Member Avatar for kux
0
670
Member Avatar for jhonnyboy

[QUOTE=Sky Diploma;695494] [CODE] vector<string>numbers; string temp; [COLOR="Red"]while(!infile.eof())[/COLOR]{ infile>>temp; numbers.push_back(temp); } [/code][/QUOTE] [URL="http://www.daniweb.com/forums/post155265-18.html"]Avoid Loop Control Using eof()[/URL]

Member Avatar for Sci@phy
0
141
Member Avatar for jrrr

[QUOTE=jrrr;695951]compiler says that in this code..."name lookup change ISO 'for' scoping then using obsolete binding at i"... [/QUOTE] It means that the [ICODE]i[/ICODE] exists only within the for() loop. You might change it to ... [code] int i; for (i=0; i<20; i++) { r [i]=0; } // ... [/code] [EDIT] …

Member Avatar for mitrmkar
0
94
Member Avatar for Prathvi
Member Avatar for Prathvi
0
273
Member Avatar for chiwawa10

[QUOTE=chiwawa10;672942]Thank you for the info, Edward. Here's more information. The application calls a function in a DLL (which was written by me). When the debug's DLL is used, the application does not crash when exit (running on Vista). However, it crashes upon exit when the release's DLL is used instead …

Member Avatar for Salem
0
118
Member Avatar for kazek

[QUOTE=kazek;690852]I'm trying to create a function that will delete an already saved file. I was hoping std::remove() would do the trick but I don't know the syntax. [/QUOTE] [URL="http://www.cplusplus.com/reference/clibrary/cstdio/remove.html"]remove()[/URL]

Member Avatar for mitrmkar
0
91
Member Avatar for jacobdet

You are not converting from a char to int in the valid() function when comparing with 'a'. Then a couple of notes: - try choosing meaningful names, e.g. the valid() function takes three arguments named: a, b, c. That's a poor practice. - when you ask why a program fails …

Member Avatar for mitrmkar
0
303
Member Avatar for Ancient Dragon

[QUOTE=Ancient Dragon;687792]I used dumpbin.exe to get a list of all the symbols in libmysql.lib and noted that the function names did not have _ in front of them[/QUOTE] Sounds strange, I dumped the libmysql.lib exports [code] dumpbin /exports libmysql.lib => ... _my_realloc _my_strdup _myodbc_remove_escape@8 _mysql_affected_rows@4 _mysql_autocommit@8 _mysql_change_user@16 _mysql_character_set_name@4 ... whereas, …

Member Avatar for mitrmkar
0
167
Member Avatar for bhoot_jb

[QUOTE=bhoot_jb;685904]i am a beginner in MFC programming and using MS VC++ 6.0. I am trying to create my own window using AfxRegisterWndClass(). My code is as follows : [CODE]Frame::Frame() { LPCTSTR className; HBRUSH brush; brush = (HBRUSH) ::GetStockObject (BLACK_BRUSH); className = ::AfxRegisterWndClass ([COLOR="Red"]WS_OVERLAPPEDWINDOW[/COLOR], AfxGetApp()->LoadStandardCursor (IDC_CROSS), brush, AfxGetApp()->LoadStandardIcon (IDI_ERROR)); Create (className, …

Member Avatar for bhoot_jb
0
171
Member Avatar for Mehwish Shaikh

[QUOTE=Mehwish Shaikh;683591] its giving me so many errors....[/QUOTE] Well, first of all, be [I]consistent[/I] with the names of the member functions, for example [code] int BST::[COLOR="Red"]SEARCHtree[/COLOR](node* i, int k) { if(i==NULL) { return 0; } else if(k == i->key) { return(i->key); } else if(k < i->key) { return [COLOR="Red"]TreeSearch[/COLOR](i->left, k); …

Member Avatar for Nick Evan
0
354
Member Avatar for Alex Edwards

[QUOTE=Ancient Dragon;684298]flush is a function[/QUOTE] There is also a manipulator by the same name, [URL="http://www.cplusplus.com/reference/iostream/manipulators/flush.html"]flush[/URL]

Member Avatar for Narue
0
3K
Member Avatar for amrith92

Hmm, just a thought .. how about changing one line of the signature to: cout << "Hi there!" << "I'm a non-standard-compliant C++ coder!"; ;)

Member Avatar for amrith92
1
211
Member Avatar for dexter1984

It appears as if you might find already deleted students, because of the ... [code] for (int n = 0; n < [COLOR="Red"]MAX_STUDENTS[/COLOR]; n++) { if (strcmp(delStudent, students[n].ID) == 0) { [/code]

Member Avatar for Salem
0
101
Member Avatar for Jennifer84

I think you'd want to have the string and the newline the other way around, i.e. [code]text += Dummy2 + System::Environment::NewLine;[/code]

Member Avatar for Jennifer84
0
80
Member Avatar for ithelp
Member Avatar for jwenting
0
418

The End.