|
-
Jan 4th, 2001, 03:09 AM
#1
Thread Starter
Addicted Member
Goodday everybody...
Situation:
I created a project using ATL COM AppWizard. In the project, I created a ATL object called "VehicleDBManager".
Problem:
I want to creat a method for that ATL object which is:
HRESULT ReadVehicleTable([in] int nStatementId, [in] CString szParameterList, [in] _RecordsetPtr& pRecordset, [out] BOOL *ReturnVal)
but when I try to compile the project, the compiler prompts me the following error:
C:\Pims-Program\DBManager\DBManager.idl(18) : error MIDL2025 : syntax error : expecting a type specification near "CString"
Question:
Why I got this problem? Is it because I can't use CString data type, which is a MFC data type, when declaring the method? I try to change it to char* data type and it works, but the next error occur:
C:\Pims-Program\DBManager\DBManager.idl(18) : error MIDL2025 : syntax error : expecting a type specification near "_RecordsetPtr"
So, what should I do to solve this problem? Is it because of MFC or ...? Hopefully the solution won't have to be changing the data type. An explanation of why do this thing happen and solution will be most welcome.
Your help will be most appreciated...
P/S: By the way, I'm new to the world of COM and ATL.
-
Jan 8th, 2001, 09:05 PM
#2
Thread Starter
Addicted Member
no one really want to help?...
-
Jan 11th, 2001, 02:48 PM
#3
Frenzied Member
Did you enable support for MFC when you created the component with the ATL AppWiz?
-
Jan 16th, 2001, 03:32 AM
#4
Thread Starter
Addicted Member
-
Jan 24th, 2001, 06:42 PM
#5
Hyperactive Member
Hang on in there! I hope I can be of some assistance.
I use ATL COM a lot. I had some huge problems with it.
I'll see what I can do.
-
Jan 30th, 2001, 02:38 PM
#6
Member
Me Too
I'm using ATL COM too. I'm curious about the solution.
Samwise Galenorn
[email protected]
-
Jan 30th, 2001, 03:52 PM
#7
Monday Morning Lunatic
You can't use CString with COM since it's a C++ class, rather than an intrinsic type. Replace it with const TCHAR*, and use it as any normal Unicode character array.
Nasty, but that's the way it is with COM. Think about it - VB has no equivalent to CString, but it DOES have a means of accessing a character array
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 30th, 2001, 08:45 PM
#8
Thread Starter
Addicted Member
What about the type '_RecordsetPtr'?
What can I replace it with?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|