chait_anya 0 Newbie Poster

Hi.
I am having a problem.
I have created .TLB type library in c#. in my c# application i have decalred two functions which returns string and string array respectively.
Now, i am importing the type library into vc++ 6.0 application.
i have created the interface pointer and using that pointer i am accessing the functions in that interface.
I am getting first character of the returned string when i call that function.
for eg.
BSTR myArr;
HRESULT hr = ptrInterface->getString(&myArr);

in myArr i am getting only first char of entire string, so how to get entire string?

In second senario, my code is

SAFEARRAY * arr;
HRESULT hr = ptrInterface->getArray(&arr);

i am getting some address in arr but coulden't get the values in the returned array.

So can you please tell me solution for above problems with sample code????

thanx n regards.
chaitanya.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.