- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 26
- Posts with Upvotes
- 25
- Upvoting Members
- 14
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
159 Posted Topics
Re: I suspect you might be right that it can be done in a single statement, but for myself, I seldom get too fancy if there is a conceptually simpler 'brute force' way to do it, so I always first do a SELECT count(*) type statement to see if the return … | |
Re: The other posters hit on all this,but I'd like to emphasize you need decent libraries to build business or technical applications reasonably easy in C++. This was a problem I faced early on in my C++ work (like 15 years ago), and my solution was to completely ditch the C++ … | |
Re: I did to your code as William suggested and changed your SendMessage(GET_TEXT) to GetWindowText() calls. Much easier. Also, I removed your two global variables. The szClassName only needs to be defined in the proc where the WndClass is registered. Also, there are a half dozen ways to get hInstance anywhere … | |
Re: I'll help, but you've got to learn how to use code tags first. Not too many folks want to look at unformatted code. | |
Re: Spent a lot of time working with that some time ago. Here's a daniweb link... [url]http://www.daniweb.com/forums/thread144510.html[/url] Also, here's a link to some of my tutorials using C, C++ and PowerBASIC where I pretty much take COM memory apart and look close at VTables, VTable pointers, function pointers, calling class member … | |
How can I cause the Paint event to fire from a Form_Click() event? This is what I'm trying to do... [CODE] Public Class StrTests01 Private Sub StrTests01_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click Dim ps As Graphics = Me.CreateGraphics() 'RaiseEvent StrTests01_Paint(sender, ps) End Sub Private Sub StrTests01_Paint(ByVal … | |
| |
Re: Search for Code::Blocks. Also, Microsoft's Visual C++ Compiler comes in a free 'Express' edition. [QUOTE] Also I heard windows 8 will allow us to code in javascript and HTML5 so this is another small question, what is actually the use of c++ if thing can be done using javascript and … | |
Re: [CODE=C++] case WM_CREATE: CreateWindow( TEXT("button"), TEXT("Click"), WS_VISIBLE | WS_CHILD | WS_BORDER, 10, 30, 55, 20, hwnd, (HMENU) 1, NULL, NULL ); break; case WM_COMMAND: if(LOWORD(wParam) == 1) { TCHAR szBuffer[16]; money--; //this has already been declared at 50. _stprintf(szBuffer,_T("%d"),money); MessageBox(hwnd, szBuffer, _T("New money value"), MB_OK); //also tried money.toString() but that … | |
Re: Here is a tutorial that might help... http://www.jose.it-berater.org/smfforum/index.php?topic=3389.0 The first problem I saw in your code is that you foreward declare WinProc, but you named your actual Window Procedure 'WindowProc', and so when you used the term ... wc.lpfnWndProc = WindowProc; ...it was unrecognized by the compiler (it wasn't foreward … | |
I'm passing a this pointer in my constructor initialization list for use by a base class and VC9 gives me this warning about it... main.cpp(124) : warning C4355: 'this' : used in base member initializer list The program runs perfectly as compiled by VC9 Pro or Code::Blocks 10.05. In Code::Blocks … | |
Re: Hello Muel12! I'm with Greywolf in that this is one big project you've chosen. My guess is you are looking at several years work. I'm in a technical speciality field myself, that is, forestry. I write biometric applications. I use both C++ and PowerBASIC. I'd have to say that I … | |
Re: Your basic console mode "Hello, World!" program comes in around 6 K using stdio.h and printf and anywhere between 250 K - 500 K using iostream and std::cout. For these reasons I never use iostream. I do console output with printf. Anyway, iostream isn't particularly useful in GUI. Wide character … | |
This is my first post! I can’t figure out how to modify/cast the return address obtained from the Windows Api function GetProcAddress() without using a typedef. I’m aware that using a typedef is the standard way to do this, but one should be able to do it without a typedef, … | |
Re: I commend you for your interest in Win32 becool. Its how I like to code. You really do have to pay close attention to project setup issues using Visual Studio simply because its so complex and sophisticated. I prsonally prefer using simpler lighter weight tools, but that is simply a … | |
Re: Here is a link to a tutorial I wrote on using ODBC to connect to SQL Server Express, Microsoft Access, And Microsoft Excel.... [url]http://www.jose.it-berater.org/smfforum/index.php?board=378.0[/url] | |
| |
Re: Good one Narue! Except I'd say SetConsoleCursorPosition() is cutting edge avant guard bleeding edge state of the art console mode coding for Windows! | |
Re: I'm someone who uses old software all the time, and it continually amazes me the way most folks rail at old software. I fully realize I'm in the minority in terms of personally having no problems whatsoever with old software, and I've just had to face that, mostly keep my … | |
Re: That's not terribly hard. All you need to do is create a BRUSH of the color you want and select it into the device context in your WM_PAINT handler. I don't think I have a C/C++ example handy, but here is a PowerBASIC example of a WM_PAINT handler where I … | |
Re: What you are asking is somewhat advanced. Data entry in the form of something like a spreadsheet is accomplished through 'grids', which are usually Windows custom controls, although if you are working with .NET there are ones available. Of course, we're talking GUIs here - not console programs. So I'm … | |
Re: Like tonyjv intimated, I don't think its terribly useful to invest time in DOS coding at this point. Having said that however, its possible to create quite a lot of GUI like 'controls' in DOS using the extended asci characters. A lot of us old time DOS coders did that … | |
Re: I don't even know how anyone could ask such a question. The answer is of course not. Visual Basic 4-6 made heavy use of COM and COM components. These components are usable from C++, but the components are binary objects - not code. | |
Could someone familiar with command line compiling using GNU C/C++ Compiler Collection please help me with a Dll creation problem I have? What I would like to know is how to create a Windows Dll out of the following very simple test file that is essentially just a "Hello, World!" … | |
I'm doing command line compiling, and thought there might be some switch that would list starting and finishing time, but couldn't find anything. I'm using Windows, and trying to work with the default gcc/g++ from mingw installed with Code::Blocks. Or is there some way of doing this with some shell … | |
Re: [QUOTE] The first is people who basically use C++ for the object-oriented features of it (grouping data and code, encapsulation, dynamic polymorphism, etc.) but basically stick to C when it comes to the implementation. This includes using (almost) only C constructs (like null-terminated strings and arrays) and mostly C functions … | |
Re: In your CreateWindow() calls for the edit controls, you are not passing the correct HINSTANCE of the app. | |
What is the difference between size_t and size_type? size_type seems to be related closely with the C++ Standard String Class. Couldn't they have just used size_t instead? I don't understand the difference. Could anyone elaborate please? | |
I'm a coder that doesn't know much about hardware, but I have a question that's been bugging me for a long, long time. If I took a pretty new and fast machine (and I'm mostly interested in laptops) such as a recent XP or Win 7 and tried to put … | |
Here is the full code relating to my performance problem I’m having with my operator+= which I described in this adjacent thread…. [url]http://www.daniweb.com/forums/thread340734.html[/url] As a quick review, I’m finding that the operator+= function in the Standard C++ Library’s String Class, i.e., <string>, is performing almost impossibly fast compared to the … | |
Hello Vivayan! Its taken me this long to understand your sophisticated program you gave me using STL (Standard Template Library) iterators, container classes, algorithms, and the works! I’m truly grateful for the time you took to develop this program for me, and it inspired me so much I’ve decided to … | |
I don’t know why my operator += and operator + string class member functions are taking so long to do their job and are so inefficient compared to the Standard C++ Library String Class. Its not that they don’t work; its just that they are slower by a factor of … | |
Re: I agree with Ancient Dragon that its fairly easy to do in Win32 (who would want to disagree with Ancient Dragon anyway?) I call these things 'Custom Controls'. That is perhaps why you can't find any links to this. The term 'widget' is a somewhat 'nix centric expression. In Windows … | |
Is there a way to pre-specify a specific string buffer size for the underlying buffer to which repeated concatenations are going to be made in a loop with the purpose of eliminating time wasting re-allocations and block movements of characters from one buffer to another? I have tried the string::reserve() … | |
I musn't be thinking about something right (or maybe left)! If I have the number '1', which in binary is this... 1000 0000 ...and I do a right shift on it to get this... 0100 0000 then that should give me '2', not??? Then why doesn't this work... [CODE=C++] #include … | |
Re: I've been using ODBC for years. Its the very lowest level Api you can use. I'm pretty sure all other SQL Relational database access technologies are built on top of it. Perhaps ADO isn't; not sure of that. Its platform independent. If you use it on Unix/Linux to access a … | |
Re: Joseph, The best way to deal with a problem of this sort is to open and close the file twice, or reset the file pointer to the beginning after the 1st read. The 1st time you read through the file you don't store anything. Its purpose is simply to find … | |
Re: You can write text strings to any window for which you have its hWnd with TextOut() or DrawText(). For edit controls, i.e., text boxes, you put text in them with SetWindowText().... [CODE=C++] void MessageHandlingProcedure(HWND hWnd) { char szBuffer[]="Some Text To Go In A Text Box"; SetWindowText(hWnd, szBuffer); } [/CODE] If … | |
Re: I don't feel you've given enough information. Are you trying to write a console mode or GUI ( Graphical User Interface ) program? Both are Win32. Console mode programs mostly use the exported functions in Kernel32.lib and GUI programs User32 and GDI. | |
For the past 12 years I've lived in mortal, cowering, abject fear of one particular feature of the Visual Studio 6 C/C++ IDE, and that is the 'Find' feature on the 'Edit' menu where you can fill in the textbox to find a symbol in your file, and then click … | |
Re: Lot of info here too. I prefer base pointer notation in working with VPTRs ant VTables... [url]http://www.jose.it-berater.org/smfforum/index.php?topic=2980.0[/url] | |
Re: To show an additional 'Form' from an Sdk style program you 1st register a class for the form (window) (you'll also need a window procedure specific to that new form's Window Class), call CreateWindowEx() on the new class, and finally, ShowWindow() it. Whether the CreateWindow/ShowWindow calls are in the event … | |
My title says it all! I'm completely mystified by this - have been working at it all day with no resolution. The fundamental assumption under which I am laboring is that when a Dll is loaded into a host's process, the Dll will receive a DLL_PROCESS_ATTACH message. I have been … | |
The memset function declared in memory.h is declared this way... void* memset(void* dest, int c, size_t count); and the MSDN example of its use I have shows this for setting the 1st four bytes of a buffer to a '*'... memset(buffer, '*', 4); The 2nd parameter confuses me a bit … | |
[CODE=C++] #include <stdio.h> int main() { int iBAF=10; int iPlots=14; double dblFactor; dblFactor=iBAF/iPlots; //to get a floating point you need a cast! printf("dblFactor = %10.6f\n",dblFactor); return 0; } /* dblFactor = 0.000000 */ [/CODE] I thought C/C++ would offer a few benifits beyond pure assembler. Apparently I was wrong. | |
Re: I most definitely have a book recommendation for you and that is Charles Petzold's "Programming Windows" books. I most imagine all the book links at the top are about C++ specific issues. Creating GUI Windows programs is not a C++ specific issue as others have said. Even if you choose … | |
Re: That's really easy. A button, as is just about everything else in Windows, is a 'window'; no pun intended. To change the text associated with many windows you use the SetWindowText() Api function, i.e., SetWindowText(hCtl, "Some New Text"); Of course, if you want to change it in response to a … | |
Re: I'll take a shot at it later when I have time Cody. It seems to me you are letting yourself get overly hung up on these resource compiler/dialog issues. I'd move on to other stuff. Personally, I dislike everything to do with dialogs. I make very minimal use of them … | |
Re: Seems to me you should be storing the data in a random access binary file. That way you could seek to the record you want. Or arrange the data in memory in such a structure after reading in the text file and then access it randomly by index or something. | |
Re: [QUOTE] so what else do you want me to explain about classes [/QUOTE] I don't want you to explain one single thing more about classes! Not One!!! What I want you to do is create a class to model a box and calculate its volume. Then instantiate an object of … |
The End.