Questions tagged [visual-c++]

11990 questions
0

votes
0

answer
4

Views

How to write totally single configuration instead multiple configuration on VC++ generator

Summary I'm writting cmake script for libraries at multiple platforms (Win32 VC++/mingw/linux/embedded systems, will generate *.lib and *.a files). How to write cmake script for force override single configuration at the VC++ generator and get same results for single configuration generator? Backgro...
Kouji Matsui
1

votes
1

answer
117

Views

Operator overloading on temporary

I'm having some problem trying to use bitshift operator on a temporary object returned by a method. The idea is to create a Log object as a temporary, and through the bitshift operator, append values which would be stored in a std::stringstream object. On the destruction of the temporary, the std::s...
pabloxrl
1

votes
1

answer
215

Views

Placement new crashing when used with virtual inheritance hierarchy in Visual C++

I am using virtual inheritance with a selection of classes in c++. It is currently crashing on destruction. It seems to compile fine in the online compilers, however when I run in Visual Studio, it crashes. I have a pure virtual base class, which is being inherited virtually by its implementation. I...
marsh
1

votes
2

answer
122

Views

How to eliminate flickering with erase background in mfc

I am working with SDI app to redraw graph and update data by using timer in View file. Even though I use ON_WM_ERASEBKGND to eliminate flickering, but it still happen. And below are my code that I tried to implement. Anyone has any ideas to eliminate flickering? Here are my MSG_MAP ON_WM_PAINT() ON_...
Lê Duy Cường
1

votes
2

answer
72

Views

How to initialize a struct with union?

How can I properly initialize a struct which contains a union? Currently I get an error // error C2440: 'initializing': cannot convert from 'float' to 'const char *' #include using namespace std; typedef enum {STRING, REAL, POINTER } Type; const struct Entry { union { const char *string; float real...
user10926577
1

votes
2

answer
76

Views

What is the difference between C++ and Visual C++ and how to start with C++? [closed]

So I want to start learning how to make real games and programs, and I bumped into C++ but then I realized that there is also Visual C++. If there's any difference - tell me what it is. If you have any suggestions on how to start in general with C++ program making (not that black window), please let...
Martin Davidov
1

votes
2

answer
17.7k

Views

vcl.h: No such file or directory

I'm looking to compile some old source code in Visual C++. However, the first of many errors I am receiving is: vcl.h: No such file or directory This appears to be in reference to the Visual Component Library, native to Borland compilers it seems. I downloaded the free Borland C++ 5.5 command line...
Jones
1

votes
2

answer
5.8k

Views

Visual studio compiler errors at enum

I have the following code which compiles without errors under Linux and Mac OS X. I now want to compile the code with Windows, but I get a lot of errors in the following code segment: ... enum Type { UPDATE = 0, DELETE = 1 }; ... The error messages are these: 1>Request.hpp(48) : error C2143: synt...
tune2fs
1

votes
0

answer
131

Views

GdiPlus : Region from a GraphicPath without filling it

I need to get a Gdi+ Region from a GraphicPath without filling it, and I don't know how to do it. A draw is better than words, so here is what I want to do : What I want to do I have an ellipse, than I want to be displayed unfilled (whith a known line width) I have a full rectangle, and I want it to...
Alex
0

votes
0

answer
22

Views

File processing output in c++

I made a small program that asks the user how many items he wants in his order, then asks the user to input the name of each item and the price for each item as well. But all the txt files created by this code only print the first item name and the first item price. How should I correct this? I alr...
Diego Montilla
1

votes
1

answer
390

Views

Where to store Windows Service configuration file

I'm creating a Windows Service in C++ that acts as a server. I need to store some configuration values (listening interface, ports) in a text file and other settings and users in a SQLite-Database file. Should I use the AppData folder or System32, because that's the default Windows Service working d...
Loris156
1

votes
0

answer
20

Views

why fatal Error 111 error C1083 in VC++

I used the following syntax: import '../vavole/Acoust-ics.dll' I am compiling with visual studio 2005C++ But while rebuilding the soultion i am getting the following Error 111fatal error C1083 ,Cannot open type library file: '../vavole/Acoustics.dll': No such file or directory, I have checked the...
JAINIL PANDYA
1

votes
1

answer
253

Views

Debug Assertion Failed! Invalid Heap Pointer after VS upgrade

We recently upgrade our enterprise app from vs2015 to vs2017. This entailed quite a bit of upgrades: Windows SDK to the newest version to 16299 Newest C++ Runtime 2017 debug support others We have 3 layers to our application: A C# UI layer, a VC++\CLI middle layer, and a C system layer. When EITHER...
greggorob64
1

votes
0

answer
11

Views

How to re sharp (join) arabic letters in c++

well i need help in solving this issue, i want to join the arabic letters in a way to look like this ' السلام عليكم ' not like this ' ا ل س ل ا م ع ل ي ك م ' here's my code: #include #include #include #include #include #include #include using namespace std; int main(){SetCons...
najibhashem
1

votes
0

answer
13

Views

Is there a way to see variable as a string in visual studio c++ debugger?

In java, if the toString method is overridden, then the debugger can be configured to show a string for the object. In c++ debugger in visual studio , is there a way to see objects in string as well?
user1559897
1

votes
0

answer
111

Views

NtCreateEvent returns ERROR_BAD_PATHNAME (161)

Background I am trying to set an event with a given name to determine if the application has already queued a given task. I am using NtCreateEvent and NtOpenEvent, so I wrote 2 wrapper functions for each. NtCreateEvent HANDLE CreateEvent(PCHAR EventName) { UNICODE_STRING uString; Rtl::InitUnicodeStr...
1

votes
1

answer
271

Views

Continuous Integration and Signed Binary Builds (Windows) - Best Practices

The application we have is a C++ Windows application. The project is in Visual Studio 2015. I'm in the process of helping to move our build process to the cloud. We already have a system in place for our server-side components, built on Jenkins. I am trying to directly use the process in place as mu...
Jonathan Lam
1

votes
0

answer
105

Views

vs c++ inline assembly __asm improper operand type when using 64 bit registers

I'm not sure why I can't store the 64 bit RAX register to a unit64_t data type. Here is the code: uint64_t timerCounter = 0; void volatile aTimer(void) { //for (timerCounter = 0; ; timerCounter++); __asm { mov rax, 0 nxtinc: inc rax mov timerCounter, rax // Improper Operand Type!!! jmp nxtinc } }...
Walter ZAMBOTTI
1

votes
2

answer
326

Views

Cannot build project which is using Python

I am trying to use https://github.com/lava/matplotlib-cpp in my Visual C++ project. I added libs Python36-32\libs\python36_d.lib Python36-32\libs\python3_d.lib But I still get errors error LNK2019: unresolved external symbol __imp_PyObject_GetAttrString referenced in function 'private: __cdecl m...
Ufx
1

votes
0

answer
301

Views

Web Crawler using c++

I'm planning on crawling a website using c++. I have gathered information on how to crawl a website from base. I download the webpages using winhttp library. I want to build one of my own and not use third party libraries. The information I gathered are : 1.Check robots.txt to find which page can b...
KESHAV K
1

votes
2

answer
52

Views

OpenCL. Matrix multiplication Bypasses some Work-Items

I've tried to code my own approach when trying to implement matrix multiplication in OpenCL; but it seems that some work-item's work seem to be overwritten by other work-items and I don't really know how to deal with this. What I'm really sure of is that the problem is within the OpenCL program. My...
Some random IT boy
1

votes
0

answer
28

Views

C# 2010 Child form not showing inside MDI

I'm trying to open child form inside MDI Form it's not working in visual studio 2010. I've written following code. private void dashboardToolStripMenuItem_Click(object sender, EventArgs e){ Dashboard dash = new Dashboard(); dash.MdiParent = this; dash.Show(); } it shows Error : F...
Akshay Kotecha
1

votes
0

answer
719

Views

VS2017: fatal error C1900: Il mismatch

My Visual Studio 2017 C++ project takes as inputs: Source code Library compiled by VS2015 Library compiled by 3rd party using VS2017 The linker gives errors: 1> functionallib.lib(bcp_toplevel.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link...
DavidA
1

votes
0

answer
24

Views

Prevent Visual Studio from indenting code after multi-line template

I have recently discovered that Visual Studio likes to indent things after a template which takes up multiple lines, as you can see here: After the template, in which I like to list parameters on different lines to prevent one huge line, the class declaration is indented by a tab. It indents the who...
MC ΔT
0

votes
0

answer
3

Views

How can I load a image resource? I want to make an app that changes the Windows background

So I want to make a GUI app where a person can choose between 2 background options: IDR_BACKGROUND1, and IDR_BACKGROUND2(that's how they are defined in Resource.h). How can I load the resources in code? I believe that syntax for changing the background is : SystemParametersInfo(SPI_SETDESKWALLPAPER...
Th3R4nd0m
1

votes
0

answer
50

Views

Concurrency Visualizer in VisualStudio 2015 not loading the Symbols

I have a very basic MFC program created with VS2015. When I create CVtrace file, in a system where VS is installed, I can browse to the source. On the other hand if I capture trace on a target system, for the same exe, where no VS is installed , the symbols belonging to the exe are not loaded. On t...
ThomasJoseph
1

votes
0

answer
63

Views

Visual C++ accessible private destructor

Consider a simple example (note that the destructor is private): class Resource { private: ~Resource() = default; }; int main(int argc, char** argv) { // Object on the stack Resource r1; // line L1 // Object on the heap Resource* r2 = new Resource(); delete r2; // line L2 return 0; } Compiling this...
Kassiar
1

votes
1

answer
146

Views

How to Port Windows Embedded Compact 7 DLL to Windows CE 5.0 / 6.0?

I would like to port a DLL that was compiled for Windows Embedded Compact 7 into a Windows CE 5.0 / 6.0 environment. I'm fairly certain the target assembly language is compatible but from my experimentation it appears that there is something fundamentally different about the DLL's in WEC 7 than in...
Paul Berland
1

votes
0

answer
116

Views

Using libgit2 with Qt and MSVC throws Unresolved External Symbol but works in VC++ project

I'm trying to compile with MSVC 2017 64bits a Qt application that uses libgit2. Trying to compile I've got the following error: error: LNK2019: unresolved external symbol git_repository_init referenced in function main. Googling a bit I've found these answers (Qt Creator: Unresolved External Symbol...
Abdelilah El Aissaoui
1

votes
0

answer
157

Views

How can we read memory mapped file data of 32 bit 3rd party application from a windows service application?

I have a 32 bit third party application's dll. It is of type library project and creates a memory Mapped File named MappedObject. This is the section of code indicating generation of mmf file:- #include 'stdafx.h' #include 'dllmain.h' #include #include #include #pragma comment(lib, 'user32.lib')...
Annonymous programmer
1

votes
0

answer
65

Views

C++ SFINAE in dummy parameter in MSVC 2015

I've tried to perform as simple as possible SFINAE overload in order to write several kinds of one getSize(s) function: one returns s.getSize() and another one s.GetLength(), then I'll probably add s.length(), etc. Unfortunately, this code produced strange error on MSVC 2015 Update 3: Am I missing...
Victor Istomin
1

votes
1

answer
201

Views

C++ Plugin can't delay load a dll

I am bridging Nvidia Blast to Unity, and I am running into the following error when PhysX is trying to delay load PhysX3CommonDEBUG_x64.dll: Unhandled exception at 0x00007FFDD7743FB8 (KernelBase.dll) in Unity.exe: 0xC06D007E: Module not found (parameters: 0x00000000005FC5B0).` I am able to run this...
AquaGeneral
1

votes
1

answer
52

Views

Create MetaTrader Terminal 4 DLL file with C++

I learned C++ and I need to start creating plugins for MetaTrader Terminal 4 by coding DLL files, but I do not know how to start MetaTrader Terminal 4 programming. Also I tried to look for resources or examples, but with no results. Please I need some one to lead me how to start the tutorial and whe...
Shadi Adawi
1

votes
0

answer
72

Views

How do i undefine a function previously defined in a library in vs2008

I am using vs2008 and DDK 2003 to build a solution. A .cpp file has a definition of a function which is already defined in a library eh.lib. While building the solution it always gives me a warning as - 'public: const char* typename::name(void) const already defined in eh.lib(typname.obj); second de...
Vishal Gaikwad
1

votes
0

answer
93

Views

Display window in the langton ant in c++

#include #include #include using namespace cv; using namespace std; class Ant { public: int x; int y; int orientation; }; class World { public: Ant c; /*c is data member to class World and Ant is itself a class*/ Mat* board; //Board is a pointer to Mat World(int rows, int columns, int x, i...
shreya
1

votes
0

answer
39

Views

Random SetConsoleTitle name

Looking how to make title random every time its loaded SetConsoleTitle('Injector-BETA'); hWnd = GetConsoleWindow(); handle = GetStdHandle(STD_OUTPUT_HANDLE); SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
JoeCooper
1

votes
1

answer
66

Views

checking Visual C++ breakpoints (not stopping)

I'm working with Visual C++ installed on a Windows Virtual Machine (VMWare). As there is no way to make the debugger stop at breakpoints, I wondered if there was a problem with the breakpoints mechanism itself, maybe due to the fact I'm working in a VM (?). ___asm int 3 works fine, and I can debug t...
hank7v
1

votes
1

answer
298

Views

How can we debug DLL (bulit with native C/C++) source with WPF/C# executable?

Assume we have WPF/C# Project called A (A.exe). It's using DLL built with C++/CLI ;which is project B (B.Dll) And project B depends upon project D, which also a DLL built with native C/C++( D.Dll). Simply A.exe -> uses B.Dll -> uses D.Dll Here is my native environment is - Windows 10 ,Visual Studio...
1

votes
0

answer
271

Views

Is Visual Studio's std::mutex implementation incorrect or just “weaker” than other stl implementations?

My understanding of mutex is that it has two guarantees: Mutual Exclusion Given an n, it will guarantee that a waiting thread will acquire the lock after n other threads have 'cut in line'. I know semaphores must have the second guarantee, and I expect that mutex should also have it since all platfo...
Max
1

votes
0

answer
130

Views

Visual Studio project dependency

My background is in Java, and I will start working on a project written in Visual C++. This Visual C++ project is dependent on several other internal and external projects. Most of them are internal company's projects and exist on my organisations internal Git repository. And some of them, while ext...
andreas

View additional questions