Yes, what I did was in the 2nd dialog there will be a list view control already populated with the database data when a button is clicked in the 1st dialog. when I click one of the row in the 2nd dialog list view control, 3rd dialog will pop up where I'll enter some data which will be updated to the database and then I delete all the items in the 2nd dialog list view controlled and tries to repopulate again with the updated data in the database.
MedicineObj.ResetListControl(); / <-----when this function was called exception was thrown/
What is this MedicineObj? Where and how is it defined?
(short) is just a type cast. All it does is tell the compiler to interpret the value as a different type. The value in this case is just the single character itshort. What you intended to do was something dofferent: you wanted the computer to reinterpret the memory starting at itshort. But there is no way for the compiler to understand that is what you want.
As others pointed out, there are ways to achieve this. However, why don't you simple use short or unsigned short?
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
The code I write here on Windows I am hoping to execute on Z/OS as well using XL C\C++ compiler I have ensure that int, short, and long sizes are consistent I will regardless have a number #ifdef zos and #ifdef MSVC for the I/O reads etc besides that I have to do memory moves in big endian as its a z/os mainframe file I am processing
Again you are reinventing the wheel the traditional way to deal with Endian is via the standard ints and you simply do eandian aware reads from files. The output from the reads being big_int16_t or big_uint16_t which are big endian versions.