432 Posted Topics
Re: This is a very simple question you might have easily looked up from a search engine you might consider that next time ;) http://msdn.microsoft.com/en-us/library/s3f49ktz(v=vs.71).aspx (edit) for the record the term is "Byte" as opposed to "Bite". (edit2) it also might vary on how many bytes are actually used, depending on … | |
Seemingly, bitmap resources within my file are becoming somehow corrupted. My code has resource bitmap image, when ran, it searches the screen for that image and returns its xy location. Runs fine and works fine at least once, and sometimes more, but then fails to find the image. When I … | |
Re: I'm not sure you can use char in switch condition. But if you could it would look like this. char pick; cin >> pick; if(pick == 'a' || pick == 'A') stuff inside here //For case switch... can you do the following: switch(pick) { case 'a': case 'A': stuff here; … | |
Sorry for posing here, but i could not find a suitable section. I am a bit worried about my private data from projects on the internet. I will just explain my worries. In cpanel I have file manager, from file manager I select a folder then a file, I set … | |
Re: What would happen if I were to type "five" for the year I was born? | |
Hi I'm hoping to get some starting points here in a subject that scares me, RegExp. I've looked at a couple of tutorials but they all seem to be based on std::string. I'd like to use std::tr1::regex but I don't know where to start or even if it's possible without … | |
I am getting results from a routine which are unexpected from me. here is athe code. void MyTestFunc(){ u_char MyTest_u_char[10] = {'a','b','c','d','e','f','g','h','i','j'}; u_char * MyTest_u_char2 = new u_char[8]; memcpy(MyTest_u_char2,&MyTest_u_char[1],sizeof(u_char)*8); int raw_len = sizeof(MyTest_u_char2) + 1; string std_str(MyTest_u_char2, MyTest_u_char2 + raw_len); cout << std_str << endl; // expecting bcdefghi . getting … | |
Re: Could you not just split the string using a space as delimiter? | |
Just wondering what general thoughts there are regarding the pros and cons of `using namespace NameSpace;` vs `NameSpace::Method` Such as, are there any performance gains with one or the other etc...? | |
Re: I think this member is wanting advice on how to insert a string/char* between two other specified strings/char*. For example he reads a html file looks for first string "<div>" if found, looks for it's closing tag "</div>", or other specified string Then insert between those tags/strings outputting "<div>some string</div>" | |
Re: In vs2010 there is an option for pre compiled headers under console applications, try ticking the box. | |
Re: Looks like a homework assignment. It is expected of members to at least try to code something themselves before asking for help. You do that, and you will find a lot of very knowledgable and helpful members willing to help you. | |
Re: Try modifying line 26 inputFile.open("prog1.txt", ifstream::in); (edit) I know this was marked as solved, but in lieu of the OP providing a solution I thought I'd try to provide one for reference. | |
Re: That appears to be a prototype for a function, at least in the context of there being no other evidence to the contrary. float **scores looks like a pointer to a pointer to a float value. Without anything else, there is not much to say about it. | |
Re: > Shorter's not always better. I keep telling that to my husband, but he says I don't know what I'm talking about. | |
Re: > The Chef needs to pick 2 horses Is he cooking them, or making a wager? Sorry. | |
Re: You could get started with [ShellExecute](http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx) API function. Assuming you are working with Windows* | |
Re: Pass the array to a function, and its length of course. pseudo func code: unsigned returnval = 9999999999999; // or the highest value you expect for(unsigned i = 0; i < len; i++){ if(array element i is greater than returnval){ continue the loop } else make returnval equal to array … | |
Hi, I'm hoping someone might be able to help me with what I think might be a simple problem. I have came across the need to add to an unsigned char array a literal single quote "'" My question is how can I achieve that? unsigned char uArray[4]; uArray[0] = … | |
Re: I'm quite sure that the people who help others here do not complete another persons homework for them. I suggest you post what you have tried, with a little explanation of it. | |
Hi, I wonder if anyone can direct me to a win32 API or offer some logic as to how I might copy memory to a specific location in an array. What I am doing at the moment is copying an unsigned int into an unsigned char[]. The reason is to … | |
I have been trying in vain to pass an array to a thread and have that thread loop through it. Here is code of a simple thread passing an int to it. #include "stdafx.h" #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <iostream> DWORD ThreadProc (LPVOID lpdwThreadParam ); int threadnumber = … | |
I'm trying to split an array which is that of unsigned char where NULL marks the split point I have written this code, but it just looks clunky, and I would like to ask advice on any other more efficient methods of doing such a thing there might be. #include … | |
If I mouse over the following link, I get a thumbnail image appear of the content at link address. http://msdn.microsoft.com/en-us/library/ms683196%28v=vs.85%29.aspx How do they do that? I'm quite the novice at web development but really intrigued by this. | |
Hi I'm wondering if there is a simple win32 API to retrieve the current module filename (xxxx.exe) I know about GetModuleFilename which gets the full path. And I have read that argv[0] holds the exe name, but that also give me the full path. What I'm after is an API … | |
I do apologise for not knowing a single thing about JavaScript. I am under the impression that I can have a code to handle events in a webpage header. I am specicically reffering to Internet Explorer Browser. My goal it to capture and handle the event BeforeNavigate2. I would be … | |
I'm currently concantenating an array like so... int _tmain(int argc, _TCHAR* argv[]) { //create buffer to receive path WCHAR pathbuf[MAX_PATH]; //get path into buffer DWORD pathlen = GetCurrentDirectoryW(MAX_PATH,pathbuf); //append file name to buffer pathbuf[pathlen++] = '\'; pathbuf[pathlen++] = 'f'; pathbuf[pathlen++] = 'i'; pathbuf[pathlen++] = 'l'; pathbuf[pathlen++] = 'e'; pathbuf[pathlen++] = … | |
Whenever I create some small tool in c++ dll for use with another language, a new user always has to download the microsoft redistributable package and install it. Is there anyway to add the resources needed from the redist, to my dll? How even do you know what resources it … | |
I am downloading content from a web source using URLDownloadToFile winapi function All is well, with that, the content is downloaded to the correct path. My probems start when I try to read it, like below, the loop never exits. myReadFile.open(sFile); if (myReadFile.is_open()) { while (!myReadFile.eof()) { //code; } } … | |
I'm having trouble with getpixel function. Sometimes it returns the correct pixel ref and others it returns "4294967295" which I think is "CLR_INVALID" COLORREF color; HDC hdc_ = GetDC(NULL); //get dc of whole screen color = GetPixel(hdc_, 10, 10); std::cout << color << endl; That is the simple code, any … | |
Re: This seems like such a simple and basic code to write on the face of it, it's hard to understand what exactly you are having trouble with. Please provide your attempt. | |
Have a situation with my code, where it appears the stringstream object is not being cleared. Here is my code, this code will set an interprocess shared variable, The code is simplified to illustrate my problem, and all other variables are there to aid in that, for instance, the ints … | |
Re: Well since only half of the code is there it's difficult to tell. My guess is that this is a function called from you menu function. If so, it may be as simple as replacing [ICODE]if (FinishTime == "q") { menu(); }[/ICODE] with [ICODE]if (FinishTime == "q") { return NULL; … | |
Re: That is an odd one. What I would do is try opening files the same name but with one character changed. To see where the problem lies, and if something needs escaping. That is of course, if it's the filename that is the problem and not the file itself. | |
From what I have read, command line arguments are only char* separated by space. However feel compelled to ask if anyone knows of a way to get a pointer across to an executable in any fashion? The goal is to pass int *pointers for reasons of inter process communication across … | |
Re: There are many many books available, but for me it was web based, and still is. i just look up a keyword or function on msdn. There are also tutorial websites, infact too many to list, but, here is one I notice a lot [url]http://www.learncpp.com/[/url] | |
I got a warning from vs2010 at compile time (C4172 returning local variable or temp) [CODE] int foo(){ int* bar = Bar() } int* Bar(){ int array[2]; array[0] = 1; array[1] = 2; return array; } [/CODE] if I understand the reason for this correctly, that the array 'array' in … | |
Hi all, hope you are well. I'm having some trouble trying to convert the literal value of a hex number to int. I say literal but I'm not sure if that is the correct term, but my code will explain better I hope. I have simplified the code down to … | |
Hi I have a function I use in a win32 dll which downloads the source of a web page to file. The primary windows function used in it is "URLDownloadToFile" in "urlmon.h" But I would like to have a function that downloads directly to a string or char array. I … | |
First I hope this is in the correct location, I apologize if it is not. [B]Here is what I'm talking about[/B] When a browser, or indeed windows crashes, or power is lost to computer after a restart of computer or application, the browser offers to restore your pages from the … | |
Re: 1) That area is called the Browser control. The client area begins below the menubar. 2) I know little about javascript, but you can get its reletive coordinates from other languages such as C++, and C#. 3) Not sure, I just see them as GUIs and look on msdn (I … | |
How can I get a new line in messagebox? I have two TCHAR arrays, I can print both to separate MB but not both to one This is what I'm looking for (if you can understand what I'm trying) It obviously does not work. [CODE]TCHAR one[] = _T("file\\path\\here"); TCHAR two[] … | |
Re: Because "answer" is only assigned a value under a condition. If that condition is not met, you still try to use its value later. You can avoid it by initially assigning it a value to begin with. | |
I am trying to compare a string literal with a string downloaded from a webpage. Here is my code. [CODE]using System; using System.Collections.Generic; using System.Text; namespace testsource { class Program { static void Main(string[] args) { string source = getPageSource(@"http://www.mywebsite.co.uk/index.php"); string fromsource = source; Console.WriteLine(fromsource); //Displays Text Here in console … | |
Hi Can anyone help me with path variables. My problem is a referenced a dll file as part of my project, and in the reference properties it has "C:\users\susan\desktop\project1\xfind.dll" as its path I tried removing it, and adding its reference to the windows system dir but it just goes back … | |
I'm trying to use a variable as a case condition, however it seems you cannot, as the error I get is "constant expected" I'm wondering if there is a way to work around this limitation? my variable is a string. | |
I've been working on a project for a while, which for my convenience is a console app. The time is nearing where I will be needing to add forms to it, so what I'm after here is any advice on things to consider and look out for, before I do … | |
Re: Out of curiosity, who told you what you have to do with your application? | |
So here I am back again with my tail between my legs. I've spent the whole day trying to update my form lable during runtime. I got there in the end with what I think is threadsafe, then only to spend a few more hours trying do it from outside … | |
I;m not a great fan of title bars on windows forms, so I've removed it. However I'm looking for a way for the end user to drag it to wherever they choose. Is there a way in the .Net framework? All my searches resulted in importing user32.dll, but the majority … |
The End.