Home » U++ Library support » U++ Core » Crash on LoadFromFile
Crash on LoadFromFile [message #11914] |
Mon, 01 October 2007 03:54 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
Proceeding with U++ usage led me to another strange moment, which I couldn`t solve with docs&forum search.
Loading config in a closest to examples manner, crashes application with assert in debug mode:
May be I`m doing something wrong, but I don`t see any difference between my code and docs-how-it`s-done-right:
#define CONFIG_FILE "config."
struct Config
{
wxBaud baud;
wxParity parity;
int com;
int wordlen;
int stopbits;
int addr;
void Serialize(Stream& s)
{
s.Put(&baud, sizeof(baud));
s.Put(&parity, sizeof(parity));
s % com % wordlen % stopbits % addr;
}
};
Config config;
void Kran::LoadAndInit()
{
if (!LoadFromFile(config, ConfigFile(CONFIG_FILE)))
{
config.baud = wxBAUD_38400;
config.com = 1;
config.parity = wxPARITY_NONE;
config.wordlen = 8;
config.stopbits = 1;
config.addr = 1;
}
This code causes assertion in LoadFromFile.
Could you please help with this?
-
Attachment: upp2.jpg
(Size: 20.21KB, Downloaded 512 times)
[Updated on: Mon, 01 October 2007 03:56] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 20 02:58:32 CEST 2024
Total time taken to generate the page: 0.02271 seconds
|