Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Browsing all 3021 articles
Browse latest View live

wstring Conversion

Hi, I was read a korean string and display the text. Code: std::wstring s2ws(const std::string& str) {     int size_needed = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0);...

View Article


Time calculation in the main game loop.

There is the code in the Quake 2 main game loop implementation: Code:     if (!initialized)     {        // let base retain 16 bits of effectively random data             base = timeGetTime() &...

View Article


[RESOLVED] wstring Conversion

Hi, I was read a korean string and display the text. Code: std::wstring s2ws(const std::string& str) {     int size_needed = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0);...

View Article

Image may be NSFW.
Clik here to view.

Why does this simple file read method does not work?

Code: std::string Program::readFile(const char* path) {         //Variables.         std::ifstream file;         std::string content;         //Set exception mask for file stream....

View Article

mfc dialog display problem

mfc dialog with picture control having display problem. content of 8 bit capture image buffer is shown somewhat tilted somewhat displayed incorrectly. Code:     pbmi = (BITMAPINFO*) new...

View Article


Exception in simple Azure example?

I'm trying Azure in C++ (VS 2019) and got the vcpkg packages (32 and 64 bit) as recommended here https://azure.github.io/azure-storage-cpp/ Then tried the examples here...

View Article

Is Visual C++ the right language for a telecoms middle-ware project?

Hi all, I have a requirement for coder / programmer / software engineer to work on a project that involves middle-ware in a telecoms network (i.e. between end telecoms device and customer site...

View Article

[RESOLVED] Exception in simple Azure example?

I'm trying Azure in C++ (VS 2019) and got the vcpkg packages (32 and 64 bit) as recommended here https://azure.github.io/azure-storage-cpp/ Then tried the examples here...

View Article


[RESOLVED] Copy constructor does not get called when assigning reference to a...

Code: class Dispatcher     {         //Dispatcher callback.         template<typename T>         using DispatchCallback = std::function<void(T&)>;         public:...

View Article


Casting references VS Casting the mem address of that reference?

If you want to cast a reference you usually do this: Code: Subclass &myref = (Subclass&)base_class_object_ref; But I have also seen people doing this: Code: Subclass &myref =...

View Article

template deduction

Hello, I have following piece of template code, Code: void PredictionRaster::AutoSetSetIllegalValueIfRequired(PRED_DATA_TYPE pdt, AIBaseRaster *pRaster) {         ASSERT(pRaster);         if (!pRaster)...

View Article

Image may be NSFW.
Clik here to view.

[RESOLVED] Filter a txt file based on an Excel data sheet

I would like to extend the functionality of the routine kindly developed by 2kaud - see: [RESOLVED] Filter a txt file based on a grid of data started by RIC63 user on 18 Feb 2020 - I need to add a...

View Article

Obtaining LogonDomain for logged on Windows Active Directory user

I am trying to obtain the name of the LogonDomain for the currently logged on user. I need this information to be able to determine if the user was logged in using a MicrosoftAccount, AzureAD or...

View Article


Do header files with implementation work in a precompiled header?

Let's suppose we have this header file: People.h Code: class People {     public:     People(const std::string &name, int age)         : m_name(name), m_age(age)     {     }     inline const...

View Article

Where is the list for MRU projects in VS2019 ?

I have a weird problem here with one particular project in VS2019 (it's a Visual C++ project) Regardless of whether I try to open it from within VS2019 - or by double clicking from within Windows...

View Article


vcpkg Library Manager

Has anyone here heard of the vcpkg library management tool? It's intended for programmers and is apparently a similar concept to package management which is common in Linux. i.e. if you need to build...

View Article

split string function

Hi, I was trying to practice my coding , and found the following code for splitting string and finally use those to convert to integer and get sum of those numbers. I found the split string is written...

View Article


reading multiple lines into arrays

Hello, I am just starting to solve a problem, with multiple arrays, something like: 2,2 1,2,3,4 6,7,8,9,10 0,2 1,1 +++++ output: 3, 7 first line no of arrays and no of queries. 2nd and 3rd line, array...

View Article

optionally enable the params

Hello , In the following class Code: class PixelCovCellInfo { ::::::::::::::::: private:         unsigned int        m_cellIndex;         unsigned char        m_carrierIndex;                        //...

View Article

MSVC++ and Intrinsics sse2 appear not to work consistently

I am using: MC VC++ in Microsoft Visual Studio Community 2019 Version 16.7.3 on the latest version of MS Windows 10 using Parallels for Windows on a late 2015 Apple iMac which is uptodate. I am...

View Article
Browsing all 3021 articles
Browse latest View live