How to concatenate strings, integers and floating point numbers without using objects?

Dominique

I'd like to add information in a crash dump file, in case my application crashes.

Therefore I've created a __try-__except clause:

__try
{
  Do_Something();
}
__except (ShowCrashdumpInformation(_T(__FUNCTION__));

Instead of just __FUNCTION__, I'd like to add more information, but how can I do that?

The simpliest way is to use a CString, but this is blocked because of compiler error C2712 (Cannot use __try in functions that require object unwinding).

So, I'd like to use LPCTSTR strings (which are widely used in my application).

As a result it should look like (CString alternative):

CString temp; temp.Format(_T("Do_Something, int=[%d], float=[%f], string=[%s]), iParam, fParam, strParam);

Do anybody have an idea?
Thanks

MSalters

By far the easiest solution is to simply sidestep the problem. Just forward the exact arguments, not converted, to a (template) function which does the actual writing to file. Since the __catch is not in the template function itself, but one level up the stack, you're safe.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to format floating point numbers into a string using Go

How to format floating point numbers with decimal comma using the fmt library?

Uniform distribution of integers using floating point source

How are floating point numbers stored inside the CPU?

Understanding how these floating point numbers work?

How to increment floating point numbers by 1?

PROLOG - How to round decimals of floating point numbers?

How to capture numbers in specific range with floating point?

Can floating point numbers ending with `.0` be considered as mathematical integers

How to get the average of two floating point numbers

Extracting floating point numbers in a string using regex

How to divide integers in Oracle SQL to produce floating point numbers?

How to convert dataframe dates into floating point numbers?

How to print floating point numbers from assembly?

Phpunit and floating point numbers stored as strings

Reciprocal representation of integers in floating point numbers

Plotting histogram of floating point numbers and integers in python

Finding integers and floating point numbers in a list

rewriting the code sequence using two floating point integers only

Convert Bytes to Floating Point Numbers WITHOUT using STRUCT

How to extract floating point numbers from strings surrounded by multiple characters?

how to input floating point numbers

How to sum of arrays of floating point numbers

Sum of Floating Point numbers in Objects. ( Typescript )

How to substract floating point numbers with high precision

How does casting from integers to floating-point numbers work?

Compare floating point numbers using regex in Bash

how to concatenate two lists in python with numbers and strings?

Power Query: Replace values without converting integers / whole numbers to floating point / decimal numbers?