MFC ActiveX Control, Trying to Pass String By Reference
Posted on 2005-04-12
I am writing an ActiveX Control in MFC I use the easiest method of class wizard for adding methods to COM Interface, anyway, I want to pass a string byref from my VB.net app to MFC ActiveX Control method.
I would like to know how can I accomplish this I can very easily pass integers and other variables but not Strings by ref, I achieved passing Strings by Val by using BSTR as a method typem but when using BSTR* it says Type Mismatch, I tried using VARIANT Type the MFC Method do recieved the value but when I try to modify it, it doesnt return the modified value, now I tried VARIANT* and that also gives type mismatch.
I need help. Moreover if u can tell me how to convert WCHAR to BSTR I have fixed length WCHAR array and I want to convert it to BSTR.
If any one of you knows about a resource which would be helpful in letting me know about all possible types going to MFC ActiveX from VB and viceversa I would be very thankful again.