Click here to Skip to main content
15,882,802 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to release IDispatch memory. Pin
Sampath5797-Mar-18 2:45
Sampath5797-Mar-18 2:45 
AnswerRe: How to release IDispatch memory. Pin
Jochen Arndt7-Mar-18 3:10
professionalJochen Arndt7-Mar-18 3:10 
GeneralRe: How to release IDispatch memory. Pin
Sampath5798-Mar-18 18:40
Sampath5798-Mar-18 18:40 
GeneralRe: How to release IDispatch memory. Pin
Jochen Arndt8-Mar-18 21:21
professionalJochen Arndt8-Mar-18 21:21 
GeneralRe: How to release IDispatch memory. Pin
Sampath5798-Mar-18 22:27
Sampath5798-Mar-18 22:27 
GeneralRe: How to release IDispatch memory. Pin
Jochen Arndt8-Mar-18 22:55
professionalJochen Arndt8-Mar-18 22:55 
AnswerRe: How to release IDispatch memory. Pin
Randor 7-Mar-18 5:38
professional Randor 7-Mar-18 5:38 
Questionserializing an std::chrono::duration object with Boost Pin
Alexander Kindel7-Mar-18 2:12
Alexander Kindel7-Mar-18 2:12 
Why is it that in the following program, the value of newCount that prints at the end is 10, as I would expect, while the value of newTime.count() that prints is -3689348814741910324?

C++
#include "stdafx.h"
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <chrono>
#include <fstream>
#include <iostream>

namespace boost
{
	namespace serialization
	{
		template<class Archive>
		void serialize(Archive&ar, std::chrono::nanoseconds&time, const unsigned int version)
		{
			long long count{ time.count() };
			ar&count;
		}
	}
}

int main()
{
	std::chrono::nanoseconds time(10);
	long long count = time.count();
	{
		std::ofstream saveFile("filename");
		boost::archive::text_oarchive boostOutputArchieve(saveFile);		
		boostOutputArchieve << time;		
		boostOutputArchieve << count;
	}
	std::chrono::nanoseconds newTime;
	long long newCount;
	{
		std::ifstream loadFile("filename");
		boost::archive::text_iarchive boostInputArchieve(loadFile);
		boostInputArchieve >> newTime;
		boostInputArchieve >> newCount;
	}
	std::cout << newTime.count() << '\n' << newCount << '\n';
	return 0;
}


I would have thought setting up the serialize() overload for nanoseconds to serialize the tick count and using that would have the same result as serializing the tick count directly.
AnswerRe: serializing an std::chrono::duration object with Boost Pin
Alexander Kindel7-Mar-18 3:53
Alexander Kindel7-Mar-18 3:53 
GeneralRe: serializing an std::chrono::duration object with Boost Pin
Victor Nijegorodov7-Mar-18 4:31
Victor Nijegorodov7-Mar-18 4:31 
GeneralRe: serializing an std::chrono::duration object with Boost Pin
Alexander Kindel7-Mar-18 4:53
Alexander Kindel7-Mar-18 4:53 
GeneralRe: serializing an std::chrono::duration object with Boost Pin
Alexander Kindel7-Mar-18 4:36
Alexander Kindel7-Mar-18 4:36 
QuestionApplication launched by another program, how to debug? Pin
charlieg6-Mar-18 10:56
charlieg6-Mar-18 10:56 
AnswerRe: Application launched by another program, how to debug? Pin
Randor 6-Mar-18 15:29
professional Randor 6-Mar-18 15:29 
GeneralRe: Application launched by another program, how to debug? Pin
charlieg6-Mar-18 15:49
charlieg6-Mar-18 15:49 
GeneralRe: Application launched by another program, how to debug? Pin
Randor 6-Mar-18 17:20
professional Randor 6-Mar-18 17:20 
GeneralRe: Application launched by another program, how to debug? Pin
charlieg7-Mar-18 4:13
charlieg7-Mar-18 4:13 
AnswerRe: Application launched by another program, how to debug? Pin
Randor 7-Mar-18 5:36
professional Randor 7-Mar-18 5:36 
AnswerRe: Application launched by another program, how to debug? Pin
Richard MacCutchan6-Mar-18 22:39
mveRichard MacCutchan6-Mar-18 22:39 
GeneralRe: Application launched by another program, how to debug? Pin
charlieg7-Mar-18 4:15
charlieg7-Mar-18 4:15 
GeneralRe: Application launched by another program, how to debug? Pin
Richard MacCutchan7-Mar-18 4:35
mveRichard MacCutchan7-Mar-18 4:35 
QuestionImplication of assign a value at function entry Pin
ForNow6-Mar-18 8:13
ForNow6-Mar-18 8:13 
QuestionRe: Implication of assign a value at function entry Pin
Richard MacCutchan6-Mar-18 9:09
mveRichard MacCutchan6-Mar-18 9:09 
AnswerRe: Implication of assign a value at function entry Pin
ForNow6-Mar-18 9:25
ForNow6-Mar-18 9:25 
GeneralRe: Implication of assign a value at function entry Pin
Richard MacCutchan6-Mar-18 9:29
mveRichard MacCutchan6-Mar-18 9:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.