- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 10
- Posts with Upvotes
- 10
- Upvoting Members
- 8
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
There's more politics in there than the dying stuff, brother. I have already 'gave them a favor' by playing bullshit to the people who developed me to be a proud countryman. Now you wanna give me to the wolves?
Re: Dim rs As Recordset, nextId As Long Set rs = con.Execute("SELECT Max(emp_id) As LastID FROM theTable") nextId = 1 If rs.RecordCount <> 0 Then nextId = rs!LastID End If nextId = nextId + 1 | |
Re: You declared you array wrong. > char array[5][**2**] = { "blueone", "greentwo", "redthree", "pinkfour", "yellowfive" }; This declaration says that there are 5 elements that themselves are arrays consisting 2 elements. You can declare them like this: `char (asterisk character) array[] = { "blueone", "greentwo", "redthree", "pinkfour", "yellowfive" };` NOTE: … | |
Re: You can't do that in C++. Microsoft Office Applications do not use the ordinary menu we see in other windows-based program. | |
| Re: Review the instructions to your assignment. Sometimes are error is not the coding itself but the failure to follow instructions. Like this: > ...data in the file. Your **input and output file names will be supplied to your program on the command line, which you will access using argc and … |
Re: First of all, I did not see any variable declared with an identifier To and From. But I suppose the main error in this class is your declaration if these variables: m_To, m_From and m_Msg. They are all pointers. And the fact that they are pointers, you should not call … | |
Re: If your goal is to read the file line by line without the carriage return and line feed (CRLF), you can do so without allocating large amount of memory. And, I still opt the method you choose than using another object for that purpose. Dim strBuffer As String Close #1 … | |
Re: Typing ULONG instead of ulong might help. BTW, DWORD is the same as ULONG. | |
Re: First, have a cleanup of your code. You may (must) replace your code from line 40 up to line 62 with the code below. That way, it could be cleaner to read (and debug) your code and it might help us—including yourself—solve your problem. if (reply == 'y') { switch … | |
Re: Previous answers are correct but I just want to post something clearer. If you are planning to use more than one database simultaneously in your program, you have to make one connection per database. But the most ideal solution here is to make links to the table of interests from … | |
Re: OK, for the sake of answering the question, when creating your main window (with CreateWindowEx API and not with CreateWindow macro), include in the extended window style the WS_EX_TOOLWINDOW. But you'll have title bar which is awkward for a main window. If you are using a dialog box as your … | |
Re: But using random numbers in createing bank account number, I suppose, is not a good idea. There are a lot of ways you can generate a unique bank account number. One of this is using the date and time a client registered. | |
Re: He he he. Actually, the OP's confusion is valid. After the state `while( count++<=5)`, count's value will already be 2, thus `cout<<count*(count-2)<<" ";` will be 2*(2-2)==>2*(0)==>0. It's like the sum(A1:A5) function in excel returning different result compared to A1+A2+A3+A4+A5. If you're very much sure there's nothing to check in your … | |
Re: You just declared the structure of the class, its ctor and dtor and some data members. Does your project files include a source file that will define the class? | |
Re: What do you want from the web site pointed to by the URL? The HTML document, objects contained in an element like *src* of the <img> element? If you are going to do that in windows, you can run an instance of the internet explorer thru its dispatch interface, feed … | |
Re: That's one solution to the problem--one solution because there are a lot of ways you can avoid this *warning*. | |
Re: ...and to make the life of the user of your program easier, consider him wanting to type lower case F, C and Y. | |
Re: mc3330418's question was that you allocated (dynamically) a Student object but missed (or failed) to deallocate them when your program exits. > Basically when you dynamically allocate an array the compiler calls the constructor for each object you want to allocate. Yes, that's true, IF, you allocated them using the … | |
Re: Calling registry functions does not cause GetLastError() to return any error codes. They are rather returned by the registry function you called. Example: DWORD Err; HKEY key; char * msg; Err = RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\hggjk"), &key); if( Err!=ERROR_SUCCESS ) { FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, Err, (LPTSTR) &msg, 0, NULL); cout<<"System: … | |
Re: template<class _T> const char * dec2bin(_T dec) { static char szret[65]; int ch = sizeof(dec) * 8; memset(szret, 0, ch+1); char * ptr = szret; for( int i=0;i<ch;i++ ) ptr[ch-1-i] = '0' + (dec >> i & 1); return ptr; } I've tried before posting this. dec2bin function accepts any … | |
Re: ...and for a cleaner coding you can cause the switch statement: *After lines #7 & #8 of Milton Neal's post:* switch( sign ) { case '+': statements; break; case '-': statements; break; case '*': statements; break; case '/': statements; break; default: cout<<"Invalid sign "<<"("<<sign<<") used."; } Replace *statements* with your … | |
Re: You can combine `info.wShowWindow = SW_HIDE` with `info.dwFlags = STARTF_USESHOWWINDOW`. But the GUI app you are trying to run could always ignore the value of wShowWindow of STARTUPINFO structure (which is passed as `int nCmdShow` in the WinMain entry point) and show its own window the way it wants (the … | |
Re: Why this program crashes not because of *typedef* but because of using an uninitialized variable. Look at your code at line #6: You declared `static test *p` and, without allocating it, used in your `int main()` function. On your second post, `static test p` should work of course because variable … | |
Observe this code: TOOLBARINFO tbi = { 0 }; BUTTONINFO bi, *xBI; tbi.pTOI = pTOI; int x = 0, xSearchBox = 0, s = 0; BYTE xType = btNone; BOOL bAdd; for( ;*pszInfo; ) { bAdd = TRUE; memset(&bi, 0, sizeof bi); switch( *pszInfo ) { case bfButton: s++; bi.L … | |
| Re: if you just want to check if your process is still alive or dead using the process id (pid) you have, calling the OpenProcess API would suffice. |
Re: But, in continuation to deceptikon's reply, if you just want to be able to call ShellExecute while enabling you to pass your sProgramName variable as an argument, you can use its ANSI version without much hassles, e. g. ShellExecuteA(NULL, NULL, &sProgramName[0], NULL, NULL, SW_SHOW); | |
Re: Using the right shift (>>) operator is the quicker, if not the quickest, method. | |
Re: As your class declaration says, **buildFromInputString** is part of its structure. But when you defined the functions of your class, particularly buildFromInputString function, I think you simply missed to type something. Look at what you've typed in line 114: template<typename T> void buildFromInputString(const string input) { istringstream iss(input); while(iss) { … | |
| |
Re: Hello echo, I wrote here some notes I hope could help you decrypt your problem. 1. If you want to create a subclassed button where you want to do the painting yourself through the new WNDPROC address you have given, you do not need to create an owner-drawn button. 2. … |