programming problem (again) - Win32 api function failed

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

  • 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.

Howdy, Stranger!

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

Categories

In this Discussion