visual-c++

How do I load a folder of images on a visual c++ windows form application

Hello there! I have a visual c++ windows form application (empty) made on visual studio 2008 I would like to add a button so users can browse a folder. after they select the folder I would like to "scan" that folder and list all the images (JPG, PNG and GIF) in my windows form application. can anyone provide me with the steps require...

C++ Class instantiation problem

I have included the proper Header Files , Header Gard but i cannot instantiate a specific class Getting Error error C2065: 'ClassName' : undeclared identifier Sample Code Class A{ //instantiate class B } Class B { //need to instantiate Class A } ...

how to update records of remote server database mysql

How to update the remote server data in vc++ 6.0 , i am able to retrieve the data but not updating. here i am tryng but dont know how to update pleae help. CRecordset cRecord(&db); cString csQuery; csQuery.Format(L"select * from %s where product_name = %s", m_TableName, m_ProductName); TRY { cRecord.Open(CRecordset::snapshot, ...

c++/cli mixed mode dll force targeting an older version of CRT

Hello all, As the title says, this question is about targeting an older version of the C run time in my mixed-mode C++ dll. I realize that the proper way to do this would be use an older version of Visual c++ but for whatever reason, this is the correct route for us. The dll is built in Visual Studio 2008. Is there a version of the CR...

How to incorporate this script into build process using VC++.

I'm using VC++ and want to write a script that can scan my source-code and at some places where it sees a text like "abc" then extract characters of that text and generate a selective piece of code like ones below at build time: first example of a piece of code : Func1(a); Func2(b); Func3(c); second example of a piece of code: {'a','...

C->C++ Automatically cast void pointer into Type pointer in C++ in #define in case of type is not given (C-style) [MSVS]

Hi! I've used the following C macro, But in C++ it can't automatically cast void* to type*. #define MALLOC_SAFE(var, size) { \ var = malloc(size); \ if (!var) goto error; \ } I know, I can do something like this: #define MALLOC_SAFE_CPP(var, type, size) { \ var = (type)malloc(size); \ if (!var) goto error; \ } But ...

Why is my COM factory never released during the program lifetime?

I have a native C++ ATL in-proc COM server. A separate test program calls CoInitialize(), calls CoCreateInstance(), then calls Release() on the pointer, then calls CoUnitialize() and exits. If I run the test program under Visual C++ debugger the debug CRT reports a single memory leak and each time the allocation number is the same. ...

Accessing vector element of shared object using boost interprocess

Hi, I'm trying to understand how boost interprocess library works. I have an Equipment class which holds integer values in a vector container. In parent parent process; I constructed Equipment object in MySegmentObject segment, and in the constructor of this object I created the vector in MySegmentVector segment. Using child process;...

How to reset/emptying to a std::wstring?

How to reset/emptying to a std::wstring? It seems that my function is making a delay when using these line: std::wstring currentUrl; // <--- I declare this as global. currentUrl = _bstr_t(url->bstrVal); Any idea how can I resolve this? ...

c++ What process is listening on a certain port in windows

I have created a program in visual c++, where i have implemented a web service. The web service is set to listen on port 80, but if another program already is using this port, the web service fail to start up. So when the webservice can't start, I would like to have a function or method, which can get the name of the process, that curr...

Unable to create Directory using CreateDirectoryW Function in WIN64

Hi All, I am unable to create directory using CreateDirectoryW(). Kindly help me. ...

fatal error C1017: invalid integer constant expression

Hi, I have got a statement in my code: #if DEBUG==0 this works fine in gnu g++ but it fails in VC++. Can anyone explain what is wrong with this. I have already read msdn help on this topic. so, if debug is defined as 1 then this is false i.e.0, so it should work and similarly if debug=0 Can anyone suggest how to correct this. My c...

Restricting GetFocus to specific dialog and/or application

I have a MS Visual C++ project where I have a CDialog based dialog box with several edit controls. I want to highlight the control with the current focus for the user. I implemented this by getting a pointer to the window that has the current focus with GetFocus() and then obtaining the ID for the focused control with GetDlgCtrlID(): ...

cxcore210d.dll missing

hi all, I'm trying to use OpenCV in Visual C++ express edition 2008. I've installed OpenCV 2.1 and added necessary include and lib directories/files to my project dependencies. A system PATH is also present for "C:\OpenCV2.1\bin". When i compile and run the example program to open an image, I get a runtime error saying cxcore210d.dll i...

C++ Copy Objects from a file to a Array

Hi need to copy the written objects in a file to copy to a array But following code gives me a Error T Obj T arr[20]; while(file.read((char*)&Obj,sizeof(Obj))){ int i=0; i++ arr[i]==Obj; } Error C2678: binary '==' : no operator found which takes a left-hand operand of type ...

How to pass COM pointer from one process to another?

I have an interface pointer to an COM object sitting within process 1. I would like to get access to the same object from another process. How can I achieve this purpose? I believe directly passing over the pointer wouldn't work due to different address spaces. I know it involves the marshaling/proxy/stub stuff. But I don't know details....

Is there a technical term for the part of an IDE which maintains a dynamic symbol table as you code?

My context is MSVC 6. Starting with a successfully compiled program, with browse information built, I can go into a existing function and hover over a variable, and the IDE will show me the data type, and variable name. One could well imagine that the information is coming from the browse file. In practice, If I create a new variable...

How to prevent functions from being excluded from coverage profiling?

We're using AQTime's coverage profiler to check coverage results for unit tests. It seems to generally work okay, but has a nasty habit of overestimating coverage because some functions don't appear at all. I think this is because the linker has stripped them because they're not called, but obviously it is not ideal because I'd like them...

VC++ 10 complains that alot of types are not defined, C99

Hi, I'm trying to compile an open source project I downloaded, apparently written in VC++ 7.1. After alot of trouble, being novice at C++, I managed to download and fix includes for STLPort that the project uses. However, I get something like 15000 errors that complains that certain types are not defined. A few of them are: u_int32_t ...

On what platforms will m_ofn members be valid?

According to this, some members (specifically the one I am interested in is the initial directory member lpstrInitialDir is not supported on Vista. It is important for me to know if it is supported on 2008 and Windows7 - the docs are silent on that. One can either assume since those are not mentioned that it will work, or since they ...