948 Posted Topics
Re: use the .c_str() conversion for string. It's expecting a const char* argument. [code]vector<string> filenames; filenames.push_back("test.txt"); ifstream inputFile; inputFile.open(filenames[0].c_str(), ios::binary); [/code] | |
Re: Please give some more details about the errors you're getting. What isn't being saved? Is the connection open? Which messagebox is shown? On the surface, your code looks fine. | |
Re: [URL="http://lmgtfy.com/?q=Pseudocode"]Try here[/URL] | |
Re: Show us what you have so far | |
Re: If you can't answer this question yourself, stop now, before it's too late. Alternatively, [URL="http://www.google.com"]Google[/URL] | |
Re: Is this related to what you were asking earlier? If so, you might want to change your project type to managed library (.dll) otherwise you will have the same problem as before. You can always create a test console application to link your DLL into. (Unless this is what you're … | |
Re: [code] int main(int argc, char** argv) { int iteration = 0; while(iteration < 1000000) { foo(); iteration++; } return 0; } [/code] Foo gets called a million times. :) | |
Re: Just change the location of the database in the connection string and make sure that you have enabled remote access on your central database. the next problem becomes authentication. If you are going outside of your domain, you may want to switch to SQL Authentication rather than Windows Integrated authentication. … | |
Re: [URL="http://www.google.co.uk/search?aq=f&sourceid=chrome&ie=UTF-8&q=multithreading+in+C%2B%2B"]Everything you need can be found here[/URL] | |
Re: You should override the WndProc method in your form. Then check for the message. | |
Re: The IDC's aren't actually Strings, they're Integers that have been #defined. So IDC_1 may actually have a value of 6001. You may be better holding a list of controls in a vector and iterating the vector. You can assign your form controls to code controls using [icode]DDX_Control(CDataExchange*, int, Control)[/icode] in … | |
Re: Anything you want to store is recorded in memory and that element has memory allocated to it. You can say that the vector could have 500,000 but that will simply create a 500,000 size vector with the memory allocation as well. Vectors are ideally designed so that they can shrink … | |
Re: [QUOTE=tchiloh;1248300]i try to insert data in database, but i have a problem. example: [CODE]double price = 12,55; mySelectQuery = "INSERT INTO order (total)" + "VALUES (" + price+ ");";[/CODE] now price are 2 values because the ",". now C# see 12 and 55. so a get a error that a … | |
Re: You need to convert from MultiByte to WideChar. Before doing that though, see if there is a CopyItemA method. The A reverts back to the non-Unicode form of the method (and exists for a lot of Microsoft methods) Otherwise, here's some example code. [code] wstringstream sstr; configFile >> serialNumber; size_t … | |
Re: I actually wanted to disable this once for a secure kiosk suite back in my early days of programming. The only way to break out of the application was to Control + Alt + Delete. It was actually possible to block the combination, but it's extremely complicated and will be … | |
Re: May I ask why you need to open a new executable? Please describe the problem as I think your design could be somewhat improved. To answer your original question, you will need to attach the debugger to the new process. This can be done in Tools(or by pressing Control + … | |
Re: You can register for device notifications regardless of whether the device is present. [URL="http://pinvoke.net/default.aspx/user32/RegisterDeviceNotification.html"]RegisterDeviceNotification[/URL] and [URL="http://pinvoke.net/default.aspx/user32/UnregisterDeviceNotification.html"]UnregisterDeviceNotification[/URL] You can issue to the former to receive all the WM_DEVICECHANGE notifications for a specific class guid. The wParam you then need to check for (when you receive the WM_DEVICECHANGE) is DBT_DEVICEARRIVAL, which indicates … | |
Re: I'll admit that I tried re-formatting it and re-posting it, got about a quarter of the way through and gave up. | |
Re: The first error generally means you renamed the service in the code, but didn't update it in the config file. You will need to correct the configuration file or create a new endpoint in the service configuration. If you don't know how to do this, I suggest you Google and … | |
Re: If you know how to loop and you know how to store variables, then I don't see what the problem is apart from laziness... If you don't know how to do either...[URL="http://www.google.com"]Google will help[/URL] | |
Re: Drawing 208 check boxes with GDI will be slow, even on fast machines. The UI operates on a single thread (and hence only a single core even on multi-core machines). Is there any particular reason you need 208 check boxes? I think there's a design problem here. What's is it … | |
Re: Hi, Microsoft SQL Server will store as unicode if the field value type is set to nchar. You might want to find out what encoding Bangle uses. (UTF-8 for example?) To write a connection string, how about checking [url]http://www.connectionstrings.com[/url] :) | |
Re: So basically you just need to print out the entire contents of the array? Of course you can use loops with varying length arrays. Use iterators. | |
Re: There's a couple of options. Adobe has a set of tools that you can use to natively host flash in your Applications. Check the Flashplayer API. Also, if you wish to stick with C# you can use the WebBrowser control to host a frame inside your Windows form. This control … ![]() | |
Re: Your insert statement is incorrectly formed. You need to declare what columns are to be filled before telling it the data. The [URL="http://www.w3schools.com/sql/"]w3Schools[/URL] site will give you a lot of help with SQL Syntax | |
Re: Are you forming the SQL statement in the code or on the database server as a stored procedure? | |
Re: OP: If you're using Microsoft SQL Server, you can use a handy piece of .Net 3.5 functionality called LINQ to SQL. This will handle most, Update/Insert/Select functionality for you. It is in-fact, very, very good. If you're using MySQL or other type of database. Then you will need to find … | |
Re: Firstly, please find an alternative to that monster of an if statement that's just...what o.O If you don't want to change it, please explain what it does. My brain works slowly on a morning ^^ | |
Re: Just thought I'd chip in. For further reading, look into using Overlapped I/O for your sockets. [url]http://support.microsoft.com/kb/181611[/url] [url]http://tangentsoft.net/wskfaq/articles/io-strategies.html[/url] Also, googling will help considerably :) [URL="http://msdn.microsoft.com/en-us/library/aa365198(VS.85).aspx"]Also check I/O Completion Ports for even greater performance[/URL] | |
Re: I assume the error is something along the lines of [icode]error C2664: 'DisplayList' : cannot convert parameter 1 from 'SOME_TYPE * [5]' to 'SOME_TYPE *'[/icode] You need to do one of two things. First, in the declaration of DisplayList, change the parameter type. [icode]DisplayList(SOME_TYPE* list[])[/icode]. Note the extra brackets. Second, … | |
Re: [code] var al = en.Value == null ? String.Empty : en.Value.ToString(); ... if(!String.IsNullOrEmpty(al)) { // Do your stuff } ... [/code] | |
Re: There is a relatively easy solution to this problem which is caused by a misunderstanding of the configuration change for Unicode. Please place all your strings inside a [icode]_T()[/icode] method or prefix them with L _T() is preferred as this will still work if/when you disable Unicode. Eexample: [code] { … | |
Re: Where are you trying to change them from? | |
Re: There are arguments that go on forever and a day about when to use var... Var can be used to signify any object but it will keep that object type once something has been assigned to it, until it falls out of scope. There isn't a problem with using var, … | |
Re: thelamb is correct in his statement. I've modified the code below. [code] class A { public: virtual void func1() {cout << "A: func1" << endl;} void func2() {A::func1();} }; class B: public A { public: void func1() {cout << "B: func1" << endl;} void func3() {A::func2();} };[/code] Personally, I don't … | |
Re: Also, make sure that the database itself is configured to allow them (Often labelled as Unicode) | |
Re: Ok, you will need to look up the SMTP Protocol. [URL="http://tools.ietf.org/html/rfc1123#section-5"]RFC1123 will help you get started[/URL]. Also, please read the other related RFC documents. An SMTP Server is simply a socket server that uses a specific message protocol to authenticate, send and relay mail messages. So if you really want … | |
Re: Not true. In the second if statement you are effectively performing a comparison of the pointer, not the content. The string comparison will, on the other hand, give you a comparison of the content. You could use [icode]std::lexicographical_compare[/icode] to compare a char array though. | |
Re: Well, as the txt file is non-executing, you will need to decide what program you wish to open it with. You can then open the programs using [URL="http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx"]CreateProcess[/URL] using the correct parameters. If your lecturer didn't know how to do this, I would be worried... | |
Re: [icode]while (nl < 2 && getline(cin, text))[/icode] If you don't understand what happens here, you are getting the data that you have just typed in and assigning it to the "text" variable. You will continue to do this while nl is less than 2. So when you type in "Bob" … | |
Re: Behind the scenes what happens is that your code gets to the end of the method and windows shows the form. Effectively, your request to "Hide" is overriden internally. Instead, you should hook the "Shown" event. In this method, you can hide/close the form as normal. Note though, that the … | |
Re: Can you post the code you're having a problem with please? | |
Re: In the interests of debugging, please include a null check before you delete (free) the array's. [code] if(velx) delete [] velx; [/code] If this stops the SIGTRAP then the problem lies somewhere else in your code because the arrays are being assigned NULL for some reason (possibly causing a memory … | |
Re: @DaveTran: When you normalise a vector you set its length to 1. This is a Unit Vector and of course, multiplying it by a number will set it accordingly. So yes, his method is aptly named for what it does. @OP: I think you may want to consider why you'd … | |
Re: [B]Question 1:[/B] Absolutely nothing. Just pick a convention and stick to it. [B]Question 2:[/B] Check the documentation. It will tell you what offset is used for. Probably to offset something... [B]Question 3:[/B] argc is the number of command line arguments received. [icode]char* args[][/icode] is a pointer to an array of … | |
Re: I came across a similar situation before but using OpenGL. Turned out to be the fact that the Viewport remained the same size as the primary window and hence only drew that size into the top left of the secondary window. I don't know if that will help you though. | |
Re: Anuragcoder, do you mind if I ask where you're getting all this source code from? The problems you're having and the questions you're asking don't seem to match with the level of the code you're pasting. First with the syntax highlighting, then with the press enter twice, now with this … | |
Re: Before launching into the code, you need to decide on a protocol by which your client/server will communicate (and I don't just mean TCP or UDP). Which is exactly the question you've just asked in number one. This is something only you can decide and it can be anything you … | |
Re: Microsoft has something called .NET Remoting. I realise this is C++, but the principle behind it is the same. In .NET Remoting, Microsoft make use of TCP and named-pipes, which suggest that both of those are the best way forward for IPC in your application. If you do require .NET … |
The End.