- 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?
47 Posted Topics
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. … | |
Re: Well, I think there's no way to **directly** convert hex to octal because a hex value needs to be parsed first to get its value in real numbers (decimal). But the process is always the same: to convert decimal to another notation (hex, octal) you divide the number with your … | |
Re: You can use unsigned long long or you can create a class that can handle infinite numerical value (although may not be worth in some particular case). | |
Re: All posts above are sufficient answers. I just want to add a little additional info regarding the `protected` statement: Data/properties and methods of a class declared as protected is only accessible to the class and its inheritors. | |
Re: If you are targetting Windows platform, using a mutex, as suggested by triumphost, is, as my personal experience, the best way to do this. I have here a little sample here: UINT g_uSyncMsg; int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int) { g_uSyncMsg = RegisterWindowMessage("any msg string you prefer"); HANDLE hMutex … | |
Re: Let's examine the code in your binarySearchTree::insert() function line by line: ` treeNode *temp;` ` treeNode *add;` here you allocated memory for you local add variable and set its item property to the value of x add = new treeNode; add->item=x; temp=root; if(temp==NULL) this line here will be executed the … | |
Re: What do you mean *connect*? Run an exe from a web site or use an exe as a server side app? | |
Re: Looks like you have already done some sort of exercises. Perhaps all you need to do first is to review those exercises you underwent. E. g. what is a struct and how to declare a struct? How to declare variables and assign value to them? etc. etc. Do them first … | |
Re: Create your form with all the menus you need, save it (with the name that will help you identify it's contents) and copy it to the *forms templates folder* of visual basic. About this folder, :( I can no longer remember where exactly it is. Haven't been using vb6 for … | |
Re: Hello, meLiel! I'll give you an example how to check whether a record exists in database or not. This is best and easily done if your database records has a field that contains a unique key or id. On your sample code, I will just assume that **txtEnterID.Text** holds the … | |
Re: What kind of error are you receiving, run-time or compile time? May I know the IDE you are using and its version? | |
Re: If you really have typed line 3 (in reference to nullptr's post) that way, it is sure to generate a compile-time error `cannot convert parameter 1 from 'char' to 'void *'`. But if you have typed it like line 2, I'm pretty sure you will get a 14. | |
Re: @histrungalot Your code is fine and it sure will solve Major Aly's problem. But your code has limitations and can initiate memory leak errors since your **AVGPCT* CALC(student *A)** function assumes that *A* is an array of five. What if student is a pointer to an array of less than … | |
Re: You can use these GDI API functions: *GetObject GetDIBits* They are faster than GetPixel but entails more work than the latter. | |
Re: include winmm.lib in your project imports or do the `pragma: #pragma comment(lib, "winmm.lib")` BTW, here is my own version. Additional to this is you can lock/unlock the drive. // dischander.h #pragma once struct DiscHandler { // I assume these routines are self-explanatory static BOOL Eject(BYTE bDrive); static BOOL Load(BYTE bDrive); … | |
Re: How did you export this function from your DLL? | |
Re: Here's mine for your number validation Function Validate_Number(ByRef PassNumber As String) As Boolean Static szValidNum As String If szValidNum = "" Then _ szValidNum = "0123456789" Dim szNum As String Dim c As String * 1, i As Integer, ch As Integer Dim dots As Integer, pluses As Integer, minuses … | |
Re: The code below assumes that you have already established your database connection. To delete a particular record the code is: con.Execute "DELETE FROM <<tablename>> WHERE <<fieldFilter>>='discardable'" NOTES: 1. fieldFilter is the name of field in the table where you are to delete records. 2. fieldFilter can take different systax. It … |
The End.