Re: VB Activex dll in VC++ with array parameter
this seems to work correctly (unluckily i still don't have the device
to properly try)
CoInitialize(NULL);
SAFEARRAY *psaOut = SafeArrayCreateVector(VT_BSTR, 0, 32);
try
{
HRESULT res;
Qpod_DLL::_cQPodPtr ptr;
res = ptr.CreateInstance("Qpod_DLL.cQPod");
if (res == S_OK)
long ret = ptr->FindQpods(&psaOut);
}
catch(_com_error &e)
{
TRACE1("Err: %s\n", e.Description());
}
CoUninitialize();
i only have this exception:
First-chance exception in activex.exe (KERNEL32.DLL): 0xC000008F:
Float Inexact Result.
On 4 Mar, 10:46, Andrea Visinoni <andrea.visin...@gmail.com> wrote:
I think it's more or less like the second example in:http://support.micro=
soft.com/kb/194873/en-us
but it's still not clear to me what are these:
yourserver::IYourObjectPtr
p(yourClassWizardGeneratedObject.m_lpDispatch);
On 4 Mar, 10:29, Goran <goran.pu...@gmail.com> wrote:
On Mar 4, 9:18 am, Andrea Visinoni <andrea.visin...@gmail.com> wrote:
The problem is that this is DLL come from a device and the only thing
i have is a useless pdf with
this prototype:
FindQpods (By Ref sSNArray(0 to 32)) [=lRtnVal]
and this info from a IDL file generated by OLE viewer (analyzing the
DLL)
[id(0x60030002)]
HRESULT FindQpods(
[in, out] SAFEARRAY(B=
STR)* SNArray,
;
the automatic procedure of VC++ 6.0 creating an IDispatch class to
interface to the DLL, failed on all the methods having arrays as
parameter.
You might try using #import, then call the method directly. E.g.
#import "yourserver.tlb" // or dll or exe
yourserver::IYourObjectPtr
p(yourClassWizardGeneratedObject.m_lpDispatch);
SAFEARRAY a = PrepareSafearrayWithStringsInIt();// (educated guess on
what FindQPods need)
long count;
p->FindQPods(&a, &count);
Goran.