Answer Questions
Ken Grissom Upcasting/Downcasting name jargon
Well I am a little confused with naming jargon of casting. My intended goal was: CBase* pBase = static_cast (derived); What is it called upcasting/downcasting I guess what we are doing is casting a pointer from Dervied Class to Base one so we are moving up in hierachy. Should It not be called upcasting . and There are many articles where it is called upcasting like for example: http://www.codeproject.com/managedcpp/castingbasics.asp ...Show All
Bhangrababe WinNT.h generating compiling errors
Hi, I've been trying to compile a small piece of code but I always get an error which seems to come from WinNT.h (line 222). The error is "error C2146: syntax error : missing ';' before identifier 'PVOID64'" and it generates other errors like " error C4430: missing type specifier - int assumed. Note: C++ does not support default-int". The line says: typedef void * POINTER_64 PVOID64; I'm currently using Visual Studio 2005 ...Show All
howardtr How to disable support for C99 extensions / force compatability with C89?
Hello, I'm working on a school project that requires use of C89 and does not allow use of any C99 or non-standard language extensions. I'm a C++ programmer that is just learning the differences in C, so I would like to just have this enforced by the compiler. As such, is it possible to disable support for the C99 extensions on the compiler I'm using whidbey beta 2. Thanks, Byron Visual C++ ...Show All
inbarik allocating native pointer from managed clas
guys, i have a native struct in a native dll. and in a managed c++ dll i make a pointer to that struct as follows NVector3 *v; and in the managed class constructor i create the pointer like so: v = new NVector3(); it compiles fine. now i create a c# app. and it uses the managed class i did. and i create an object from the class in managed c++ dll. and that compiles fine too. but at runtime, i get a stackoverflow exc ...Show All
Alex Filo directory exists // create
Looking for easy way to check if a directory exist and otherwise to create it Ok than, I look a bit further cause the call needs 2 arguments, a construction like this works LPSECURITY_ATTRIBUTES attr; attr = NULL; CreateDirectory("media/Saartje",attr) ; But, how do I check if one already exists Hello, The MSDN page for SHCreateDirectoryEx has this note: Note This function is available through Microsoft Windows XP Service ...Show All
tkunohim Environment Setup Help please....Urgent....
Hi, I have a project that project setting is as following: !IF "$(CFG)" == "DesignTool - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir ".\Release" # PROP BASE Intermediate_Dir ".\Release" # PROP BASE Target_Dir "." # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir ".\Release" # PROP Intermediate_Dir ".\Release" # PROP ...Show All
Balu Chaturvedula stringstream causes memory link VC++ 2005?
This simple program seems to leak LOTS of memory when compiled in VC++ 2005: int _tmain( int argc, _TCHAR* argv[]) { for ( int i = 0; i < 100000; ++i) { ::Sleep(1); std::basic_stringstream<TCHAR> str; str << _T( "Current iteration: " ) << i; } return 0; } CRT: Multi-threaded debug or Multi-threaded I compiled and ran the same piece of code in VC++ 2003 and I don't see ANY leaks! Any ideas ...Show All
LadyASPX Help with an error message please
Hi, I was just wondering if anyone could give any advice about how to get rid of the following error message I have: fatal error C1034: signal.h: no include path set. I have tried the following: Tools-Options-Directories-Show Directories for-Include Files-Directories-Enter Path but according to this, the include path is fine. Thanks Alan If the file is on your machine then you canjust use the /I compi ...Show All
MoGram HELP! - Converting Data Type and Writing File Problem
I want ot open a file, getting the username from a label, and write to it. Simple No. It always errors whaever I do. I have looked at the documentation but that provides no answers. This code: FILE *stream; errno_t err; err = fopen_s( &stream, label5->Text, "w" ); fclose(stream); but it errors: error C2664: 'fopen_s' : cannot convert parameter 2 from 'System::Windows::Forms::Label ^' to 'const char *' No user-defined-conversion ope ...Show All
thegrinch Can some one help me to convert to VB...
'// write data stream into 'void WriteBits(BYTE* p_buff, int pos, int len, unsigned long value) '{ ' int start_byte, end_byte; ' int start_bit, end_bit; ' int byte_pos; ' BYTE width_mask, or_mask, and_mask; ' BYTE byte_value; ' ' start_byte = pos / 8; ' start_bit = pos % 8; ' start_bit = 7 - start_bit; ' ...Show All
Peter Schmitz resources and dll's
Hi I have a windows component written in c and I am loading a custom mouse cursor like mouse_cursor = (HCURSOR) LoadImage(GetModuleHandle(0), MAKEINTRESOURCE(IDC_ZOOM_CURSOR), IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE); SetCursor(mouse_cursor); This works fine when I compile the control and a function to test the control into a executable. However when I compile the control as a separate dll and try to test that ...Show All
Bobby Fu NULL STL string exception with 2005
The following code properly throws an exception that is caught in the "catch(...)" below on Visual C++ version 6.0 and Visual C++ 2003. However, an exception is thrown that is not caught and a CRASH occurs on version 2005 of Visual C++. This seems like an extremely serious bug to me. Does anyone know: 1.) Is this a confirmed bug by Microsoft 2.) Is there a safe way around it. By "safe" I do not mean "just don't ...Show All
elargento MFC 8.0 problem: afxcomctl32.h structure alignment is 8 bytes (in MFC80.DLL)
Summary: In the release versions of MFC80.DLL the structure alignment when building afxcomctl32.h is 8 bytes. This is different from any other structure in MFC 8.0 (things normally use 4 byte alignment). I was having a crash with the CComCtlWrapper class when calling some of the CImageList functions (e.g. GetImageCount) I finally isolated the problem to alignment issues. Did you know that certain parts of MFC 8.0& ...Show All
Richard Day increment in C++
#include<iostream.h> void main(){ int a=5; cout<<++a<<a; cout<<"\n"; cout<<a; cout<<"\n"; } the above code generates the following output: 65 6 but as per me the output should be as follows: 66 6 why does the incement doen't show up the second time The C++ Standard (like the C Standard) defines sequence-points: these are points in the eval ...Show All
Dark_V Generic and Non-Generic Class of Same Name in Same Namespace
I've noticed that in C# 2.0, it's legal to create two classes of the same name, one of which is generic and the other not, in the same namespace, like this: namespace A { public class MyClass { public int ReturnZero() { return 0; } } public class MyClass<TData> {   ...Show All
