int i,n,m;
char m_strTemp[m];
SAFEARRAY FAR* bLogonPw;
SAFEARRAYBOUND rgsabound[n]; //n*m
for (i=0;i<n;i++) {
rgsabound[i].lLbound = 0;
rgsabound[i].cElements = sizeof(char)*m ; bLogonPw = SafeArrayCreate(VT_UI1, n, rgsabound); long lLBound = (m_tParam.m_BizPara.bLogonPw)->rgsabound[i].lLbound; for(long l = lLBound; l < m; l++)
{
SafeArrayPutElement(.bLogonPw, &l, &m_strTemp[l]);
}
...
}
char m_strTemp[m];
SAFEARRAY FAR* bLogonPw;
SAFEARRAYBOUND rgsabound[n]; //n*m
for (i=0;i<n;i++) {
rgsabound[i].lLbound = 0;
rgsabound[i].cElements = sizeof(char)*m ; bLogonPw = SafeArrayCreate(VT_UI1, n, rgsabound); long lLBound = (m_tParam.m_BizPara.bLogonPw)->rgsabound[i].lLbound; for(long l = lLBound; l < m; l++)
{
SafeArrayPutElement(.bLogonPw, &l, &m_strTemp[l]);
}
...
}
char m_strTemp[m];
SAFEARRAY FAR* bLogonPw;
SAFEARRAYBOUND rgsabound[n]; //n*mfor (i=0;i<n;i++){
rgsabound[i].lLbound = 0;
rgsabound[i].cElements = sizeof(char)*m ;
bLogonPw = SafeArrayCreate(VT_UI1, n, rgsabound);
long lLBound = (m_tParam.m_BizPara.bLogonPw)->rgsabound [i].lLbound;
for(long l = lLBound; l < m; l++)
{
SafeArrayPutElement(bLogonPw, &l, &m_strTemp[l]);
}
...
}
m_tParam.m_BizPara.bLogonPw//这个对象怎么没有定义
char m_strTemp[m];
SAFEARRAY FAR* bLogonPw;
SAFEARRAYBOUND rgsabound[n]; //n*mbLogonPw = SafeArrayCreate(VT_UI1, n, rgsabound);for (i=0;i<n;i++){
rgsabound[i].lLbound = 0;
rgsabound[i].cElements = sizeof(char)*m ;
//bLogonPw = SafeArrayCreate(VT_UI1, n, rgsabound);
//long lLBound = (m_tParam.m_BizPara.bLogonPw)-rgsabound.lLbound;
long lLBound = bLogonPw->rgsabound[i].lLbound;
for(long l = lLBound; l < m; l++)
{
SafeArrayPutElement(bLogonPw[i], &l, &m_strTemp[l]);
}
...
}have a try pls, I don't have VC in my machine now .tell me if there
is still any error.
SafeArrayPutElement(bLogonPw[i], &l, &m_strTemp[l]);没试过可能有点问题
其实关键是将&l改为Long L[2]={n,m};再用&l传入,就可以操作第n,m个元素了
其它没什么花活,我现在不明白的是怎样将这样一个n*m的数组传给vb用而不必告诉它数组的具体参数。