BDS2007 Variant gets Cleared, "Invalid Variant Type" error dialog : c++
This is a discussion on BDS2007 Variant gets Cleared, "Invalid Variant Type" error dialog within the c++ forums in Programming Languages category; I have some code that clears a Variant and then passes it in a method at a later time. The call fails before any code is executed within the failing method with an error dialog "Invalid variant type". I have not found any reports yet of problems related to my problem so I thought I would ask if anyone else is having problems with Variants using BDS2007 under Windows XP service pack 2. Larry Griffiths....
| c++ comp.lang.c++ usenet archive |
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| later time. The call fails before any code is executed within the failing method with an error dialog "Invalid variant type". I have not found any reports yet of problems related to my problem so I thought I would ask if anyone else is having problems with Variants using BDS2007 under Windows XP service pack 2. Larry Griffiths. |
|
#2
| |||
| |||
| More Information... I am using the Variant with the __property statement. It appears that I am getting a new instance of the Variant which is not initialized from the Property Getter method. I am changing the __property to do a direct move of the variable in the __property "read=" qualifier. If that does not work then I will move the private variable to the public section of the class and drop its use in the property statement. The question now becomes "Is it ok to use variants in a property statement?" Larry Griffiths "Larry Griffiths" <nospame@nowhere.com> wrote in message news:486a6b0e$1@newsgroups.borland.com... >I have some code that clears a Variant and then passes it in a method at a >later time. > > The call fails before any code is executed within the failing method with > an error dialog "Invalid variant type". > > I have not found any reports yet of problems related to my problem so I > thought I would ask > if anyone else is having problems with Variants using BDS2007 under > Windows XP service pack 2. > > Larry Griffiths. > |
|
#3
| |||
| |||
| This may not be a problem with variants. After a couple of days of debugging I have found a class that shows its variable values are ok when inspecting them in the object inspector inside of the class but are offset when inspecting the variables outside of the class. I have looked at data alignment parameters and looked for duplicate headers for the class ect. but have not found anything yet. There is some assembler code that I have traced that is loading a pointer to an instance of the class that is offset by 0x10 from where the class pointer should actually be. This may turn into one of those week long debugging episodes. Larry Griffiths. "Larry Griffiths" <nospame@nowhere.com> wrote in message news:486a6b0e$1@newsgroups.borland.com... >I have some code that clears a Variant and then passes it in a method at a >later time. > > The call fails before any code is executed within the failing method with > an error dialog "Invalid variant type". > > I have not found any reports yet of problems related to my problem so I > thought I would ask > if anyone else is having problems with Variants using BDS2007 under > Windows XP service pack 2. > > Larry Griffiths. > |
|
#4
| |||
| |||
| The problem is fixed now. We set all of our Project options to use "Integer sized enums". I did not research any further to determine why one unit thinks an included header has byte sized enums and a different unit thinks the same included header has integer sized enums. I suppose there could be a #pragma pop missing somewhere. Now we get to see if any problems occur switching all of our code over to integer sized integers. Yikes! Cross my fingers, knock on wood, you know the routine. LOL Larry Griffiths. |


