Home Help Center

How can i use the function getpropertyforprefix()?

terminateterminate Member Jone QuOrganization: iFisher CO.,LTDProject: Process Control System for Hot Furnace in Shandong
Hi:
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??

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    What kind of exception does it throw?
  • terminateterminate Member Jone QuOrganization: iFisher CO.,LTDProject: Process Control System for Hot Furnace in Shandong
    haha

    Hi:

    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
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi terminate

    can you say what exception is raised?
    with out this info is dificult help you
  • terminateterminate Member Jone QuOrganization: iFisher CO.,LTDProject: Process Control System for Hot Furnace in Shandong
    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.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    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.
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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
Sign In or Register to comment.