Read the article there are a number of reasons why you may want to serialize code from transmission thru, time based processing thru to encryption protection of code.
You will note within the article they talk about C and C++ not having serialization but you can do it with a sort of standard form. Your code looks to me like that standard form. MFC has the same setup because it has serialized classes and even that is discussed in the wiki article.
Note MFC's main reason for serialization: "The technique is called differential execution. It is useful in the programming of user interfaces whose contents are time-varying — graphical objects can be created, removed, altered, or made to handle input events without necessarily having to write separate code to do those things."
You were saying you don't know why the original code was written like that and they won't let you change it. If you need the serialization it would indeed break the program if you write it a different way.
So I am suggesting you check if the code is indeed doing serialization. If it is and that serialization is still needed you can not change it even if you wanted to.
maybe I got now what you talk about
"Changing the class is not possible when transfered via serial... because of reconstruction is dependent of class structure"?
OK, this doesnt happen here, there is an extra struct that holds data to store and load.
What I know is, that the code was extended within years, adding more and more features to the software. The derived classes have more features and do some different calculations
e.g. B::M1() ... used in B, Ca1, Cb1 also Ca2, Cb2 ... ect is different to Cc1::M1(), Cc2::M1() ... etc.
class cat() : public animal
class dog() : public animal
class mops1() : public dog
class mops2() : public dog
class greyhound1() : public dog
class specialdog() : public dog
now we want to extent _some_ dogs to know how to barf()
for barf() we need some unctions of animal() (not all)
In my (otherwise) high DPI aware MFC application, I use a ribbon bar as the primary interface. I've provided high resolution (48x48) image strips, but when displaying on a high DPI (4k) monitor, these are not used.
I know I can trap a message when the DPI changes, and use this to rescale UI items (I do this for a few owner drawn aspects already to increase the font size), is there any way I can force CMFCRibbonBar to use the High DPI images?
You can create MFC or ATL programs with Visual Studio Community Edition or higher. If you do not select these components when you first install Visual Studio, you will be prompted to install them the first time you attempt to create or open an MFC or ATL project.
The link to download VS2015 community is right there for free.
Visual Studio Community 2015 with Update 3 - Free Downloads | Visual Studio[^]
Hello there. I am trying to encode some audio to mp3 format using libavcodec. This small utility was working fine untill lately. Now it has started giving me this weird runtime access violation reading location exception. I am showing following code to give you an idea
int ret = avcodec_encode_audio2(mp3_codec_context, &pkt, frame, &got_output);
// typeof(mp3_codec_context) = AVCodecContext
// typeof(pkt) = AVPacket
// typeof(frame) = AVFrame
// typeof(got_output) = int
When I debugged...I can see that none of the specified arguments are NULL. So, how do I know what is wrong and where ? Thanks for any input.
An access violation is not only thrown when a memory pointer is NULL. Often NULL pointers are even allowed as arguments.
In your case you have to check the members of the passed structures. See the documentation for the used function: FFmpeg: Encoding[^]. There is information about the structure members and links to the structure type descriptions. Note that you must not only check the buffer pointer members but also the size members and probably others. An access violation may for example occur when the size member indicates a size larger than the real buffer size.
The above link indicates also that the function is deprecated. If you have upgraded to a new FFmpeg version, consider to use replacement functions.