159 Posted Topics
Re: Sometimes when you look at a whole long list like that it seems overwhelming. But instead of being overwhelmed by looking at the whole list, why not start with one very small piece at a time. The first function is this... extern bool isUppercase( char c ); To write the … | |
Re: There are a small number of us that write major Windows applications in various languages using almost exclusively the Win32 Api. All programmers have their own biases, favorite way of doing things, etc. My favorite way of doing things most certainly doesn't suit everybody, but I've got to tell you, … | |
Re: [QUOTE] I've been having some thought, like, if I run a program, and I'm exporting a pointer to a variable "a" to a file, and I reads that information with another program, wouldn't the second program be able to modify "a" in the first program using that pointer? - Like … | |
Re: You havn't allocated any memory at destination into which you can copy what is at source, so you are corrupting your data segment. | |
Re: Another angle pokerDemon is that you are going to have to decide which is more important for you, i.e., learning C++ or learning to code some kind of poker game. If what's most important is being able to code a poker game, and C++ just happens to be the language … | |
Re: debasishgang7, I don't like any of those things you don't like either debasishgang7. I deplore MFC, .NET, any class framework really. However, those things are for folks who want to take the easy way out. Its harder to write Windows programs without a class framework, at least at first. However, … | |
Re: The edit box has to be created with the appropriate style to act as a multi-line text box. Look up the styles - off the top of my head I just don't have them memorized. But if the right style wasn't used at creation time - it just ain't gonna … | |
Re: [QUOTE] Sorry but i must say that's completly wrong. [/QUOTE] I see nothing wrong with... system("PAUSE"); In fact, the default c++ code Dev-C++ produces from its default console template uses it. Are you saying the folks who wrote the Dev-C++ IDE don't know what they are doing? Personally, I usually … | |
Re: Hi Ripture, Here is some code from Dev-C++ that uses a resource file I dug up from a few years back. I just rebuilt the project as C++ (it was C) and it works. The code also has a menu in it where you can go to the File menu … | |
Re: This issue is the biggest problem I have in coding because it takes me a long time to develop the software, and the life expectancy of any specific configuration of OS and hardware is rather low. I'm certainly open to anything new that comes along, but I'm not hopeful. | |
Been meaning to ask that question for a long time. With Visual Studio 6 I seem to recall I had to include iostream.h to use the CString class. Do I have that right? I think I also had to specify in a configuration dialog that I wanted to either link … | |
Re: Its not completely clear from your post whether you want to go the relational database route or the simple flat file route. That's basically the first question you must decide. The techniques involved vary considerable depending on which way you go. | |
Re: It sounds to me Krisny that you've got to parse the file name apart returned from your directory obtaining function and insert the "\\" characters the compiler wants to see in the string you feed into ShellExecute(). Afterall, you said it works if you feed in a correctly specified path, … | |
Not stuck and no real question, which is unusual for me. Just a comment. The 2nd term in a for loop establishes the condition under which the loop terminates. For example, this loop terminates when i increments to 5... for(i=0; i<=5; i++) { ... ... } It'll execute its contents … | |
Re: Last week I had a major run in with that problem. Perhaps check out this link at [url]www.cplusplus.com[/url]... [url]http://www.cplusplus.com/forum/windows/14189/[/url] I know it doesn't sound like a cursor related thread, that was indeed the cause of the problem. I really can't help you with the issue from the standpoint of MFC … | |
Re: Well, if you've created a new C++ project/solution, there should be a Solution Explorer visible somewhere on the screen. I believe there's a 'File View' which can be toggled. When that is selected you should see a Tree View Control that lists the various file types you can include in … | |
Re: That's an interesting idea TalGuy. I havn't written any code to test it, but one thing about arrays is the data is stored sequentially. Perhaps write the function to accept a pointer to the data type and the number of records to process, then pass the starting address for the … | |
Re: Don't know if this will help, but these little fixes cause it to run in CodeBlocks without errors or warnings.... [CODE=C++] // ASCII-getche #include <stdio.h> #include <conio.h> #include <iostream> #include <string> #include <stdlib.h> using namespace std; int main(void) { system ("color 0a"); int c=0; char inp; inp=' '; //Since you … | |
Re: I've been using first eVC++ 3 and now eVC++ 4 for about 10 years. They're certainly absolutely free. There is very, very little difference coding for Win CE and coding Win32. As others have said very well, its good to have a good grasp of C & C++. Then you … | |
I have a general question about threads prompted by something strange I'm seeing in an application I developed involving ODBC access to Microsoft Access and SQL Server databases. Let me present the context of the problem first. I have been developing some tutorials on ODBC database access in two different … | |
Re: Hi yonghc, If you need the exact functionality of the Inkey function as its usually implemented in various BASIC dialects, then you might want to look at the Win32 Console Api. To the best of my limited knowledge, none of the C or C++ libraries provide this exact functionality. It … | |
Re: Sure, buttons are windows. In Windows, everything's a window except those things that aren't windows! You could use SendMessage to the hWnd of the button with the BN_CLICKED notification - I believe - in the LOWRD of wParam. Please check out that part. There are macros to position various 16 … | |
Re: Yea, try this... [CODE=C++] GetFocus The GetFocus function retrieves the handle to the window that has the keyboard focus, if the window is associated with the calling thread's message queue. HWND GetFocus(VOID) Parameters This function has no parameters. Return Values The return value is the handle to the window with … | |
Re: Worked on that big time a few years back. What I specifically wanted to do was see if I could use printf from the msvcrt.dll in a GUI process. I expect WriteConsole would be easy, but I wanted printf, and that's trickier than h***. And to make matters worse, I … | |
Re: According to marco93 there are piles of tutorials out there already on ODBC. If you do a search on ODBC (Open Database Connectivity) you'll find hundreds of links. So the answer is emphatically YES. I was going to post a tutorial on it too but I won't bother now. See... … | |
Is there a link somewhere that explains how to post tutorials? I have one I'd like to post (it shows how to use direct ODBC for enumerating ODBC drivers, connecting to Excel, Access, and SQL Server Express), and don't know how to do it. Would it need to be reviewed … | |
Re: It'll take exactly 10,000 hours. That's what this article says, if my memory serves... [url]http://money.cnn.com/magazines/fortune/fortune_archive/2006/10/30/8391794/index.htm[/url] Hardest thing I ever tried to do was learn how to pick a five string banjo. With that, you've got three fingers, and five strings. The notes sound really sharp and fast, and if you … | |
Only have Visual Studio 2008 about a week but just ran into something inexplicable to me. This include file (and others like it)... [CODE=C++] //DoTestData.h #ifndef DOTESTDATA_H #define DOTESTDATA_H unsigned int iCreateDB(TCHAR*); unsigned int blnMakeTable(SQL&); int GetRecordCount(SQL&, unsigned int&); unsigned int blnInsert(SQL&, TCHAR**, unsigned int&, HWND, int); unsigned int blnDumpData(SQL&, … | |
Re: These types of issues fall under the canopy of 'Windows Synchronization Objects' and lead into such topics as Mutexes (Mutual Exclusion Synchronization Objects) and semiphores. In the program I posted yesterday there was a very simplistic method of not allowing the user to launch additionl threads until the one underway … | |
Re: Yes, Seakayaker, you need another thread for that. I'll list all the code for a small program below that should show all the ingredients in a GUI example. The context for this particular program is that I wanted to add a button to one of my Windows CE data collector … | |
Re: Just a couple weeks ago I added some code to one of my Windows CE data recorder programs that my organization uses, and what the 'add on' does is record Gps satellite latitude & longitude readings into a data file. The program itself is for recording field data on trees. … | |
Re: Sounds like you should create a struct to contain all the globals and simply pass the address of the struct variable. If the struct definition is in a header file included where need be you would be able to use it that way. Globals can always be eliminated. Something to … | |
Re: The bad news is that GUI programming (graphical user interface, i.e., program appears in a window - not output to a console screen) is very different from console mode programming. If you are just starting out it would be a good idea to stick with the console for awhile. To … | |
Re: [QUOTE] However, there are a couple of books that describe how vtables typically work internally, given the full understanding that exact details will vary from compiler to compiler. In my experience, knowing the ways polymorphism can be implemented will help solidify your understanding of the big picture and give you … | |
Re: This whole thing is a literal string.... "INSERT INTO characters(Name, CID, Age, Char_Strength, Char_Speed, Char_Endurance, Char_Aim, Char_RunningEndurance, Blackmarket, Business, Electronics, Food, Misc, Money, Inventory_room, Model, Title) VALUES ('Test Name', '45264', 20,'20','20','20','20','20','1','1','1','1','1',599,500,'lol','Lol')" It is a SQL Insert statement. If you want to get the value held in the string variable 'Test' … | |
Re: If I were to code something like that I'd have two window classes registered, i.e., a main program window that in your case apparently has the button on it, and a display/output/status window that appears when the button is clicked and is perhaps closed by the user ( [X] ) … | |
Re: Can't imagine why you are using GetDC(), ReleaseDC() in WM_PAINT. That isn't done. There is no reason whatsoever to do that. | |
Re: Microsoft Excel is an out of process COM server and COM interfaces can be used to read/write anything from it or out of it. In a pinch I'd use ODBC direct and connect to the Microsoft Jet Database Engine. I don't believe many people know this but the aformentioned can … | |
Re: These three items you mention refer to three distinct stages in the creation of a window using the low level Windows Api (the best way to program Windows in my opinion). Before you can create a window you fill out all the fields of a WNDCLASSEX structure. This... WindowClass.style = … | |
Re: Hello Nihan1, Below (if it all fits) is a C console program that uses direct ODBC function calls to create an Access Database in whatever directory you run the executable from, it then creates a table in the database, adds some data to it, then dumps the data to the … | |
I can't figure out for the life of me how to import a class declared, defined and implemented within a dll into a host app using any GNU build systems. The two compiler suites I have are Dev C++ and the newer Code::Blocks. I have no problem with this using … | |
Re: When a Sdk type Api program starts, one of the first (not the first, but one of the first) messages your main window will receive is the WM_CREATE message. In the message handler for that message you can create additional child windows of the main form/dialog/window such as buttons, listboxes, … | |
Just downloaded VC++ 8.0 Express and tried to run a simple sdk style program to see what happens. I've been using Dev C++, CodeBlocks, and MS VC++ 6. I've been advised to get up to date. Anyway, to get the program to run I had to change all the Api … | |
Re: Here's an old program I dug up that puts text in a edit control when you click the button. Boy, its horrible code, but runs. [CODE=C++] #include <windows.h> #include <stdio.h> #include <string.h> HWND hMainWnd; HINSTANCE ghIns; UINT iStyle=WS_CHILD|WS_VISIBLE; HWND hTxtBox; char szText[50]; LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, … | |
Re: What platform are you working with Orwell84? Windows, Linux, ??? If Windows, then you either need to learn the Windows Api, or adopt some Windows Application Framework such as MFC, .NET, etc. For myself, I just about strictly use the Windows Api directly for Windows programming. For Linux I dabble … | |
Have you ever had a problem where you are completely dumbfounded? Staring at the output of a program and saying this is impossible? Sort of like… int a =5; printf(“a=%d\n”,a); Output: A=6 Well, I’d appreciate if someone would take a look at this simple program below which creates a class … | |
Re: if its not in a class look at memset(). That will set any range of bytes (if they are in your process) to whatever you want. For example, if you've got a thousand doubles and you want that memory all set to nulls, you would call the function with the … | |
I’m trying to learn how to use C++ templates, and I thought I was grasping it all ok until I decided to try to pass a template defined object variable as a function parameter. Having all kinds of troubles with that. I’m using a typical example of a parameterizd array … | |
Re: If you are going to be doing much work with console screens (DOS screens some people refer to them, but that isn't right) you need to become familiar with the Win32console functions. | |
Been studying COM for some time now and for the life of me I can't find out how some of these standard interfaces such as IID_IConnectionPointContainer, IID_IConnectionPoint, etc., are actually defined. I can pass these IIDs in QueryInterface() calls and successfully retrieve pointers to them, so they must be actually … |
The End.