Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Question About Matlab COM builder and VC++ 6.0

Status
Not open for further replies.

quangdien

Newbie level 3
Joined
Nov 13, 2005
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Vietnam
Activity points
1,335
Hi everybody,

Let me introduce myself. My name is Quang Dien, a Vietnamese students. This term, I have to do a project about the fingerprint detecting.
About my profect, I had a source code on MATLAB, it can run on MATLAB perfectly. But, my program is written by VC++ 6.0, so, I have to use MATLAB COM Builder to build a component to use in VC++. I use MATLAB 6.5 R13 comtool to build it. "Standalone built completed !" , no problems. But, when I call it in VC++, no thing happen ! No error but no reaction. The input parameter is the same with itself when initializing. About my function, I can summarize for you as below :

Function score = cubs_match(input_file1, input_file2)

where :
input_file1 : the string holds the path to the fingerprint image1
input_file2 : the string holds the path to the fingerprint image2
score : a number between 0 to 100, show how much do 2 fingerprint images look like rach others.

When I built it, I use VC++ 6.0 call it as below :

// --> Set the input arguments to the COM method
VARIANT f1_Variant, f2_Variant;
VariantInit(&f1_Variant);
f1_Variant.vt = VT_BSTR;
f1_Variant.bstrVal = SysAllocString(L"C:/MATLAB6p5/work/Fingerprint/1_1.fp");
VariantInit(&f2_Variant);
f2_Variant.vt = VT_BSTR;
f2_Variant.bstrVal = SysAllocString(L"C:/MATLAB6p5/work/Fingerprint/1_2.fp");
// --> Set the output arguments to the COM method
VARIANT result;
// --> Create an instance of the COM object
IFingerprintClass *pImyclass;
hr=CoCreateInstance(CLSID_FingerprintClass,NULL, CLSCTX_INPROC_SERVER, IID_IFingerprintClass, (void **)&pImyclass);
// --> Access the method with arguments and receive the output out1
hr = (pImyclass -> cubs_match(1, &result, f1_Variant, f2_Variant));
// --> Print the result
CString Show_Screen;
Show_Screen.Format("Matching score : %g",result.dblVal );
MessageBox(Show_Screen);

Note : + My component has the name as "Fingerprint" and the Class name is "FingerprintClass"
+ The *.fp format is my own format.
But when run it, the result doesn't change. It return : -9.25596e+061

What is my problem ? How to solve it ? Please kindly answer for me if you know about my problems ...
Thanks a lot.
Best regards,

Quang Dien
____________________
PS : + Please reply your ans to me to : quangdien12jan@yahoo.com
+ About the Fingerprint Toolbox, you can download it form mathworks.com, search for "fingerprint recognition toolbox"
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top