receiving a Boolean type in VB
-
Hi ! I'm still beginning with COM ! I'd like to do a very simple ATL component with Visual C++. The interface of this component would implement only one method, which would return a boolean value. This value would be read from a Visual Basic app. The problem is when I use the 'boolean' type for my interface, VB doesn't recognize it. I tried to use the 'short' type, but VB recognize it as an Integer. What type should I use in my ATL interface so that VB receives a 'Boolean' type ? Thank you for your help, Jerome
-
Hi ! I'm still beginning with COM ! I'd like to do a very simple ATL component with Visual C++. The interface of this component would implement only one method, which would return a boolean value. This value would be read from a Visual Basic app. The problem is when I use the 'boolean' type for my interface, VB doesn't recognize it. I tried to use the 'short' type, but VB recognize it as an Integer. What type should I use in my ATL interface so that VB receives a 'Boolean' type ? Thank you for your help, Jerome
-
Hi ! I'm still beginning with COM ! I'd like to do a very simple ATL component with Visual C++. The interface of this component would implement only one method, which would return a boolean value. This value would be read from a Visual Basic app. The problem is when I use the 'boolean' type for my interface, VB doesn't recognize it. I tried to use the 'short' type, but VB recognize it as an Integer. What type should I use in my ATL interface so that VB receives a 'Boolean' type ? Thank you for your help, Jerome
Just more Info for you. In C++, TRUE is +1, but VB and automation clients use TRUE as -1 and FALSE as +1. If you use BOOL, all you can see is clouds of confusion over your application. so use VARIANT_BOOL(boolean type), VARIANT_TRUE(true),VARINAT_FALSE(false) Whenever you are using C++(COM), you should avoid using bool, BOOL in your application. Cheers, Anand:-D