- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 36
- Posts with Upvotes
- 33
- Upvoting Members
- 28
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
Re: [QUOTE]How to write a C program to count the number of mouse clicks in our Pc.Can any one give me idea for that ? [/QUOTE] Your question is very vague. For example, what OS are you using? Do you want to count the mouse clicks in one particular application or … | |
Re: You'll first have to download [JSON.net](http://james.newtonking.com/json) Here's a simple example.... using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using Newtonsoft.Json; class Program { static void Main(string[] args) { using (WebClient webClient = new System.Net.WebClient()) { WebClient n = new WebClient(); var json = n.DownloadString("http://data.mtgox.com/api/2/BTCUSD/money/ticker_fast"); string valueOriginal = Convert.ToString(json); … | |
Re: Have you tried using the Microsoft IDL compiler (MIDL.EXE) from the command line? | |
Re: The L prefix denotes a wide character/string literal. That is, it is of type wchar_t instead of char. Also, to reiterate the L prefix is only used with literals. #include <iostream> #include <string> int main() { std::wstring comport; std::wcout << L"Enter your comport: "; std::wcin >> comport; std::wcout << L"Com … | |
Re: qDebug() << db.lastError(); What's the error message from the above statement? You may want to use the following to print the message... cout << db->lastError().text() << "\n"; | |
Re: > In the above code the problem is that the values are sent only when the program is closed, before that even though the connection is getting established, at the receiving end no values are read. I can't recreate your problem. I've used your posted code to connect to a … | |
Re: Have you tried using the following command? axWindowsMediaPlayer1.uiMode = "none"; | |
Re: Details of your error code... > wbemErrAccessDenied > Value is -2147217405 (0x80041003) | |
Re: Maybe this example will be of some help to you... #include <windows.h> #include <tchar.h> #include <stdio.h> #define _WIN32_DCOM #include <iostream> using namespace std; #include <comdef.h> #include <Wbemidl.h> # pragma comment(lib, "wbemuuid.lib") int _tmain(int argc, _TCHAR* argv[]) { CoInitialize(NULL); { VARIANTARG *pVals; SAFEARRAYBOUND rgsabound; rgsabound.lLbound = 0; rgsabound.cElements = 4; SAFEARRAY* … | |
Re: I believe your logic is flawed. For example, if I enter 1969 into your app, it will return MDCCCCLXIX. Unfortunately, that is not the correct Roman Numeral for 1969. The correct Roman Numeral is MCMLXIX. | |
Re: Here's an excerpt from Introducing Windows 7 for Developers.. > The Better Model: Enhancing the Touch Experience > > The Better model addresses the need to make your application touch aware and provide better touch and multitouch support to your application than the default legacy support that was explained in … | |
Re: > When I tested this program it worked right up until I selected another window, at which point it effectively 'paused' until I selected it again. Is there any way to make this not happen? Maybe the following starter code can be of some assistance to you.. #pragma comment(lib,"user32.lib") #pragma … | |
Re: [OpenFileDialog](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog%28v=vs.110%29.aspx) | |
Re: It appears that you may be going out of bounds on your char arrays which may be resulting in a stack corruption. Try the following. Change these three variables... char day[2] = ""; char month[2] = ""; char year[5] = ""; to.... char day[3] = ""; char month[3] = ""; … | |
Re: > Note: I believe all of the symbols which I am referencing are a part of UTF-16 (none have Unicode values higher than FFFF), but I am not well educated on exactly how unicode works. > How do wchar_t and wfstream respond to normal ASCII input (given that unicode is … | |
Re: Celcius to Fahrenheit conversion formula can be found at [this](http://www.mathsisfun.com/temperature-conversion.html#explanation) link. | |
Re: Maybe a simple example will point you in the right direction... #include <iostream> #include <fstream> using namespace std; #define MP3FILE "01-Cheeseburger in Paradise.mp3" int main(void) { char title[31] = {0}; ofstream myOutputFile; streamoff pos; myOutputFile.open(MP3FILE, ios::out | ios::in | ios::binary); if(!myOutputFile.good()) { cout << "myOutputFile open failed"; system("PAUSE"); return 0; … | |
Re: I hope the following explanation is helpful. Unfortunately, I can't find any preview option, so I'm not sure how the post will appear I've iterated line by line thru the while loop in your posted coded as indicated below. Assume n (input) is 1234 Since reverse is initially zero reverse … | |
Re: Another option... #include <stdio.h> #include <string.h> char* reverse_string(char* str) { for(int beg = 0, end = strlen(str) - 1; beg < end; ++beg, --end) { str[beg] ^= str[end]; str[end] ^= str[beg]; str[beg] ^= str[end]; } return str; } int main(void) { char buffer[]="Hello World"; printf("%s\n", reverse_string(buffer)); return 0; } | |
Re: // Can also use COM2, COM3 or COM4 here hPort = ConfigureSerialPort("COM1"); if(hPort == NULL) { printf("Com port configuration failed\n"); return -1; } I'm assuming your problem is due to using a non existent COM port. In this case, COM1 does not exist. Thus, one possible solution would be to … | |
Re: The addtohead method isn't needed. Use the insertionsort method to add (insert) a char and sort the linked list. You'll have to address four different cases in a insertion sort linked list: Case 1. An inserted node is the first one to be added to an empty list. Case 2. … | |
Re: Unfortunately, you have a lot of potential issues with your clipboard data application. You may want to reference [this post](http://cboard.cprogramming.com/windows-programming/103813-how-track-every-copy-event.html#post760572) for a better understanding of the clipboard API. | |
Re: IMHO, password protection of a folder would normally be done on the kernel level. But check out [this security link](http://msdn.microsoft.com/en-us/library/system.security.accesscontrol.aspx) which may provide something of use to you. | |
Re: [Here](http://www.zoneminder.com/forums/viewtopic.php?f=9&t=19215) is a link demonstrating how to connect to a mySql database on a Linux back end server from a Windows box. | |
Re: ProcessStartInfo probably can't find the executable. I would suggest that you put the full path name to the executable in your exePath variable. const string exePath = "test-min.exe"; | |
Re: > I have read on LockBits method but I dont understand how to use it properly on the picturebox as I am new to C++. Can anyone give me an example on how to go about doing this An example of using LockBits..... // test.cpp // Compile cl /CLR test.cpp … | |
Re: > So can anyone tell me how to find the permission of the file?? #include <unistd.h> #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> int main(int argc, char **argv) { struct stat fileStat; if(stat(argv[1],&fileStat) < 0) return 1; printf("File Permissions: \n"); printf( (S_ISDIR(fileStat.st_mode)) ? "d" : "-"); printf( (fileStat.st_mode & S_IRUSR) ? … | |
Re: > c++ that estimates easter holiday annually? [Here](http://www.hourworld.com/easter.htm) is a link that provides the Easter Sunday algorithm. | |
Re: > is it not the same thing as ioctl?? Well, ioctl is essentially the means for userland to communicate with the kernel. For example Windows uses ioctl-like commands as follows to open the CD tray: #include <windows.h> #include <stdio.h> int main(void) { DWORD bytes = 0; HANDLE HCDrom = CreateFile("\\\\.\\D:",GENERIC_READ,FILE_SHARE_WRITE,0,OPEN_EXISTING,0,0); … | |
Re: Have you considered [memory mapped files](http://blogs.msdn.com/b/salvapatuel/archive/2009/06/08/working-with-memory-mapped-files-in-net-4.aspx)? |