Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

programming problem (again) - Win32 api function failed

ray55ray55 Posts: 5Member
Thanks for answering my questions. I don't program very often, but when I do it can become quite messy. I was able to produce a stand-alone executable with Borland c++ builder, but when executing it on another machine, I receive this Windows error:

ComboBox82->Items.Strings: A Win32 API function failed.

I looked over the program, and can't find any coding errors. Due to my limited programming experience, this Windows error is a complete mystery to me. Please help.




Comments

  • bilderbikkelbilderbikkel Posts: 754Member
    Instead of
    [code]
    : ComboBox82->Items.Strings: A Win32 API function failed.
    [/code]

    use

    [code]
    #include
    assert(ComboBox82!=0); //Just a check

    const int maxIndex = ComboBox82->Items->Count;
    const int index = std::rand()%maxIndex;
    ComboBox82->Items->operator [](index);
    [/code]

    Have fun,
    bilderbikkel

Sign In or Register to comment.