This forum has been archived. Please start a new discussion on GitHub.

How can i use the function getpropertyforprefix()?

I want get the parameters from my config file,following is the code:
1. Ice::PropertiesPtr properties;
2. Ice::PropertyDict proDict;
3. properties = Ice::createProperties();
4. properties->load(path);
5. proDict = properties->getPropertiesForPrefix("filesystem");

when arrives at line 5,the program throws out an exception.
But when I use function properties->getPropertyAsIntWithDefault(segName + "." + key,defVal) ,there is no error.
can you give me some help??


  • What kind of exception does it throw?
  • haha


    I have got it.
    If the program runs in the state of debugging,It throws out exception.
    But if it runs normally,it is ok!!

    your sincerely
  • xdm
    xdm La Coruña, Spain
    Hi terminate

    can you say what exception is raised?
    with out this info is dificult help you
  • Hi,
    Because I don't know which exception is throwed out,I can't describe it.
    The programm just pops up a message box of system, which show in the attachment.
  • Since you only get the error in debug mode, the problem might be caused by a library mix-up. See this FAQ for more details.
  • xdm
    xdm La Coruña, Spain
    Provaly your problem is caused by a library mixup, this is the most common cause for a program to work in release and not in debug mode or viceversa

    read this faq for more info about the problem