37 Discussion / Question Topics
Remove Filter 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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
Will an int in C/C++ now be 8 bytes instead of 4? printf("sizeof(int) = %u\n", sizeof(int)); sizeof(int) = 8 In DOS it was 2 afterrall. And what about doubles? Will they be 16 bytes? Maybe call them 'fourples'... I really don't know. Me and my employeer are stuck in 32 … | |
Been studying what I thought was a fairly authoritative article about BSTRs by Bruce McKinney... [url]http://www.ecs.syr.edu/faculty/fawcett/handouts/cse775/Presentations/BruceMcKinneyPapers/COMstrings.htm[/url] where he states that the four bytes before the start of the BSTR contains the string's length. Here is the exact quote... [QUOTE] What Is a BSTR? The BSTR type is actually a typedef, … | |
This is one mean function! I've tried everything I can think of. I registered a type library with LoadTypeLibEx() which is a really easy function to use. I mistakingly thought UnregisterTypeLib() would be routine. Its most decidedly not! The error I keep getting with FormatMessage() is... Error accessing the OLE … | |
Recently I've been looking into BSTRs, and have found how 'touchy' they can be. I saw this in a COM class in the class destructor regarding a m_strBStr member... [CODE] if(m_strBStr) SysFreeString(m_strBStr); [/CODE] When I saw it I thought, "How would the BSTR have a zero assigned to it?", because … | |
Does anyone know if there are any issues in using the basic ODBC Api for database access on 64 bit Windows Vista/7 systems? This has been my preferred database access technology for a long time, and I'd prefer not moving to ADO or something else if I don't have to. … | |
It seems even if I place #define _CRT_SECURE_NO_WARNINGS at the top of my C++ source files, if the warning level is set to 3 or 4 I still get all the warnings. Is this the way it is supposed to be? I like to have my warning levels set fairly … | |
This is my first VB.NET post as I'm mainly a C/C++ and PowerBASIC developer. I'm trying to figure out how to pass a struct like so as a function parameter to/from a C/C++ or PowerBASIC dll using PInvoke of course in VB.NET. The struct in C looks like this... [CODE=C++] … | |
[CODE=C++] /* I'm stuck! Here is what I consider to be a perfectly running program that uses an array ( TArray ) template to hold arrays of objects. Its just about your classic text book example. Its pretty well stripped down to nothing to illustrate my problem. I simply don't … | |
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 … | |
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 … | |
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 … | |
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 … | |
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&, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
I have not been able to obtain an answer to this question anywhere (including here) so I’ll ask it again. I can understand that folks don’t want to wade through hundreds of lines of code looking for someone else’s bug, so I’ve worked very hard to produce the very smallest … | |
I am trying to understand COM memory layout and using C++ classes just confuses me. In general I understand what is going on with the double indirection of function pointers but as so often is the case in programming one must understand the ugly details – not just the generalities. … | |
Just decided to try the new Code::Blocks IDE on an old ODBC program of mine that I had always compiled as a C program. I decided to redo it as a C++ program and immediately hit a nasty problem that I never ran into in C. It involves a Typedef … |
The End.