visual-c++

How to access win32 console App Data in VC++ MFC GUI.

I have two apps: Win32 Console App. MFC GUI App. I wanted to execute the console app in MFC GUI and I am want to get data from that Console app and display them in GUI. I get this error: "fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do ...

Image processing: smart solution for converting superixel (128x128 pixel) coordinates needed

Hi, i am searching for a smart solution for this problem: A cancer ct picture is stored inside a unsigned short array (1-dimensional). I have the location information of the cancer region inside the picture, but the coordinates (x,y) are in superpixel (128x128 unsigned short). My task is to highlight this region. I already solved th...

Detect file handle leaks with Win32 C++

Is there some way to detect file handle leaks at program termination? In particular I would like to make sure that all of my handles that get created are being freed in code. For example, I may have a CreateFile() somewhere, and at program termination I want to detect and ensure that all of them are closed. ...

Why does the compiler choose bool over string for implicit typecast of L""?

Having recently introduced an overload of a method the application started to fail. Finally tracking it down, the new method is being called where I did not expect it to be. We had setValue( const std::wstring& name, const std::wstring& value ); std::wstring avalue( func() ); setValue( L"string", avalue ); std::wstring bvalue( func2()...

How do I read from a version resource in Visual C++

I have a version resource in my resources in a C++ project which contains version number, copyright and build details. Is there an easy way to access this at run-time to populate my help/about dialog as I am currently maintaining seperate const values of this information. Ideally, the solution should work for Windows/CE mobile and earl...

Parsing a byte stream to a struct/class

I have a byte stream I need parsed into a struct, and I also need to be able to parse the struct back to a byte stream. Below is an example of what I want where I've used BitConverter to parse the values. I hope there is a more efficient way of doing this, because my structs are HUGE! ref struct TestStruct { int TestInt; float ...

ApplicationVerifier is not detecting handle leaks, what do I do?

I did select the executable correctly, because I can get it to respond to certain things I do. But I can't get ApplicationVerifier to properly detect a handle leak. Here is an example: int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, ...

Database trigger that communicates with an external program

I've got a SQLServer Database and an application (.NET) that configures data on that database. On the other hand, I've got an application (VC++) that reads that data from the database and must be 'informed' a soon as possible of any change in the data saved on the database. I would like to receive a signal from the database engine when ...

Visual C++ 'Force Includes' option

I have just come across a Visual C++ option that allows you to force file(s) to be included - this came about when I was looking at some code that was missing a #include "StdAfx.h" on each .cpp file, but was actually doing so via this option. The option can be found on the Advanced C/C++ Configuration Properties page and equates to the...

OpenGL 3d stereo viewing for aerial stereo image (left, right images)

Hi all! Please help me! My purpose: - display overlapping area with whole left right satellite or aerial image - rotate image using roll, pitch yaw angles -image format is Tiff image Now i'm doing OpengGL 3d stereo viewing for aerial stereo image (left, right stereo pair). I displayed my left right image using followi...

vc++ MFC Project

In Vc++ 6.0 mscomm control,please any body explain this function How it works ,what it does if (m_comm.GetCommEvent()==2 ) { VARIANT in_dat; in_dat = m_comm.GetInput(); CString strInput(in_dat.bstrVal); m_input = m_input + strInput; UpdateData(FALSE); } ...

Accessing network shares

Hi, I am currently trying to access a network share from my machine programaticaly using vc++ 6.0. I am using WNetAddConnection2 to connect to a share using my credentials. I am facing the following problem: Consider the case when there are 2 users trying to access the same remote share from same machine one after the other. Now once ...

C++ Static member method call on class instance.

Here is a little test program : #include <iostream> class Test { public: static void DoCrash(){ std::cout<< "TEST IT!"<< std::endl; } }; int main() { Test k; k.DoCrash(); // calling a static method like a member method... std::system( "pause "); return 0; } On VS2008 + SP1 (vc9) it compiles fine : the cons...

Advanced Windows Application UI (MDI Tabbed Group)

I would like to be able to create an MDI UI layout that extends the behavior of MDI Tabbed Groups in the following way. Within a pane for a split tabbed group, I'd like to create a nested tab group with the opposite directional alignment. For instance, given a horizontally split top level, I would like to create a vertically split tab ...

How to reduce linkage time for large project written in native Visual C++ ?

I am working with a large bunch of sources written in Visual C++. The target is dll library. Linkage time consumes several minutes. How this time can be reduced? Library depends on other dlls and libs, which are in the same solution. The first thing which can be done is to split source into several projects, but it is a time consuming...

Visual C++ App crashes before main in Release, but runs fine in Debug

When in release it crashes with an unhandled exception: std::length error. The call stack looks like this: msvcr90.dll!__set_flsgetvalue() Line 256 + 0xc bytes C msvcr90.dll!__set_flsgetvalue() Line 256 + 0xc bytes C msvcr90.dll!_getptd_noexit() Line 616 + 0x7 bytes C msvcr90.dll!_getptd() Line 641 + 0x5 bytes C msvcr90.dll!ra...

vc++ 6.0 serial communicaton

hai in vc++ i am using MScomm for serial communication, i received data in this format 02120812550006050.0, i am not gettng how to read this ,in which format it is, begning starting frame and at the end ending file, remaing i dont know. EDIT 1: it contains date time and data how i can seperate this one ...

Is there a difference (re optimizations) between MSVC++ 2008 and PSDK compiler?

I have just installed the Platform SDK for Windows Server 2008 and .NET 3.5 on my new system, and for the first time tried to compile a project for WIN64. The Unicode Release version of that program, built for 32 bit (using the optimizing compiler from the no longer available Free Toolkit), comes in at about 2.8 MB. Using the amd64 com...

How to find out if a pointer is on the stack on PC/Visual C++

[This is for PC/Visual C++ specifically (although any other answers would be quite illuminating :))] How can you tell if a pointer comes from an object in the stack? For example: int g_n = 0; void F() { int *pA = &s_n; ASSERT_IS_POINTER_ON_STACK(pA); int i = 0; int *pB = &i; ASSERT_IS_POINTER_ON_STACK(pB); } so o...

GUI App with Visual C++ Express Edition

What tool (preferably free) can be used with Visual C++ 2008 Express Edition to create Win32 GUI applications? As you know the Express Edition does not include a GUI resource editor. ...