visual-c++

Is null terminate() handler allowed?

In VC++7 if I do the following: void myTerminate() { cout << "In myTerminate()"; abort(); } int main( int, char** ) { set_terminate( &myTerminate ); set_terminate( 0 ); terminate(); return 0; } the program behaves exactly as if abort() was called directly which is exactly what default terminate() handler does....

Function has corrupt return value

I have a situation in Visual C++ 2008 that I have not seen before. I have a class with 4 STL objects (list and vector to be precise) and integers. It has a method: inline int id() { return m_id; } The return value from this method is corrupt, and I have no idea why. I'd like to believe its a stack smash, but as far as I know, I ha...

Why and when should one call _fpreset( )?

The only documentation I can find (on MSDN or otherwise) is that a call to _fpreset() "resets the floating-point package." What is the "floating point package?" Does this also clear the FPU status word? I see documentation that says to call _fpreset() when recovering from a SIGFPE, but doesn't _clearfp() do this as well? Do I need to...

Creating a System::String object from a BSTR in Managed C++ - is this way a good idea???

My co-worker is filling a System::String object with double-byte characters from an unmanaged library by the following method: RFC_PARAMETER aux; Object* target; RFC_UNICODE_TYPE_ELEMENT* elm; elm = &(m_coreObject->m_pStructMeta->m_typeElements[index]); aux.name = NULL; aux.nlen = 0; aux.type = elm->type; aux.leng = elm->c2_length; aux....

Possible to make Visual Studio only show a list of files which didn't compile?

A low-level code change I've made means lots of files no longer compile. It's easy to fix each such file, but each generates a whole stack of compile errors which makes it a bit hard to see which files are affected. Can I easily generate from within VC++ 2008 a list only of the names of each file which failed to compile, without the err...

how to find a address everytime.

i have been working on a server and it works with 2 programs i made one is the server and one is the error handler and if the main server fails it restarts it. the 2nd program's main way to handle data is by reading the values from the program(because when i was debugging i was filling in the address's), because writeing the values to a ...

Visual Assist X - comments screwed up

I have a couple of methods like /*this is a comment for init, version 1*/ void init(int x); /*this is a comment for init, version 2*/ void init(int x,int y); But when VAX's intellisense comes up when I type "init(", the comments are not showing right. For the first version, it shows me the comment for the 2nd version... how and why i...

Winsock2 recv() hook into a remote process.

Hello! I was trying to hook a custom recv() winsock2.0 method to a remote process, so that my function executes instead of the one in the process, i have been googling this and i found some really good example, but they lack description typedef (WINAPI * WSAREC)( SOCKET s, char *buf, int len, int flags ) = recv; Now my question is, wh...

ActiveX code from Visual C++ port to Borland C++ Builder

I have the following code example for Visual C++ which creates an ActiveX object which can then be used. // create a smart pointer for ActiveDSO _DActiveDSOPtr activeDSO; HRESULT hr = activeDSO.GetActiveObject(__uuidof(ActiveDSO)); if (FAILED(hr)) { hr = activeDSO.CreateInstance(__uuidof(ActiveDSO)); if...

I want to create an application to read and write DICOM files without using any third party software

I want to create an application to read and write DICOM files without using any third party software How can I do that? Can any one help me? ...

Any Performance overhead if the application has more 5000 COM objects?

We do industrial automation application and we need to use VC++ application. As part of that we need windows controls which shall be developed in Visual Basic 6.0. When we run the application with tabbed interfaces, we have approximately 5000 COM objects together. COM object count is expected to grow. Are are any performance overhe...

Visual Studio C++ Debugger, get value from address

hello, if you just know the address of a variable and the type of it, is it possible to see it's value in the visual studio debugger? furthermore, would it be possible to use this address in a conditional or data breakpoint? i already tried plain casting like this: (bool)(*0x05dc05d1) which is obviously stupid. ;) thanks ...

VS2008 C++ - afxglobals.h: No such file or directory

We have a C++ MFC project that won't build under a fresh-install of Visual Studio 2008 Standard. I've tried: Revo Uninstaller to remove all previous versions of Visual Studio Fresh install of Visual Studio 2008 Standard (all options selected) This is running Windows XP SP2. I don't have the file afxglobals.h, which to my knowledge sh...

How can I use msbuild to update the version data in my .rc files?

I have been tasked with automating our build process with msbuild. We have about twenty Visual C++ projects and twenty C# projects making it a pain to hand edit all the version strings. Our version numbers are meat-generated at build time, so we need to pass the full version string as a property on the command line. My initial impleme...

How to get list of folders in this folder?

How to get list of folders in this folder? ...

Object Detection in openCV

I have a problem with my program written in Visual C++ using OpenCV: i have to capture frames from webcam and find all the various rectangle (it doesn't matter the color). I try to modify the samples in c, squares.c, but it doesn't work as well, because the program wait any key (different from 'q') to continue. This is the code. Someon...

Visual C++ application/libarary size anomoly

This is just a bit of a general question regading app/lib file sizes. When I build a particular library in my C++ solution I notice that the .lib file size is larger in the release build than in the debug (1.2mb Vs 800k). However when I build an app in the same solution, using the aforementioned library, the release .exe is always smalle...

Why is VC++ Resource Editor not putting auto-generated code in the right place?

In MyControl.h I have: class CMyControl: public CRichEditCtrl { DECLARE_DYNAMIC( CMyControl) public: CMyControl(); virtual ~CMyControl(); public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMyControl) //}}AFX_VIRTUAL // Generated message map functions protected: //{...

Execute another program in C++

Hey folks, I want to remotely execute another application from my C++ program. So far I played along with the CreateProcess(...) function and it works just fine. The problem however is that I need the full path of the other program but I do not know the directory of it. So what I want is that I just have to enter the name of the other ...

Something preventing default (explorer-style) CListCtrl jump to line behaviour

I'm maintaining an MFC/COM/ATL 45-odd project solution originally written with VS6. I'm now using VS2008. I'm looking at a list control(vanilla CListCtrl) which doesn't behave as we think it should. Normally in an MFC list control you can press a key, (Q say) & selection will jump down to the 1st line beginning with 'Q' (like windows ex...