34 Discussion / Question Topics

Remove Filter
Member Avatar for kux

ok, I've checked the forum and I don't think this topic was touched. What I would need is an open-source or at least free static analysis tool for C++ code. Does anybody have any suggestions? I mean, searching the web C++ lacks A LOT at this chapter, compared to Java, …

Member Avatar for IssamLahlali
0
255
Member Avatar for kux

if u pass a std::vector by value to a function, does all of it's content get copyed? thx

Member Avatar for kunal kislay
0
2K
Member Avatar for kux

take a look at this code: [CODE] template <class T> class C { public: class A { protected: int x; }; class B: public A { protected: void write() { cout << x << endl; } }; }; [/CODE] when I try to compile with g++ i get: test.cpp: In …

Member Avatar for kux
0
144
Member Avatar for kux

ok, so visual C++ is not C99 compliant, but I was wondering how can I access fixed bit length integer types as the one defined in stdint.h (intN_t). thx in advance

Member Avatar for ArkM
0
117
Member Avatar for kux

I have a document/view aplication that opens a bitmap I use the following OnDraw override to draw the bitmap on a window and OnOpenDocument to opening the image from file The bitmap handle ( HBITMAP bmaphandle ) is taken from the Document object that does LoadImage in it's OnOpenDocument method …

Member Avatar for kux
0
175
Member Avatar for kux

ok, long story make it short I have a quite large project, a makefile and gnu make. All runs fine. Trying to port the project to windows, and building with mingw32-make I come accross some problems... One of it is that i can't use sed for automatic dependeny generation as …

0
89
Member Avatar for kux

ok, I tried to do some reasearch first, but haven't really found what I was looking for. Each windows app uses a message queue that stores user input and calls the required event handler ( a simple way of putting it ... ). What I was thinking is that has …

Member Avatar for Ancient Dragon
0
116
Member Avatar for kux

Compile this code with MSVC2005 [CODE] unsigned short x = 20; unsigned short y = 20; for ( unsigned long i = 0; i < x * y ; i++ ) { cout<<i<<endl; } [/CODE] and u get warning C4018: '<' : signed/unsigned mismatch why? i mean, it all runs …

Member Avatar for kux
0
133
Member Avatar for kux

I came accross a strange thing, maybe it's stupid, or I don't have the knowledge of how linking actually works... I have a project that builds in a static lib, and anoter project that builds in an exe and links to the static lib. Compiled with MSVC 2005, all works …

Member Avatar for ArkM
0
108
Member Avatar for kux

This may sound silly. I have a class that contains a vector of pointers to instantiated objects. I want to return a refrence to that vector, but I don't want to be able to modify the vector through that refrence. Now, if i return a const reference, the vector is …

Member Avatar for dougy83
0
113
Member Avatar for kux

This is cited from Stroustrup third edition [CODE] void f () throw (x2 , x3 ) { // stuff } is equivalent to: void f () try { // stuff } catch (x2) {throw; } / / rethrow catch (x3) {throw; } / / rethrow catch (...) { std: :unexpected() …

Member Avatar for kux
0
107
Member Avatar for kux

I've been searching for a memory leak detection tool for windows, something similar to valgrind under Linux, but all tools that i find cost, or just have free trials. Does anyone know a FREE memory leak detection tool for windows ?

Member Avatar for Kob0724
0
186
Member Avatar for kux

first model: [CODE] class MyException { string message; public: MyException( string msg ): message( msg ) {}; void printmsg() { cout<< message <<endl<<endl; } }; void willthrow() { throw MyException("mk"); } int main(int argc, char * argv[]) { try { willthrow(); } catch( MyException &ex) { ex.printmsg(); } } [/CODE] …

Member Avatar for ArkM
0
110
Member Avatar for kux

I try to create a generic binary tree class but when i try to define an inserting function I get these compilation errors error C2072: 'Btree<T>::recins' : initialization of a function error C2143: syntax error : missing ';' before '*' c:\documents and settings\kux\my documents\visual studio 2005\projects\btrees\btrees\btree.h 54 Error 6 error …

Member Avatar for ArkM
0
749
Member Avatar for kux

What i want to do is write some of the rows of a report style CListCtrl with a color and other rows with another color, but if I switch the color with SetTextColor the color of the text in the entire control switches, i want it to switch just for …

Member Avatar for mitrmkar
0
156
Member Avatar for kux

hello Is there any way of getting the selected date in a CDateTimeCtrl in a CString or char* or anyting? thx in advance

Member Avatar for mitrmkar
0
99
Member Avatar for kux

I understand that visual studio has a nmake tool for building a project from a makefile. What I want to do is to be able to build my project outside the Visual Studio IDE, from command line using nmake. I found some tutorials about writing a windows makefile for nmake, …

Member Avatar for Prabakar
0
404
Member Avatar for kux

I have a project that builds in a static library, using visual studio 2005 When I build it in debug mode it all goes fine, but when I build it in release i get the following error: Error 2 error C3861: '_SCL_SECURE_VALIData': identifier not found in file xtree I disabled …

0
81
Member Avatar for kux

Hello, I have a CListCtrl and a button to modify the selected row in the CListCtrl. My problem is that my list has several columns and I want to be able to select a row by clicking on any column of the row that I want selected. Now I can …

Member Avatar for Aashath
0
1K
Member Avatar for kux

what method is to be used to get the selected row in a CListCtrl ? i tryed GetCount() but it returnes the number of selected items i searched the method list, but found no GetRow() or something thx in advance

Member Avatar for Ancient Dragon
0
241
Member Avatar for kux

I need some guidance in a little project. I want to make a Document/View project that opens some planing files. I want the view for this files to be something like an excel sheet so you can modify the values of some fields and then be able to call some …

Member Avatar for Ancient Dragon
0
297
Member Avatar for kux

I have a vector<classType> vect in order to call sort( vect.begin(), vect.end() ), what needs implemented in the class classType? I have the overloaded operator< and a copy constructor, but the problem i get is that some member variables of classType that are pointers dereferenciate during the call to the …

Member Avatar for Duoas
0
117
Member Avatar for kux

I have a function that recives as one of the parameters a function pointer. If i want to pass a class method as that function, how do I do it? I tryed like this: [code] class C { public: SetVector( vector<UTF16> ); }; //function prototype void function( const string sToPlace, …

Member Avatar for Duoas
0
89
Member Avatar for kux

hello, I have the following problem I have an unsigned long variable, but it is designed to hold values within 0 .. 100 ( I know an unsigned char would have been enough, but i have to use an unsigned long ). I have to write that value in a …

Member Avatar for Salem
0
195
Member Avatar for kux

I just started using Eclipse for developing C++ projects. I wanna ask u guys if u know any good forums for posting regarding this IDE, or if some of u guys arround here use it also, so I know if it would make sense to post arround here or not. …

0
71
Member Avatar for kux

plz take a look at the following code [CODE] #include <iostream> #include <string> #include <iostream> #include <string> using namespace std; class A { public: string sa; A(string sia); }; class B:public A { public: string sb; B(string sia, string sib); }; A::A(string sia):sa(sia) { } B::B( string sia, string sib):A(sia),sb(sib) …

Member Avatar for Agni
0
263
Member Avatar for kux

i have a ifstream m_ifsInput variable and I try to open a file like this: m_ifsInput.open( sFileName.c_str() ); where sFileName is a std::wstring variable the error i get when compiling with g++ no matching function for call to ‘std::basic_ifstream<char, std::char_traits<char> >::open(const wchar_t*)’ the thing is the same thing compiles well …

Member Avatar for Narue
0
219
Member Avatar for kux

using visual studio 2005 this is the problem: say i have a solution with 3 projects: first - has some usefull utils functions and i build it as a static library second - a project that uses the utils. I link with the first and build as a static library …

Member Avatar for mitrmkar
0
82
Member Avatar for kux

hello, does anyone know if I can write a macro that takes a number as argument and according to that number declares a variable number of functions ? ex: DEFINE_FUNC( 4 ); is replaced with void func_1(); void func_2(); void func_3(); void func_4(); thx

Member Avatar for vijayan121
0
185
Member Avatar for kux

i have a problem... i wanna make a function that takes a string as input splits it, storing the resulting strings in a vector<string> and then sort it [CODE] #include <iostream> #include <vector> #include <iterator> #include <sstream> using namespace std; vector<string> split( const string &sInput ) { istringstream is( sInput …

Member Avatar for kux
0
170
Member Avatar for kux

As i knew the <stdarg.h> header should have the following function int vfscanf(FILE *stream, const char *format, va_list ap); but under Visual Studio 2005, after including the header and calling the function i get 'vfscanf': identifier not found if the function is not declared, can u tell me some simmilar …

Member Avatar for WaltP
0
157
Member Avatar for kux

i noticed that when u compile with visual C++ u don't need the throw statement in function headers, but when u compile with g++ u need to explicitly mention all the exceptions u're function might throw. i mean: [code] void functionx() throw ( exception1 , exception 2) { //blabla throw …

Member Avatar for kux
0
159
Member Avatar for kux

ok, i have a question say i have a class that wraps all file accesing functions ( basicly opening, reading and closing ) all these file handling functions throw a FileException exception i have a try block in that i open, read and close my file using the above mentioned …

Member Avatar for kux
0
109
Member Avatar for kux

here is the thing: i have a constructor that calls a member function, the function throws an exception, i catch the exception in the constructor, free all dynamic allocated variables and then rethrow the exception when i rethrow i get this: Unhandled exception at 0x10210e32 (msvcr80d.dll) in Test.exe: 0xC0000005: Access …

Member Avatar for kux
0
225

The End.