Click here to Skip to main content
15,892,697 members
Home / Discussions / COM
   

COM

 
GeneralRe: creating a reference to a com object Pin
shivapriyak20-Feb-07 21:02
shivapriyak20-Feb-07 21:02 
Questioncom -vb "error-70" Pin
aamn116-Feb-07 2:26
aamn116-Feb-07 2:26 
Questionerror "The stub received bad data" while calling CreateInstance function Pin
Sumesh V.V14-Feb-07 21:30
Sumesh V.V14-Feb-07 21:30 
AnswerRe: error "The stub received bad data" while calling CreateInstance function Pin
lafleon15-Feb-07 11:08
lafleon15-Feb-07 11:08 
Questionwant to close MSWord after sending e-mail via Outlook Pin
salman kazi13-Feb-07 19:47
salman kazi13-Feb-07 19:47 
QuestionTo Retrieve Path of a DLL file. Pin
georgekjolly12-Feb-07 19:44
georgekjolly12-Feb-07 19:44 
AnswerRe: To Retrieve Path of a DLL file. Pin
Stephen Hewitt13-Feb-07 11:18
Stephen Hewitt13-Feb-07 11:18 
QuestionProblem in Passing 1d array from VC++ to VB [modified] Pin
georgekjolly8-Feb-07 6:00
georgekjolly8-Feb-07 6:00 
Hi all,

I have a VB applicatiOn , which calls a function in VC++ DLL.

Arguement of function is a one dimensional string array.

Array will get filled in VC++ dll function.

I have written the programme given below.

But I am unable to get the array elements from VC++.

Programme is given below.

VC++ COM
/*****************************************/
STDMETHODIMP CTest111CL::myFun(SAFEARRAY **ppOutputArray)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())

HRESULT hresult;

SAFEARRAYBOUND aDim[1] ;

aDim[0].lLbound = 0;
aDim[0].cElements = 3;

BSTR HUGEP *pbstr;

*ppOutputArray = SafeArrayCreate(VT_BSTR , 1, aDim);

hresult=SafeArrayAccessData(*ppOutputArray,(void HUGEP**)&pbstr);

pbstr[0] = SysAllocString(OLESTR("SOURCE_VA"));
pbstr[1] = SysAllocString(OLESTR("ACV"));
pbstr[2] = SysAllocString(OLESTR("10"));

SafeArrayUnaccessData(*ppOutputArray);

return S_OK;
}
/**********************************************/

VB Application
---------------
''''''''''''''''''''''''''''
Dim i As Test111CL

Private Sub Command1_Click()

Dim arr_str(3) As String
Set i = New Test111CL
i.myFun arr_str()
MsgBox arr_str(1)
End Sub

''''''''''''''''''''''''''

MsgBox arr_str(1) , The message Box shows and empty string.

How can I rectify it. Please help me.

Thanks
George






-- modified at 4:53 Friday 9th February, 2007
AnswerRe: Problem in Passing 1d array from VC++ to VB Pin
lafleon9-Feb-07 10:58
lafleon9-Feb-07 10:58 
GeneralRe: Problem in Passing 1d array from VC++ to VB Pin
georgekjolly10-Feb-07 0:36
georgekjolly10-Feb-07 0:36 
AnswerRe: Problem in Passing 1d array from VC++ to VB Pin
lafleon9-Feb-07 11:10
lafleon9-Feb-07 11:10 
AnswerRe: Problem in Passing 1d array from VC++ to VB Pin
lafleon9-Feb-07 11:19
lafleon9-Feb-07 11:19 
QuestionEnumerate menu item identifiers of MS-Office apps. Can anybody help Pin
San24687-Feb-07 23:13
San24687-Feb-07 23:13 
QuestionPassing 3d string array from VC++ to VB Pin
georgekjolly7-Feb-07 3:43
georgekjolly7-Feb-07 3:43 
AnswerRe: Passing 3d string array from VC++ to VB Pin
prasad_som7-Feb-07 18:35
prasad_som7-Feb-07 18:35 
GeneralRe: Passing 3d string array from VC++ to VB Pin
georgekjolly7-Feb-07 19:49
georgekjolly7-Feb-07 19:49 
GeneralRe: Passing 3d string array from VC++ to VB Pin
prasad_som7-Feb-07 20:06
prasad_som7-Feb-07 20:06 
GeneralRe: Passing 3d string array from VC++ to VB(Please Consider) Pin
georgekjolly8-Feb-07 1:17
georgekjolly8-Feb-07 1:17 
AnswerRe: Passing 3d string array from VC++ to VB(Please Consider) Pin
prasad_som8-Feb-07 1:40
prasad_som8-Feb-07 1:40 
GeneralRe: Passing 3d string array from VC++ to VB(Please Consider) Pin
georgekjolly8-Feb-07 4:55
georgekjolly8-Feb-07 4:55 
QuestionRemotely Starting a Process Pin
abhiramsss7-Feb-07 3:01
abhiramsss7-Feb-07 3:01 
QuestionImplement IDispEventSimpleImpl Interface to Handle Event, Function calls two times Pin
Shyam Gaikwad5-Feb-07 19:39
Shyam Gaikwad5-Feb-07 19:39 
Questionabout COM Pin
joyce_pro5-Feb-07 15:22
joyce_pro5-Feb-07 15:22 
AnswerRe: about COM Pin
host285-Feb-07 16:04
host285-Feb-07 16:04 
QuestionATING Network module Pin
Member 35534024-Feb-07 19:27
Member 35534024-Feb-07 19:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.