visual-c++

C++ LNK2019 and LNK1120 errors

I'm trying to do another exercise from Deitel's book. The program calculates the monthly interest and prints the new balances for each of the savers. As the exercise is part of the chapter related to dynamic memory, I'm using "new" and "delete" operators. For some reason, I get these two errors: LNK2019: unresolved external symbol W...

CEditBox Validation

Hello i am new to the VC++ 6.0(MFC).I want to Validate a EditBox only number entry, including (+ or - values).I used SpanIncluding function of CString. my code is CString value; value=m_strEditBox.SpanIncluding ("0123456789-+"); if(!(value==m_strEditBox && value.GetLength ()==m_strEditBox.GetLength ())) { MessageBox(_T("I...

I want to create a distance formula for 6 degree of freedom??

I have a sensor with 6 degree of freedom 3 axiz x,y,z and 3 angles yaw, pitch and roll. 3 axis distance is simple using distance formula but how to calculate 3 angular distances? Can anyone here please help me ??? ...

Application hangs or crashes when unloading WinInet

I have a VC++ application that uses WinInet. It does the following: calls LoadLibrary() to load WinInet.dll calls InternetAttemptConnect() calls InternetOpen() calls InternetConnect() providing INTERNET_SERVICE_FTP as dwService If the last call fails (usually because of wrong password passed) InternetConnect() returns 0 and this shou...

System.Threading.Timer

Hi I am new to VC++ .net programming. Please help me out how to use System.Threading.Timer in a windows service VC++ .net code. I tried using form.timer and system.timer class but as it turns out it's a known windows bug and it won't work reliably. I am not able to use system.threading.timers. Please give an example. Nitin ...

Printing Hex Floating Point Constants from Array of Bytes

How can a hexadecimal floating point constant, as specified in C99, be printed from a array of bytes representing the machine representation of a floating point value? e.g. given union u_double { double dbl; char data[sizeof(double)]; }; An example hexadecimal floating point constant is a string of the form 0x1.FFFFFEp1...

What does the /TSAWARE linker flag do to the PE executable?

After adding the /TSAWARE linker flag to one of my projects (Visual Studio 6), I was surprised to find a new section in the PE file (.idata). If I don't set the flag, the imports are merged into .rdata. To illustrate the "problem" we start out with a simple console program: #include <stdio.h> int main() { printf("hello world\n");...

Visual Studio 2005 security updates and CRT DLL versions in manifest

Recent Visual Studio 2005 security updates may be causing problems for us. We build and internally distribute SDKs written in C++. These SDKs are a collection of header files and static libraries only. After installing the security updates our SDKs now depend on the newer versions of the MSVC CRT DLLs. These SDKs are used downstream ...

Is it safe to rewrite an EXE or DLL manifest to force a particular version of the MSVC CRT DLLs?

Is it supported by Microsoft to simply rewrite the manifest of an EXE or DLL to force the use of a specific version of the MSVC CRT? I am interested in doing this because of recent problems with Visual Studio 2005/2008 security updates (KB971090 and KB971092). I would like to simply rewrite the manifest as a post build step in order to...

simulate dialog exit

How would one use SendMessage() or PostMessage() function to close an application, given that the appropriate window handle is retrieved? Thanks in advance. ...

How to verify if a window of another program is minimized?

How can I do this? I've tried IsWindowVisible() but that doesn't seem to do the job. ...

Is there a way to verify that the current window of another program is totally visible?

Is there any function, or I'll have to iterate through all windows that are in front of mine and detect if they overlap my window? Thanks ...

delete[] and memory leaks

Hi, I am wondering about the delete[] operator in C++. (I am using Visual Studio 2005). I have an unmanaged DLL that is being called by a managed DLL. When I close this program after performing a few tasks while debugging, I am getting many (thousands?) of memory leaks, mostly 24 bytes - 44 bytes in size.. I suspect it might be due to a...

How can I view the differences between two DLLs?

Is there a way to view the difference between two binary DLL files? I have PDBs for both. Ideally I'd like to see: What functions have been added What functions have been removed What functions have been modified (with a diff of the disassembly) What other entries (static variables, resources, etc) have been added/removed/modified ...

Why is VC++ C4150 (deletion of pointer to incomplete type) only a warning?

Of course, warning must be treated, but why is VC++ C4150 (deletion of pointer to incomplete type) only a warning? ...

How to find (and replace) all old C-style data type casts in my C++ source code?

Hello How can I locate all old C-style cast in my source? I'm using Visual Studio, may be there is some compilator warning that I have to enable? Or use some software tool for this? ...

What exactly is the risk when using TerminateProcess?

My Win32 console applicaton uses a third-party library. After it exits WinMain global objects destruction begins and an AV happens somewhere deep inside. I'm really tempted to just write TerminateProcess( GetCurrentProcess(), 0 ); somewhere near the end of WinMain. If I do this the application ends gracefully. But MSDN says that doin...

Services on windows using Visual C++ 6.0

Hello, I need to create a service on windows using Visual C++ 6.0 . I am not familier with services so I read in the msdn site. Can someone send me likns to agood sites explaining (with example) how to create service using Visual C++ 6.0 (prefer with examples) ? ...

How do you write a Module Definition File in Visual C++ ?

Here is the code for my head file... #pragma once #pragma unmanaged __declspec(dllexport) public void CallMe(wchar_t *p); Here is all the code SO FAR for my definition file... LIBRARY "CppWrapper" My "CallMe" function's name compiles to "?CallMe@@YAXPA_W@Z". What do I need to add/write in my .def file to correct the compiled name ...

Visual Studio crashes when I add a .settings file in a C++ Windows form application

I'm trying to add a .settings file in a windows form application by adding a (whatever) file in the project and have it named smthng.settings. Right after it is created, it crashes (if I look into the project's directory the file is there, but it's not "in" the project). Am I doing it wrong or could it be that the problem lies elsewhere?...