Skip to main content
gamedev.net
🔒 Locked

COM ATL programming

Started by cutesiham 3 replies 550+ views
Original Post
cutesiham
cutesiham
Hi i have a problem in my COM ATL Programming. (I m writing OCX file for VB) can i have a function return multiple value? Let say i have function named CalcVariance(a,avg,var) which takes in 3 arguments and it is supposed to return the value of avg and var. so in the idl file, i wrote [id(19), helpstring("method CalcVariance")] HRESULT CalcVariance([in]vObjFeatures vFeature, [out]double* pAvg,[out]double* pVar); Hence, did i declare the right thing? in Vb i call using this way: Dim nAvg,nVar as double VsBlobObject1.FeatureVariance i, nAvg, nVar But the VB code couldn''t execute the function as it gave me "Type Mismatch" error code. so can anyone teach me how to write this function.... from damian
Shannon Barber
Shannon Barber
What is vObjFeatures?
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
cutesiham
cutesiham
the "vObjFeatures" is the enum value. integer type.

this variable doesn;t give me the error.
Solo
Solo
The IDL definition you posted is for a method called CalcVariance. The VB code you posted calls FeatureVariance. Typo?

[edited by - Solo on January 18, 2003 5:30:03 PM]
// Ryan
cutesiham
cutesiham
Ouuuppps...sorry..it is typo mistake.

It should be
in Vb i call using this way:
Dim nAvg,nVar as double
VsBlobObject1.CalcVariance i, nAvg, nVar


thanks

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.