37 Discussion / Question Topics

Remove Filter
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
591
Member Avatar for Frederick2

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 …

Member Avatar for mike_2000_17
0
279
Member Avatar for Frederick2

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, …

Member Avatar for bitluni
0
5K
Member Avatar for Frederick2

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!" …

Member Avatar for Frederick2
0
691
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
359
Member Avatar for Frederick2

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?

Member Avatar for Frederick2
0
154
Member Avatar for Frederick2

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 …

Member Avatar for jak0b
0
219
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
556
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
181
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
585
Member Avatar for Frederick2

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() …

Member Avatar for Frederick2
0
355
Member Avatar for Frederick2

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 …

Member Avatar for Fbody
0
147
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
202
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
1K
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
643
Member Avatar for Frederick2

[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.

Member Avatar for Fbody
0
356
Member Avatar for Frederick2

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 …

0
63
Member Avatar for Frederick2

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, …

Member Avatar for Frederick2
0
2K
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
514
Member Avatar for Frederick2

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 …

Member Avatar for Fbody
0
148
Member Avatar for Frederick2

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. …

Member Avatar for Frederick2
0
160
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
499
Member Avatar for Frederick2

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++] …

0
62
Member Avatar for Frederick2

[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 …

Member Avatar for Frederick2
0
199
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
301
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
126
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
1
596
Member Avatar for Frederick2

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 …

Member Avatar for Nick Evan
0
263
Member Avatar for Frederick2

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&, …

Member Avatar for Frederick2
0
117
Member Avatar for Frederick2

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 …

Member Avatar for dumrat
0
1K
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
134
Member Avatar for Frederick2

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 …

Member Avatar for ArkM
0
217
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
3K
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
477
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
1K
Member Avatar for Frederick2

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. …

Member Avatar for Frederick2
0
870
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
324

The End.