visual-c++

EditBox Vetical ScrollBar problem

In VC++ 6.0 MFC project, i added EditBox with Vertical Scrollbar ,Every 10 seconds i am readeing data from serial port and i have to display through EditBox(IDC_EDIT1) ,i done it no problem. But one typical problem i am facing which is that,whenever a new data display in editbox the vertical scrollbar will goes up and data remains down...

VC++ database connection

Hi we are developing Vc++ project while executing this strSQL = _T("SELECT * FROM tblTestInfo_SI ") _T(" WHERE (idOnLineStatus = 1)"); while passing this query through below function shows some error. idOnLineStatus this datatype is number bSuccess = m_prsTestInfoSI->Open( CRecordset::dynaset, strSQL, CRecordset::none ); DBMS: ...

Creating next/back windows in Visual C++

Hi all, What's the best way to create a set of windows like in installers where you can click next/back and move between screens. My idea is to define a class which holdes all the necessary 'current window' information, such as buttons, dialogue boxes and all that. And basically have the next/previous increment between displaying these...

what is "stack alignment"?

What is stack alignment? Why is it used? Can it be controlled by compiler settings? The details of this question are taken from a problem faced when trying to use ffmpeg libraries with msvc, however what I'm really interested in is an explanation of what is "stack alignment". The Details: When runnig my msvc complied program which ...

stdafx.h: When do I need it?

I see so much code including stdafx.h. Say, I do not want pre-compiled headers. And I will include all the required system headers myself manually. In that case is there any other good reason I should be aware of where I require stdafx.h? ...

VC90 Debug CRT error

I have created a Dll in VC++ 2008. But it is working with some other software (VB). Unable to load that dll function in Labview. VC90 Debug CRT error is coming. Why is this software not supporting my dll? ...

Win32 printing - cannot set landscape mode

I've got an old app that I need to get to print in landscape mode. The documentation I've found says to get a DEVMODE structure, change a couple of fields, and put it back in. What I've got is: HANDLE printer_handle; LPHANDLE printer_handle_pointer(&printer_handle); OpenPrinter(printer_name.get(), printer_handle_pointer, N...

C++ Pointers and References - Beginner Question

Hi, I was looking at a library a person has made for FaceBook in C++. The header file is this: #ifndef __FACEBOOK_H__ #define __FACEBOOK_H__ /** * Facebook Class * Joel Seligstein * Last mod: Aug 22, 2006 * * This is the beginnings of a facebook class set and REST client. Its not documented * yet nor nearly complete. But thi...

What's wrong with my file dependencies?

I have a program using 3 header files and 3 .cpp files in addition to main.cpp. I'm using VC++ 2008. Here's the setup. All three headers are guarded with #ifndef HEADERNAME_H, etc. Also all three headers have corresponding .cpp files, which #include their respective headers. /* main.cpp */ #include "mainHeader.h" /* mainHeader.h *...

"Already listening" when invoking an RPC call

I use Microsoft RPC for interprocess communications. I have an interface with a set of methods accepting a byte pipe as an "in" parameter (IDL description): [ uuid(ActualGuidHere), version(1.0), pointer_default(unique) ] interface IMyInterface { //other irrelevant methods here error_status_t rpcDoAction( [in] pipe...

Best practices in Visual Studio C++

Hi all Visual Studio seems to want to put class contructor code and event handling code in the .h file. I have only been involved in small 1 man projects and was wondering what the general industry standard was. For Visual C++ Application projects what code would one put in the .h file? I am used to the mode classical C++ way of decl...

How can I force MSVC++ to ignore CRT dependencies of a static library?

I don't know if it's possible to do this, but I would like the /NODEFAULTLIB to be applied to a static library project. I have many application projects (A.exe, B.dll, C.dll) that use a common static library D.lib. This library has a lot of code and also has other .lib dependencies as well. One of them is the openssl library, which seem...

What to put in precompiled header? (MSVC)

What are the best candidates for a precompiled header file? Can I put STL and Boost headers there, even though they have templates? And will that reduce compile times? Also, what are the best IDE settings to reduce compile times? ...

How can adding code to a loop make it faster?

I have a simple function with an inner loop - it scales the input value, looks up an output value in a lookup table, and copies it to the destination. (ftol_ambient is a trick I copied from the web for fast conversion of float to int). for (i = 0; i < iCount; ++i) { iScaled = ftol_ambient(*pSource * PRECISION3); if (iScaled <=...

How to create a UTF-8 string literal in Visual C++ 2008

In VC++ 2003, I could just save the source file as UTF-8 and all strings were used as is. In other words, the following code would print the strings as is to the console. If the source file was saved as UTF-8 then the output would be UTF-8. printf("Chinese (Traditional)"); printf("中国語 (繁体)"); printf("중국어 (번체)"); printf("Chinês (Tradicio...

Calling visual C++ code from C#

I got stuck with a "ref" keyword which is applied to the class in .cpp file. I want to access a method which is marked as __clrcall. Can u tell me what ref keyword used for in visual c++ code? ...

how to use the key board as command to zoom in opengl?

can anyone tell me how? i've never done this before so i'm not sure as what library to use and how to call the command that a key pressed as a instruction rather than input.. i'm writing a OpenGL program in Visio C++ ...

Launching cab file from Visual C++ dll

Hi There, Does anybody know how to launch a cab file from a Visual C++ dll thats being used as a setup dll when installing an application on windows mobile. Basically, I need the dll to detect if compact framework is not installed and run required cab file if needed. I've beeg googling for something similar for ages with no luck. Surely...

Starting .exe from Visual C++ 2005 dll

Hi There, Does anyone know the code or have ideas on how to kick off an exe using visual c++ 2005. The environment the dll is on if Windows Mobile. The c# to do this using P/Invoke is [DllImport("coredll.Dll")] private static extern int CreateProcess(string strImageName, string strCmdLine, IntPtr pProcessAttributes, IntPtr pThreadAttr...

solution file

what is solution file in visual c++ 6.0, how to geneate the solution file. ...