How to pass an object from C++

Hello!

We have a C# asp.net web application that is using a COM dll
We use the tlbimp to be able to use the COM dll from C# asp.net web 
application
The method InitRules shown below is located in the COM dll.
It can be seen below the text Original.
Method InitRules below is called from C# but we want to pass an object of 
type Handle_DS in addition
to all the other parameters. You can see the modified InitRules below marked 
Modified

Note the object of type Handle_DS is a C++ object that is created from C# 
asp.net application and pass
into the InitRules

I have also copied the whole idl file that you can see below.
I have changed in the idl file where InitRules is defined is this way
[helpstring("method InitRules")] HRESULT InitRules([in] Handle_DS handleDS, 
[in] BSTR Provider,[in] BSTR DataSource,[in] BSTR UserId,[in] BSTR 
Password,[in] BSTR ProductID,[in] BSTR Revision,[in] BSTR ApplicationID,[in] 
BSTR ApplicationRev,[in] BSTR SubfileID,[out,retval] VARIANT_BOOL *bRes);

I have also changed in the *.h file and in the *.cpp file

In the idl file as you can see I have just added [in] Handle_DS handleDS as 
the first parameter to InitRules but
it was not as easy as that. I assume I must do more things in the idl file.
I'm a C# developer so my knowledge about COM is bad.

The compile error I get is the following:
error MIDL2025: syntax error : expecting a type specification near 
"Handle_DS"

I hope somebody can tell me what to change in the idl file if the problem is 
there.

//Modified
STDMETHODIMP CSyntaxObj::InitRules(Handle_DS handlDS, BSTR Provider, BSTR 
DataSource, BSTR UserId, BSTR Password,   BSTR ProductID, BSTR Revision, 
BSTR ApplicationID, BSTR ApplicationRev, BSTR SubfileID, VARIANT_BOOL *bRes)


//Original
STDMETHODIMP CSyntaxObj::InitRules(BSTR Provider, BSTR DataSource, BSTR 
UserId, BSTR Password,   BSTR ProductID, BSTR Revision, BSTR ApplicationID, 
BSTR ApplicationRev, BSTR SubfileID, VARIANT_BOOL *bRes)


// DTHToolObjects.idl : IDL source for DTHToolObjects.dll
//

// This file will be processed by the MIDL tool to
// produce the type library (DTHToolObjects.tlb) and marshalling code.

import "oaidl.idl";
import "DLGTools.idl";
import "DTHToolsEx.idl";

 [
  object,
  uuid(29436E27-1873-4E12-80CB-2EC7E3113684),

  helpstring("IParamItem Interface"),
  pointer_default(unique)
 ]
 interface IParamItem : IUnknown
 {

  [propget, helpstring("property mOrigParam")] HRESULT mOrigParam([out, 
retval] BSTR *pVal);
  [propput, helpstring("property mOrigParam")] HRESULT mOrigParam([in] BSTR 
pVal);
  [propget, helpstring("property mStartPos")] HRESULT mStartPos([out, 
retval] long *pVal);
  [propput, helpstring("property mStartPos")] HRESULT mStartPos([in] long 
pVal);
  [propget, helpstring("property mStartValue")] HRESULT mStartValue([out, 
retval] long *pVal);
  [propput, helpstring("property mStartValue")] HRESULT mStartValue([in] 
long pVal);
  [propget, helpstring("property mEndValue")] HRESULT mEndValue([out, 
retval] long *pVal);
  [propput, helpstring("property mEndValue")] HRESULT mEndValue([in] long 
pVal);
  [propget, helpstring("property mSelStart")] HRESULT mSelStart([out, 
retval] long *pVal);
  [propput, helpstring("property mSelStart")] HRESULT mSelStart([in] long 
pVal);
  [propget, helpstring("property mSelLength")] HRESULT mSelLength([out, 
retval] long *pVal);
  [propput, helpstring("property mSelLength")] HRESULT mSelLength([in] long 
pVal);
  [propget, helpstring("property mStep")] HRESULT mStep([out, retval] long 
*pVal);
  [propput, helpstring("property mStep")] HRESULT mStep([in] long pVal);
  [propget, helpstring("property mErr")] HRESULT mErr([out, retval] 
VARIANT_BOOL *pVal);
  [propput, helpstring("property mErr")] HRESULT mErr([in] VARIANT_BOOL 
pVal);
  [propget, helpstring("property mErrStart")] HRESULT mErrStart([out, 
retval] long *pVal);
  [propput, helpstring("property mErrStart")] HRESULT mErrStart([in] long 
pVal);
  [propget, helpstring("property mErrLength")] HRESULT mErrLength([out, 
retval] long *pVal);
  [propput, helpstring("property mErrLength")] HRESULT mErrLength([in] long 
pVal);
  [propget, helpstring("property mErrText")] HRESULT mErrText([out, retval] 
BSTR *pVal);
  [propput, helpstring("property mErrText")] HRESULT mErrText([in] BSTR 
pVal);
  [propget, helpstring("property mChanged")] HRESULT mChanged([out, retval] 
VARIANT_BOOL *pVal);
  [propput, helpstring("property mChanged")] HRESULT mChanged([in] 
VARIANT_BOOL pVal);
  [propget, helpstring("property mParameterValue")] HRESULT 
mParameterValue([out, retval] BSTR *pVal);
  [propput, helpstring("property mParameterValue")] HRESULT 
mParameterValue([in] BSTR pVal);
  [propget, helpstring("property mStructID")] HRESULT mStructID([out, 
retval] long *pVal);
  [propput, helpstring("property mStructID")] HRESULT mStructID([in] long 
pVal);
  [propget, helpstring("property mParameter")] HRESULT mParameter([out, 
retval] BSTR *pVal);
  [propput, helpstring("property mParameter")] HRESULT mParameter([in] BSTR 
pVal);
  [propget, helpstring("property mDuplicate")] HRESULT mDuplicate([out, 
retval] long *pVal);
  [propput, helpstring("property mDuplicate")] HRESULT mDuplicate([in] long 
pVal);
  [propget, helpstring("property mFeatureID")] HRESULT mFeatureID([out, 
retval] BSTR *pVal);
  [propput, helpstring("property mFeatureID")] HRESULT mFeatureID([in] BSTR 
pVal);
  [propget, helpstring("property mParameterType")] HRESULT 
mParameterType([out, retval] BSTR *pVal);
  [propput, helpstring("property mParameterType")] HRESULT 
mParameterType([in] BSTR pVal);
  [propget, helpstring("property mFormStructureType")] HRESULT 
mFormStructureType([out, retval] BSTR *pVal);
  [propput, helpstring("property mFormStructureType")] HRESULT 
mFormStructureType([in] BSTR pVal);
  [propget, helpstring("property mSeperator")] HRESULT mSeperator([out, 
retval] BSTR *pVal);
  [propput, helpstring("property mSeperator")] HRESULT mSeperator([in] BSTR 
pVal);
  [propget, helpstring("property mMandatory")] HRESULT mMandatory([out, 
retval] VARIANT_BOOL *pVal);
  [propput, helpstring("property mMandatory")] HRESULT mMandatory([in] 
VARIANT_BOOL pVal);
  [propget, helpstring("property mRepetitional")] HRESULT 
mRepetitional([out, retval] BSTR *pVal);
  [propput, helpstring("property mRepetitional")] HRESULT mRepetitional([in] 
BSTR pVal);
  [propget, helpstring("property mID")] HRESULT mID([out, retval] BSTR 
*pVal);
  [propput, helpstring("property mID")] HRESULT mID([in] BSTR pVal);
 };
 [
  object,
  uuid(BBC9DE62-5683-461B-8C06-AEB7212290E3),

  helpstring("IParamList Interface"),
  pointer_default(unique)
 ]
 interface IParamList : IUnknown
 {
  [propget, helpstring("property Count")] HRESULT Count([out, retval] LONG 
*pVal);
  //[helpstring("method AddParam")] HRESULT AddParam([in]BSTR Param, [out, 
retval]VARIANT_BOOL* bRetval);
  [helpstring("method MoveFirst")] HRESULT MoveFirst([out, 
retval]VARIANT_BOOL* bRetval);
  [helpstring("method GetNextItem")] HRESULT GetNextItem([out]IParamItem** 
ppItem, [out,retval] VARIANT_BOOL* bResult);
  [helpstring("method Clear")] HRESULT Clear([out, retval]VARIANT_BOOL* 
bRetval);
  [helpstring("method GetitemAt")] HRESULT GetitemAt([in]LONG lIndex, 
[out]IParamItem **ppItem, [out, retval]VARIANT_BOOL *bResult);
  [helpstring("method AddParam")] HRESULT AddParam([in]BSTR OrigParam, 
[in]LONG StartPos, [in]LONG StartValue, [in]LONG EndValue, [in]LONG 
SelStart, [in]LONG SelLength, [in]LONG Step, [in]VARIANT_BOOL  Err,[in]LONG 
ErrStart, [in]LONG ErrLength, [in]BSTR ErrText, [in]VARIANT_BOOL Changed, 
[in]BSTR ParameterValue, [in]LONG StructID, [in]BSTR Seperator, [in]BSTR 
Parameter, [in]LONG Duplicate, [in]BSTR FeatureID, [in]BSTR ParameterType, 
[in]BSTR FormStructureType, [in]VARIANT_BOOL Mandatory, [in]BSTR 
Repetitional, [out, retval]VARIANT_BOOL *pbRetval);
  [helpstring("method ResetStructID")] HRESULT ResetStructID([out,retval] 
VARIANT_BOOL *RetVal);
 };

 [
  object,
  uuid(644F68F3-3EC4-40C3-AE67-3121815A26D2),

  helpstring("ISubfileLineItem Interface"),
  pointer_default(unique)
 ]
 interface ISubfileLineItem : IUnknown
 {
  [propget, helpstring("property mOldLsgSeq")] HRESULT mOldLsgSeq([out, 
retval] long *pVal);
  [propput, helpstring("property mOldLsgSeq")] HRESULT mOldLsgSeq([in] long 
newVal);
  [propget, helpstring("property mLsgSeq")] HRESULT mLsgSeq([out, retval] 
long *pVal);
  [propput, helpstring("property mLsgSeq")] HRESULT mLsgSeq([in] long 
newVal);
  [propget, helpstring("property mSflSeq")] HRESULT mSflSeq([out, retval] 
long *pVal);
  [propput, helpstring("property mSflSeq")] HRESULT mSflSeq([in] long 
newVal);
  [propget, helpstring("property mSubfileLineType")] HRESULT 
mSubfileLineType([out, retval] BSTR *pVal);
  [propput, helpstring("property mSubfileLineType")] HRESULT 
mSubfileLineType([in] BSTR newVal);
  [propget, helpstring("property mSubFileID")] HRESULT mSubFileID([out, 
retval] BSTR *pVal);
  [propput, helpstring("property mSubFileID")] HRESULT mSubFileID([in] BSTR 
newVal);
  [propget, helpstring("property mCommand")] HRESULT mCommand([out, retval] 
BSTR *pVal);
  [propput, helpstring("property mCommand")] HRESULT mCommand([in] BSTR 
newVal);
  [propget, helpstring("property mFormat")] HRESULT mFormat([out, retval] 
long *pVal);
  [propput, helpstring("property mFormat")] HRESULT mFormat([in] long 
newVal);
  [propget, helpstring("property mValidated")] HRESULT mValidated([out, 
retval] VARIANT_BOOL *pVal);
  [propput, helpstring("property mValidated")] HRESULT mValidated([in] 
VARIANT_BOOL newVal);
  [propget, helpstring("property mSubHeader")] HRESULT mSubHeader([out, 
retval] BSTR *pVal);
  [propput, helpstring("property mSubHeader")] HRESULT mSubHeader([in] BSTR 
newVal);
  [propget, helpstring("property mComment")] HRESULT mComment([out, retval] 
BSTR *pVal);
  [propput, helpstring("property mComment")] HRESULT mComment([in] BSTR 
newVal);
  [propget, helpstring("property mTag")] HRESULT mTag([out, retval] BSTR 
*pVal);
  [propput, helpstring("property mTag")] HRESULT mTag([in] BSTR newVal);
  [propget, helpstring("property mGenerated")] HRESULT mGenerated([out, 
retval] BSTR *pVal);
  [propput, helpstring("property mGenerated")] HRESULT mGenerated([in] BSTR 
newVal);
  [propget, helpstring("property mDbCommand")] HRESULT mDbCommand([out, 
retval] BSTR *pVal);
  [propput, helpstring("property mDbCommand")] HRESULT mDbCommand([in] BSTR 
newVal);
  [propget, helpstring("property mDbComment")] HRESULT mDbComment([out, 
retval] BSTR *pVal);
  [propput, helpstring("property mDbComment")] HRESULT mDbComment([in] BSTR 
newVal);
  [propget, helpstring("property mErrStart")] HRESULT mErrStart([out, 
retval] long *pVal);
  [propput, helpstring("property mErrStart")] HRESULT mErrStart([in] long 
newVal);
  [propget, helpstring("property mErrLength")] HRESULT mErrLength([out, 
retval] long *pVal);
  [propput, helpstring("property mErrLength")] HRESULT mErrLength([in] long 
newVal);
  [propget, helpstring("property mErrText")] HRESULT mErrText([out, retval] 
BSTR *pVal);
  [propput, helpstring("property mErrText")] HRESULT mErrText([in] BSTR 
newVal);
  [propget, helpstring("property mErr")] HRESULT mErr([out, retval] 
VARIANT_BOOL *pVal);
  [propput, helpstring("property mErr")] HRESULT mErr([in] VARIANT_BOOL 
newVal);
  [propget, helpstring("property mDCErr")] HRESULT mDCErr([out, retval] 
VARIANT_BOOL *pVal);
  [propput, helpstring("property mDCErr")] HRESULT mDCErr([in] VARIANT_BOOL 
newVal);
  [propget, helpstring("property mParamErr")] HRESULT mParamErr([out, 
retval] VARIANT_BOOL *pVal);
  [propput, helpstring("property mParamErr")] HRESULT mParamErr([in] 
VARIANT_BOOL newVal);
  [propget, helpstring("property mGotStructure")] HRESULT 
mGotStructure([out, retval] VARIANT_BOOL *pVal);
  [propput, helpstring("property mGotStructure")] HRESULT mGotStructure([in] 
VARIANT_BOOL newVal);
  [propget, helpstring("property mChanged")] HRESULT mChanged([out, retval] 
VARIANT_BOOL *pVal);
  [propput, helpstring("property mChanged")] HRESULT mChanged([in] 
VARIANT_BOOL newVal);
  [propget, helpstring("property mParamChanged")] HRESULT 
mParamChanged([out, retval] VARIANT_BOOL *pVal);
  [propput, helpstring("property mParamChanged")] HRESULT mParamChanged([in] 
VARIANT_BOOL newVal);
  [propget, helpstring("property mInDatabase")] HRESULT mInDatabase([out, 
retval] VARIANT_BOOL *pVal);
  [propput, helpstring("property mInDatabase")] HRESULT mInDatabase([in] 
VARIANT_BOOL newVal);
  [propget, helpstring("property mReplace")] HRESULT mReplace([out, retval] 
VARIANT_BOOL *pVal);
  [propput, helpstring("property mReplace")] HRESULT mReplace([in] 
VARIANT_BOOL newVal);
  [propget, helpstring("property mOrigCommand")] HRESULT mOrigCommand([out, 
retval] BSTR *pVal);
  [propput, helpstring("property mOrigCommand")] HRESULT mOrigCommand([in] 
BSTR newVal);
  [propget, helpstring("property mStructured")] HRESULT mStructured([out, 
retval] long *pVal);
  [propput, helpstring("property mStructured")] HRESULT mStructured([in] 
long newVal);
  [propget, helpstring("property mID")] HRESULT mID([out, retval] BSTR 
*pVal);
  [propput, helpstring("property mID")] HRESULT mID([in] BSTR newVal);
  [helpstring("method AddParameters")] HRESULT AddParameters([in] BSTR 
lParam,[out, retval] VARIANT_BOOL* bRes);
  [helpstring("method AddParameters2")] HRESULT AddParameters2([in] BSTR 
lParam, [in] LPSTR lpParameterIDs, [out, retval] VARIANT_BOOL* bRes);
  [helpstring("method GetParamList")] HRESULT GetParamList([out]IParamList** 
ppParamList, [out, retval]VARIANT_BOOL* bResult);
  [helpstring("method GetBuildCmd")] HRESULT GetBuildCmd([out] BSTR* 
Command, [out, retval] VARIANT_BOOL* bRes);
  [helpstring("method ReturnCopy")] HRESULT 
ReturnCopy([out]ISubfileLineItem** ppItem, [in]VARIANT_BOOL After, [out, 
retval]VARIANT_BOOL* bResult);
  [helpstring("method GetSubHeaderText")] HRESULT GetSubHeaderText([out] 
BSTR* pHeader, [out, retval] VARIANT_BOOL* bRes);
  [helpstring("method GetSetNotChanged")] HRESULT GetSetNotChanged([out, 
retval] VARIANT_BOOL *bRes);
  [helpstring("method GetResetCmdLine")] HRESULT GetResetCmdLine([out, 
retval] VARIANT_BOOL *bRes);
 };
 [
  object,
  uuid(D99A5526-1480-41A9-B773-FC47E4D624D5),

  helpstring("ISubfileLinesList Interface"),
  pointer_default(unique)
 ]
 interface ISubfileLinesList : IUnknown
 {
  [helpstring("method MoveFirst")] HRESULT MoveFirst([out, 
retval]VARIANT_BOOL *Res);
  [helpstring("method GetNextItem")] HRESULT GetNextItem([out] 
ISubfileLineItem** ppItem, [out, retval]VARIANT_BOOL *bResult);

  [helpstring("method AddNode")] HRESULT AddNode([in]LONG oldSeq, [in]LONG 
lsgSeq, [in]LONG sflSeq, [in]BSTR SubfileLineType,
  [in] VARIANT_BOOL changed, [in] VARIANT_BOOL dcerr,
  [in] VARIANT_BOOL err, [in] VARIANT_BOOL gotstructure,
  [in] VARIANT_BOOL indatabase, [in] VARIANT_BOOL paramchanged ,
  [in] VARIANT_BOOL paramerr, [in]VARIANT_BOOL replace,
  [in] BSTR command, [in] BSTR comment,
  [in] BSTR dbcommand, [in] BSTR dbcomment, [in] BSTR errtext,
  [in] BSTR generated,
  [in] BSTR origcommand, [in] BSTR subfileid, [in] BSTR subheader,
  [in] BSTR tag,
  [in] VARIANT_BOOL validated, [in]LONG errlength , [in] LONG errstart ,
  [in] LONG format,
  [in] LONG structured ,[out, retval]VARIANT_BOOL* pRes);

  [propget, helpstring("property Count")] HRESULT Count([out, retval] LONG 
*pVal);

  [helpstring("method AddNodeAt")] HRESULT AddNodeAt([in] LONG lIndex,
     [in] LONG oldSeq,
     [in] LONG lsgSeq,
     [in] LONG sflSeq,
     [in] BSTR SubfileLineType,
       [in] VARIANT_BOOL changed,
       [in] VARIANT_BOOL dcerr,
       [in] VARIANT_BOOL err,
       [in] VARIANT_BOOL gotstructure,
       [in] VARIANT_BOOL indatabase,
       [in] VARIANT_BOOL paramchanged ,
       [in] VARIANT_BOOL paramerr,
       [in] VARIANT_BOOL replace,
       [in] BSTR command,
       [in] BSTR comment,
       [in] BSTR dbcommand,
       [in] BSTR dbcomment,
       [in] BSTR errtext,
       [in] BSTR generated,
       [in] BSTR origcommand,
       [in] BSTR subfileid,
       [in] BSTR subheader,
       [in] BSTR tag,
       [in] VARIANT_BOOL validated,
       [in] LONG errlength,
       [in] LONG errstart ,
       [in] LONG format,
       [in] LONG structured,
       [out, retval]VARIANT_BOOL* pRes);

  [helpstring("method GetItemAt")] HRESULT GetItemAt([in]LONG lIndex,  [out] 
ISubfileLineItem** ppItem, [out, retval]VARIANT_BOOL *bResult);
  [helpstring("method AddNodesAt")] HRESULT AddNodesAt([in]LONG lIndex, 
[in]BSTR Buffer);
  [helpstring("method DeleteNodeAt")] HRESULT DeleteNodeAt([in]LONG lIndex, 
[out, retval]VARIANT_BOOL *Res);
  [helpstring("method ResetCmdLine")] HRESULT ResetCmdLine([out, retval] 
VARIANT_BOOL* bResult);
  [helpstring("method BuildSaveList")] HRESULT BuildSaveList([in]LONG 
lTopChange, [in]BSTR bstrCopySfl, [out]IStringList** IInsIndexes, 
[out]IStringList** lUpdIndexes, [out]IStringList** lLineNoUpds, 
[out]IStringList** lRowSave, [out]LONG* lOldLsgseq, [out, 
retval]VARIANT_BOOL* vbResult);
  [helpstring("method GetLoadSeqAt")] HRESULT GetLoadSeqAt([in]LONG Index, 
[out,retval] LONG* LoadSeq);
  [helpstring("method Reset")] HRESULT Reset();
 };
 [
  object,
  uuid(665C17EF-2649-48F2-87C0-7A5B53D5666E),

  helpstring("IDTHToolsDB Interface"),
  pointer_default(unique)
 ]
 interface IDTHToolsDB : IUnknown
 {
  [helpstring("method CreateSubfileLinesListFromDB")] HRESULT 
CreateSubfileLinesListFromDB([in]BSTR Provider, [in]BSTR Datasource, 
[in]BSTR UserID, [in]BSTR Password, [in]BSTR ProductID, [in]BSTR Revision, 
[in]BSTR ApplicationID, [in]BSTR ApplicationRev, [in]BSTR SubfileID, 
[out]ISubfileLinesList** ppSubfileLinesList , [out, retval]LONG* pResult);
  [propget, helpstring("property LastError")] HRESULT LastError([out, 
retval] BSTR *pVal);
  [helpstring("method SetWaitDlg")] HRESULT SetWaitDlg([in]IDlgCalcWait* 
pIDlgCalcWait,[out, retval]VARIANT_BOOL* pbRetval);
  [propget, helpstring("property MaxSflSeq")] HRESULT MaxSflSeq([out, 
retval] long *pVal);
 };
 [
  object,
  uuid(9FDFD24A-5E29-441D-AD56-A92226A1D131),

  helpstring("ISyntaxObj Interface"),
  pointer_default(unique)
 ]
 interface ISyntaxObj : IUnknown
 {
//Here is the modified InitRules where I have added a Handle_DS parameter as 
the first parameter
[helpstring("method InitRules")] HRESULT InitRules([in] Handle_DS handleDS, 
[in] BSTR Provider,[in] BSTR DataSource,[in] BSTR UserId,[in] BSTR 
Password,[in] BSTR ProductID,[in] BSTR Revision,[in] BSTR ApplicationID,[in] 
BSTR ApplicationRev,[in] BSTR SubfileID,[out,retval] VARIANT_BOOL *bRes);


 [helpstring("method LoadSeqRowID")] HRESULT LoadSeqRowID([out,retval] 
VARIANT_BOOL *bRes);
  [helpstring("method LoadFileFromWiz")] HRESULT LoadFileFromWiz([in] BSTR 
Provider,[in] BSTR DataSource, [in]BSTR UserId,[in] BSTR Password,[in] BSTR 
ProductID,[in] BSTR Revision,[in] BSTR ApplicationID,[in] BSTR 
ApplicationRev,[in] BSTR SubfileID,[in] BSTR FileToLoad,[out] IStringList2 
**StrNotProd,[out] IStringList2 **StrNotSub, [out] IStringList2 **StrResult, 
[out,retval] VARIANT_BOOL *bRes);
  [helpstring("method AlterSyntax")] HRESULT AlterSyntax([in] IStringList2 
*StrList,[in] BSTR ErrFilePath, [in] VARIANT_BOOL *bNew, [out] 
IStringList2** ppSyntList, [out,retval] VARIANT_BOOL *bRes);
  [helpstring("method AlterSyntax2")] HRESULT AlterSyntax2([in] IStringList2 
*StrList,[in] BSTR ErrFilePath, [in] VARIANT_BOOL *bNew, [out] 
ISubfileLinesList** ppSubfileLines, [out,retval] VARIANT_BOOL *bRes);
  [helpstring("method AlterSyntax3")] HRESULT AlterSyntax3([in] IStringList2 
*StrList, [in] BSTR bstrAllIDs, [in] BSTR ErrFilePath, [in] VARIANT_BOOL 
*bNew, [out] ISubfileLinesList** ppSubfileLines, [out,retval] VARIANT_BOOL 
*bRes);
  [helpstring("method test_func")] HRESULT test_func([in, out] BSTR* str, 
[out,retval] VARIANT_BOOL *bRes);
  //[helpstring("method CheckSubFile")] HRESULT CheckSubFile([in] 
ISubfileLinesList* pSubfileLines,[in] LONG SelStart, [in] LONG SelStop,[out] 
ISubfileLinesList** ppSubfileLines, [out] IStringList2 **ppErrRowList , 
[out,retval] VARIANT_BOOL* bResult);
  [helpstring("method CheckSubFile")] HRESULT CheckSubFile([in, out] 
ISubfileLinesList** ppSubfileLines,[in] LONG SelStart, [in] LONG SelStop, 
[out,retval] VARIANT_BOOL* bResult);
 };
 [
  object,
  uuid(A4EB3015-3DAE-4b68-A86E-5F52554F822D),

  helpstring("ISyntaxObj2 Interface"),
  pointer_default(unique)
 ]
 interface ISyntaxObj2 : ISyntaxObj
 {

  [helpstring("method CheckProcedure")] HRESULT CheckProcedure([in, out] 
ISubfileLinesList** ppSubfileLines,[in] LONG SelStart, [in] LONG SelStop, 
[in, out] LONG* pFirstErr,[out,retval] VARIANT_BOOL* bResult);
  [helpstring("method SetWaitDlg")] HRESULT SetWaitDlg(IDlgCalcWait 
*pIDlgCalcWait, VARIANT_BOOL *pbRetVal);
 };
 [
  object,
  uuid(C55E3AE0-EE79-4DBA-A28F-C9FFC92C761D),

  helpstring("IGenerateCAA Interface"),
  pointer_default(unique)
 ]
 interface IGenerateCAA : IUnknown
 {
  [helpstring("method ReturnCAAFile")] HRESULT ReturnCAAFile([in] BSTR 
Provider,[in] BSTR DataSource,[in] BSTR UserID,[in] BSTR PassWD,[in] BSTR 
ProdID,[in] BSTR ProdRev,[in] BSTR AppId,[in] BSTR AppRev, [in] BSTR FileNo, 
[in] LONG ComPos, [in] LONG chkShowDesc, [in] VARIANT_BOOL VBProcedure 
,[out,retval] BSTR *plpRes);
 };


//import "ocidl.idl";

[
 uuid(6218C542-D32D-48DC-B983-0D1E66BA6E15),
 version(1.0),
 helpstring("DTHToolObjects 1.0 Type Library")
]
library DTHTOOLOBJECTSLib
{
 importlib("stdole32.tlb");
 importlib("stdole2.tlb");

 [
  uuid(70FAA25C-347A-4389-AFD4-AE8A9B7C4B1E),
  helpstring("SubfileLineItem Class")
 ]
 coclass SubfileLineItem
 {
  [default] interface ISubfileLineItem;
 };
 [
  uuid(936D3DED-5FEF-4262-AADD-DED2A54BD9EF),
  helpstring("SubfileLinesList Class")
 ]
 coclass SubfileLinesList
 {
  [default] interface ISubfileLinesList;
 };
 [
  uuid(68E9E761-530C-4128-999F-ECA684370ADD),
  helpstring("DTHToolsDB Class")
 ]
 coclass DTHToolsDB
 {
  [default] interface IDTHToolsDB;
 };
 [
  uuid(078DE4B6-C37B-4FC9-AF74-E718F3BBCABE),
  helpstring("Paramlist Class")
 ]
 coclass ParamList
 {
  [default] interface IParamList;
 };
 [
  uuid(B7719166-1601-4880-8812-23C1234ABE6F),
  helpstring("ParamItem Class")
 ]
 coclass ParamItem
 {
  [default] interface IParamItem;
 };
 [
  uuid(95DF2051-99D1-4780-989C-6344F5D1266D),
  helpstring("SyntaxObj Class")
 ]
 coclass SyntaxObj
 {
  [default] interface ISyntaxObj2;
 };
 [
  uuid(09FAD897-6F5A-4CD4-8F08-C9D00CAFED2D),
  helpstring("GenerateCAA Class")
 ]
 coclass GenerateCAA
 {
  [default] interface IGenerateCAA;
 };
};


//Tony 

0
12/3/2008 12:32:15 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
809 Views

Similar Articles

[PageSpeed] 45

"Tony Johansson" <t.johansson@logica.com> ha scritto nel messaggio 
news:ubg4tMUVJHA.4908@TK2MSFTNGP04.phx.gbl...

[...]
> Note the object of type Handle_DS is a C++ object
[...]
> [helpstring("method InitRules")] HRESULT InitRules([in] Handle_DS 
> handleDS, [in] BSTR Provider,[in] BSTR DataSource,[in] BSTR UserId,[in] 
> BSTR Password,[in] BSTR ProductID,[in] BSTR Revision,[in] BSTR 
> ApplicationID,[in] BSTR ApplicationRev,[in] BSTR SubfileID,[out,retval] 
> VARIANT_BOOL *bRes);

I'm not a COM guru, but I think that you can't pass a native C++ object as 
argument for COM interface methods (like InitRules above).
You can use only COM-compliant data, like BSTR, or VARIANT_BOOL, SAFEARRAY, 
etc. at this interface level.

If Handle_DS data type is to be available at the COM level, you need to 
define a COM interface for it (e.g. IHandleDS), and use that COM 
*interface*, e.g.

  HRESULT InitRules( [in] IHandleDS * HandleDS, ... );

This interface can be implemented internally as a kind of wrapper to the 
existing C++ Handle_DS class, but COM interface clients do not know about 
the concrete C++ class Handle_DS, COM interface clients know only about pure 
*interfaces* (i.e. basically, a list of pure virtual methods properly packed 
in v-tables).

This strong separation between *interface* (public, language-independent) 
and *implementation* (private, written in a particular language, like C++, 
or VB, etc.) is the power of COM.

microsoft.public.dotnet.languages.vc and 
microsoft.public.dotnet.framework.interop may be better newsgroups to ask 
for help about managed (e.g. C#) and native (COM, C++...) code interop.

Giovanni



0
12/3/2008 10:52:13 PM
Reply:

Similar Artilces:

Can't boot or access C drive
Windows XP won't boot. I tried reinstalling Windows but keep getting a blue screen even after deleting, recreating and formatting the C drive. I booted with an MSDOS floppy but can't access C drive. It may be a boot sector virus. How do I format the entire hard drive so I can do a clean install? "rj" <rjnothere@netzero.net> wrote in message news:ulZXW#DJLHA.1868@TK2MSFTNGP05.phx.gbl... > Windows XP won't boot. I tried reinstalling Windows but keep getting a > blue > screen even after deleting, recreating and formatting the C drive. I &g...

Is It Possible To Pass Parameters to A Pass Through Query
My assumption is that's it's not. At work I use ODBC to connect to our oracle database with Access 2003. There are cases where using a pass through query runs much much faster and I then use it in a make table query to make a local table. In access you can use brackets [] to have it ask for input. May I assume there is no way to do anything like that in a pass through query? Create a PassThrough query and use code to assign the SQL to this query filtering it with a parameter, and then run it e.g Dim MyVariable As Integer MyVariable = InputBox("Please select a Number&quo...

Illustrate class/object inheritance
I have two classes. One is a parent class with defined operations. The other is a child/derived class. Right now, I have a generalization arrow going from the child to the parent and that's all good and fine. Well, for the most part. Is there a way I can make it so that the operations defined in the parent are inherited (in the diagram and/or, even better, the properties) by the child? I've tried all the different arrows and I've also tried setting up a realization link (from the child to parent) but nothing seemed to work. Interestingly though, the realization link s...

Missing Object Tabs
For some reason, the tabs that used to appear at the top of the main window when you opened objects (i.e. tables, forms, queries, etc) no longer appear. For example, if I maximize a datasheet it covers a form that may be open and I am unable to gat back to the form unless I minimize the datasheet or resize it. The tabs made it much easier to switch between open objects. I cannot seem to find how to restore them. The setting for forms with tabs is found by going to the office button at top left of screen, clicking Access options (bottom of dialog), then Current Database ( top le...

Pass multiple selected values from list box to table
How do I pass multiple selected values from a list box to a table? I've found code to use the values as criteria in a query but would now like to store the values in a table (at least temporarily) thanks in advance. jack Pass selected values from a list box to a table? I don't really think you want to do this. Can you describe more about what you are trying to accomplish? You just store raw data in a table. You don't store manipulated data in a table. Maybe you need a query to do what you want to do... -- Ryan--- If this information was helpful, please indi...

C++ application with HTML gui
I'd like to develop windows applications in C++/MFC where my application user interface is HTML. This allows much easier, squicker and graphically enhanced and even internet connected applications. Some time ago someone mentioned here that it wasn't trivial to let C++ code interact with HTML elements.. Like calling a C++ function when an HTML button <input type="button" ...> is pressed, reading out the text entered in an <input type="text" ..> etc. Microsoft really should make it easier to allow C++ code to interact with internet explorer events....

How to pass an object from C++
Hello! We have a C# asp.net web application that is using a COM dll We use the tlbimp to be able to use the COM dll from C# asp.net web application The method InitRules shown below is located in the COM dll. It can be seen below the text Original. Method InitRules below is called from C# but we want to pass an object of type Handle_DS in addition to all the other parameters. You can see the modified InitRules below marked Modified Note the object of type Handle_DS is a C++ object that is created from C# asp.net application and pass into the InitRules I have also copied the whole idl fil...

res://C:\WINDOWS\System32\shdoclc.dll/preview.dlg
Hi I am running WinXP SP2 with IE7 on MS Outlook2003, every time when i click print icon, "res://C:\WINDOWS\System32\shdoclc.dll/preview.dlg" error box will appear. anyone have idea how to fix it, as i had tested reinstall IE and Ms Office, but still the same thanks This is not a Windows or Office issue And have you checked your printer driver and software lately for issues = and compatibility ?? --=20 Peter Please Reply to Newsgroup for the benefit of others Requests for assistance by email can not and will not be acknowledged. "gbkhor" <gbkhor@time.net.m...

100% Passing Guaranteed in All I.T. Exams/Certifications at 1st Attempt Hi Friends, To pass all types of I.T Exams/Certifications with mind blowing results in 1st attempt just visit http://www.itreal
100% Passing Guaranteed in All I.T. Exams/Certifications at 1st Attempt Hi Friends, To pass all types of I.T Exams/Certifications with mind blowing results in 1st attempt just visit http://www.itrealexams.com/ and get real time Q&As, Brain Dumps, Real Exams, Study material, E-Books, Video Exams and Labs for your all type of I.T Certification Exams. ...

Call c routines from c++ classes
Hi, I have problems in calling c routines from a C++ class. In the implementation file, I included the header file there. For example, I want to use the function of Create_vecotr(int, int) in my class, which has a member " double* m_pv". I used the rountine in my member function: m_pv = Create_vecotr(1,iPairPoints); In the header file a1.h, I have definition: double *Create_vecotr(int n1, int n2); In the implementation file a1.cpp, I have: double *Create_vecotr(int nl, int nh) { ....... } When I did not include the a1.cpp into my Source file, I got the error message as &quo...

IT CertificationzzzZ.....100% GUARANTEED PASS.......!!!@!!!
IT CertificationzzzZ.....100% GUARANTEED PASS.......!!!@!!! Hi guys, If you are serious about your professional career and pass IT Certification exam in first attempt then Visit http://www.FreeExamKing.com and get latest Questions And Answers Dumps for Microsoft, Oracle, Cisco, CompTIA and many more, i have used and found it very helpful. ...

Passing data between forms
Hi I am working on a project someone else started, and he has this code: If STR_FormName = "FMS_ToDo" Then Page47.SetFocus He obviously expects the name of the last form to be here, but it is not. In fact, when I put Option Explicit at the top - this field was undefined. How is this supposed to work? Stapes ...

Passing arguments to procedures
There is something fundamental that I have failed to grasp about passing arguments to procedures. I have a form featuring a set of unbound controls displaying dates and the corresponding days of the week. (For some reason, the long-date format, on my computer, does not include the latter, as the documentation suggests it might, so it has to be separately calculated and displayed.) A default date is displayed in each control, on Form_Open. This can then be manually adjusted by a pair of ‘up’ and ‘down’ buttons associated with each day/date control pair. In the case of the control ‘St...

Importing pst on a new m/c receiving "the messaging interface..."
Having exported the inbox, archive, sent mail, and address book off my old PC I am now trying to import them as PST files on a new m/c However all I am receivinbg is an error message: "the messaging interface has returned an unknown error. If the problem persists, restart outlook."-- Well I have and that hasn't worked. I've tried the Scanpst utility, that too hasn't worked. As the files are .pst I cannot open them in Excel and then save cooma seperated.. I'm kind of stumped, searched for help can't find it, so now need to ask..... can somebod...

Object not availble onthis machine.
I made an application whith VBA. It has been jused for several months on an other PC, but after reinstalling of office, it won't open. Problem is the calendar. I made it originaly with a datepicker, but I have chanced it to the old calendar, but it still say's that an object is not avaible on this machine. Any suggestions welcome ...

Pass Parameter to stored procedure in pass thru query
How do I pass a parameter to a stored procedure in a pass thru query? I'd like to enter the parameter in a control on a form and then run the pass thru query and pass the parameter to it. I've tried this, but haven't been successful. Any ideas? Thanks. On Sun, 8 Jul 2007 18:04:26 -0500, "SAC" <sac@somewhere.com> wrote: >How do I pass a parameter to a stored procedure in a pass thru query? > >I'd like to enter the parameter in a control on a form and then run the pass >thru query and pass the parameter to it. > >I've tried this, b...

OPOS Line Display Service Object
Hi, I am a newbie in OPOS. I am developing a service object for OPOS line display. When trying to use it through the MonroeCS CO control (OPOSLineDisplay.ocx, version OposCCOs-1_11_001), Open gives code 104 (=OPOS_E_NOSERVICE), and get_OpenResult() gives code 305 (=OPOS_OR_BADIF). What these return codes really means ? In Control Programmer's Guide (OLE for Retail POS, Release 1.6) this is said in page 18, item 5: CLIP --> .... (This ensures that the Service Object supports at least the minimum methods of a valid Service Object for the device class, before calling any of its methods...

how to have a method to return an uninitilized variable in c#?
Hi, We have byValue and ByReference in VB and out and ref parameters in C# 1- ref parameter expects an initialized variable 2- out should be initialized before return First Question: How can I have a parameter remain uninitialized after a return (that compiler expects to be initialized even after the invokation of the method)? (compiler designer might need to add a runtime error for reading from an uninitialized variable) Second Question: Somtimes compiler naggs about that not all code paths return a value? how can I assure the compiler it always return a value? Leon_Ami...

You will pass all the exams at 1st attempt No more headaches and worry about spending the time and money to attempt another exam again. You will pass all of your exams, every time www.FreeExamKing.com
You will pass all the exams at 1st attempt No more headaches and worry about spending the time and money to attempt another exam again. You will pass all of your exams, every time www.FreeExamKing.com ...

Range.Value2 in C# (Excel 2007, VSTO 2008)?
After doing intense research on the net, I finally found out that I cannot simply use VSTO 2008 ThisAddIn to create UDFs (for Excel 2007), at least not without writing any further VBA code to call the UDF defined. I thought this was possible, but read that actually to write UDFs without VBA I either have to use COM AddIns or Automation AddIns. I'd be happy to be proved I'm wrong. So I wrote an Automation AddIn for Excel 2007 (using C#). It again took me a long time to understand that unlike with VB.NET in C# I simply cannot use myRange.Value but must use myRange.Value2 i...

Reanimation when moving object using shape().left Powerpoint
I have discovered an unexpected behavior in powerpoint with reanimation of custom animations. I have a slide with a relatively involved custom animation timeline. My application moves an object from Visual Basic using the .left parameter (while the slide is displayed in slideshow window) e.g. shapes(myshape).left = x when the object moves, the ENTIRE animation timeline reanimates (starts over). this is undersirable. there are a couple of questions associated with this i have been unable to resolve and wonder if anyone has any suggestions? 1) i would like to understand...

OnInitDialog and passing argument
Hello, I want to use a dialog for three different purpose so every time dialog should come up with a different situation. How can I pass argunment(s) to the OnInitDialog window message of the dialog ? Is it possible? Thanks Smith "JSmith" <jsmithmitra@yahoo.com> wrote in message news:u4ajmu$nEHA.3900@TK2MSFTNGP10.phx.gbl... > Hello, > > I want to use a dialog for three different purpose so every time dialog > should come up with a different situation. How can I pass argunment(s) to > the OnInitDialog window message of the dialog ? > Is it possible? The...

How to automate the process of registering ATL object ?
Hello There Let me explain my problem first. I have developed one application in which I'm using one ATL component which downloads URL from web. Before to run my application, I always have to register DLL using regsvr32. Thats fine if I'm doing it on my machine. How can I automate this process of registering DLL using my application ? Well My application is a seaprate EXE, So we are going to distrubute it without setup. Means it will be a seaprate EXE which user will download and run to start it. How can I pack my DLL with it ? Can I keep my DLL as a resource in EXE and register it whe...

How to pass a parameter to a userform
Hi, I need to both open a useform and pass a parameter to it. How do I do this? I'd like to do the following but the Show method doesn't take this kind of parameter. Userform1.Show(param) Cheers Gromit -- Gromit ------------------------------------------------------------------------ Gromit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=928 View this thread: http://www.excelforum.com/showthread.php?threadid=320229 Create a public variable in the userform, say called myVar, and then Load Userform1 Userform1.myVar = "SomeValue" ...

Serializing object to XmlDocument (or string)
I am on .NET 2.0 and am trying to serialize an object to an XmlDocument (or a string which I can then create an XmlDocument from). What I have so far is (User is my class); XmlSerializer x = new XmlSerializer(typeof(User)); MemoryStream memStream = new MemoryStream(); How can I get this to a string or an XmlDocument? The serialization works fine as if I serialize to a text file (using StreamWriter), everything looks fine. I've try converting to bytes, reading on XmlWriter, but nothing seems to work. Thanks, ...