![]() |
|
![]() | ||
|
Subject:
Building Automation DLL's which have properties that return objects.
Category: Computers > Programming Asked by: boluc-ga List Price: $10.00 |
Posted:
21 Jun 2002 07:23 PDT
Expires: 24 Jun 2002 01:56 PDT Question ID: 31158 |
I am trying to write an MFC DLL using MS Visual C++ 6.0. I want it to be automation enabled so that I can reference it from VB or VBA and use its methods and properties. One of the properties I want a class I create (FTPSession) to have will be File, which will return a FTPFile object (also defined in that project). I know it is possible because I have seen automation libraries which do that, e.g. the fields property of the recordset object returns a field object. I create a project using ATL wizard and create my interfaces without any problem, I add a property that returns ([out, retval]) a CFTPFile pointer. When I start to build the DLL the MIDL stops with an error saying that 'error MIDL2025 : syntax error : expecting a type specification near "CFTPFile"' Obviously meaning it cannot recognize my class name. What should I do? | |
| |
| |
|
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: Building Automation DLL's which have properties that return objects.
From: danielearwicker-ga on 22 Jun 2002 13:18 PDT |
The problem is in the IDL file. It can't refer to C++ class names, only IDL interface names. The interface of the FTPFile object is probably called IFTPFile. That's what you need to put as the output parameter type in the IDL file. |
Subject:
Re: Building Automation DLL's which have properties that return objects.
From: boluc-ga on 23 Jun 2002 22:57 PDT |
Regarding danielearwicker's comment: Tried that, doesn't work. Even if it did, how can I return a IFTPFile or *IFTPFile from the property function? There is no function linking CFTPFile to IFTPFile, or is there? |
Subject:
Re: Building Automation DLL's which have properties that return objects.
From: boluc-ga on 24 Jun 2002 01:55 PDT |
After posting the previous comment I cut and pasted the positions of the classes in the IDL file. Once the interfaces were declared in their hierarchical order, it built the file. Thanks to danielearwicker. However, I still don't know how to return a pointer to IFTPFile pointer (IFTPFile **) from the CFTPFile class. Can anyone help? |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |