none
UDT -ATL -Struct implementation RRS feed

  • Question

  • Hi,
     
    I want to add a function to my class in ATL project..while doing so the function has a parameter of struct..this struct needs to be implement in idl.....I am stuck..in VC++ can anyone help as I am a beginner in ATL ...
     
    1)Hav added the following in the .idl file
    [ uuid("FD27CE79-9C08-4afa-AEB0-BB5B3E2F6DEA")]
    struct xGetPinOutNaw {
    char sDate_Time[MESSAGE_DATE_TIME_LENGTH+1];
    char sRefTransaction_Number[MESSAGE_TXN_SERIAL_LENGTH+1];
    char spincode[MESSAGE_PIN_CODE_LENGTH+1];
    char sSerial_PinNo[MESSAGE_PIN_SERIAL_LENGTH+1];
    char sExpiry_date[MESSAGE_PIN_EXPIRY_LENGTH+1];
    char sPromotion_msg[MESSAGE_FILLER_LENGTH+1];
    };
    2)hav made a separate idl file with the above info and hav include that in the main .cpp file and the headers aswell...
     
    Not getting a proper approach to go ahead
     
    error: 
    error MIDL2035 : constant expression expected 
     
    Thanks
    Monday, July 15, 2013 10:11 AM

Answers

  • You seem to want to pass strings around. The usual way to do so in COM is via a BSTR, not an array of char. You might want to reconsider your design.

    How are MESSAGE_DATE_TIME_LENGTH and others defined? Apparently, they are not compile-time constants, which is what MIDL complains about.

    For more details on UDT (structs) in COM, see http://vcfaq.mvps.org/com/4.htm , http://vcfaq.mvps.org/com/5.htm .


    Igor Tandetnik

    Monday, July 15, 2013 12:52 PM
  • If you want to use structs in a COM interface, then you usually do it the other way round. You define the struct in the IDL file. When MIDL compiler processes this file, one of its outputs is an .h file that, among other things, would contain the definition of the same struct in C. Your COM object implementation would just include that header.

    Igor Tandetnik

    • Marked as answer by SPBC Wednesday, October 2, 2013 8:29 AM
    Wednesday, July 31, 2013 1:00 PM
  • Thank Igor  for the kind reply..

    Will redesign using BSTR...

    Igor,

    I hav a function in the dll to be called by the client.This function I hav defined in the class by add method and then added the body to the function.

    This function has the above mentioned struct as one of the parameters to be passed...

    So where do I define the struct.....and how .I defined in a separate .h file and tried including it but cant do that in idl I suppose..

    Kindly advise...or we hav to do as it is done above..

    In the above method I am not sure how to add an uuid  number so am a bit reluctant on that...

    Thanks

    Shilpa

    • Marked as answer by SPBC Wednesday, October 2, 2013 8:29 AM
    Wednesday, July 31, 2013 11:16 AM

All replies

  • You seem to want to pass strings around. The usual way to do so in COM is via a BSTR, not an array of char. You might want to reconsider your design.

    How are MESSAGE_DATE_TIME_LENGTH and others defined? Apparently, they are not compile-time constants, which is what MIDL complains about.

    For more details on UDT (structs) in COM, see http://vcfaq.mvps.org/com/4.htm , http://vcfaq.mvps.org/com/5.htm .


    Igor Tandetnik

    Monday, July 15, 2013 12:52 PM
  • Thank Igor  for the kind reply..

    Will redesign using BSTR...

    Igor,

    I hav a function in the dll to be called by the client.This function I hav defined in the class by add method and then added the body to the function.

    This function has the above mentioned struct as one of the parameters to be passed...

    So where do I define the struct.....and how .I defined in a separate .h file and tried including it but cant do that in idl I suppose..

    Kindly advise...or we hav to do as it is done above..

    In the above method I am not sure how to add an uuid  number so am a bit reluctant on that...

    Thanks

    Shilpa

    • Marked as answer by SPBC Wednesday, October 2, 2013 8:29 AM
    Wednesday, July 31, 2013 11:16 AM
  • If you want to use structs in a COM interface, then you usually do it the other way round. You define the struct in the IDL file. When MIDL compiler processes this file, one of its outputs is an .h file that, among other things, would contain the definition of the same struct in C. Your COM object implementation would just include that header.

    Igor Tandetnik

    • Marked as answer by SPBC Wednesday, October 2, 2013 8:29 AM
    Wednesday, July 31, 2013 1:00 PM
  • Hi Igor,

    Thanks for the reply...

    The following is the method to be used by the client....

    I hav added this method in the idl bt add method..

    STDMETHODIMP Ccdll::ucGetPinOnline(int isProduction, int itemid, char *dealerid, char *Transaction_Number, xGetPinOutNaw *struct_PinInfo, char sStoreNo[], char sPOS_Serial[], int serviceid)
     {}

    once I do this it gets added in the ccdl as well...

    about adding the struct ...I hav added that in the idl in the library function

    ******************************IDL***********************************************

    [
    object,
    uuid(ECDB526E-80AF-4C61-871C-6151B9860082),
    dual,
    helpstring("Icdll Interface"),
    pointer_default(unique)
    ]

    interface Icdll : IDispatch
    {
    [id(1), helpstring("method ucGetPinOnline")] HRESULT ucGetPinOnline(int isDemo,int itemid,char* dealerid,char* Transaction_Number,struct xGetPinOutNaw* struct_PinInfo,char sStoreNo[8],char sPOS_Serial[6],int serviceid);
    };


    [
    uuid(AE578AD6-6D96-442C-A2BD-6723DB16C123),
    version(1.0),
    helpstring("CoreProjectDLL 1.0 Type Library")
    ]

    library COREPROJECTDLLLib
    {
    importlib("stdole32.tlb");
    importlib("stdole2.tlb");

    [
    uuid(B14FF367-BF06-42C9-9B0E-4FDF6083A714),
    helpstring("_IcdllEvents Interface")
    ]


    typedef struct xGetPinOutNaw {
    BSTR sDate_Time[MESSAGE_DATE_TIME_LENGTH+1];
    BSTR sRefTransaction_Number[MESSAGE_TXN_SERIAL_LENGTH+1];
    BSTR spincode[MESSAGE_PIN_CODE_LENGTH+1];
    BSTR sSerial_PinNo[MESSAGE_PIN_SERIAL_LENGTH+1];
    BSTR sExpiry_date[MESSAGE_PIN_EXPIRY_LENGTH+1];
    BSTR sPromotion_msg[MESSAGE_FILLER_LENGTH+1];

    };

    dispinterface _IcdllEvents
    {
    properties:
    methods:
    };

    [
    uuid(3A7D0CB8-EE22-4E45-9732-D143FE645957),
    helpstring("cdll Class")
    ]
    coclass cdll
    {
    [default] interface Icdll;
    [default, source] dispinterface _IcdllEvents;
    };

    ************************************************************************

    Earlier I was adding the body of this called function in the main file...

    extern "C" __declspec(dllexport) int ucGetPinOnline(int isProduction,int itemid,char* dealerid,char* Transaction_Number,struct xGetPinOutNaw* struct_PinInfo,char sStoreNo[8],char sPOS_Serial[6],int serviceid)
    {}

    but after adding  a method in the idl we get a body of ccdl...so added the definition in the ccdl..

    After doing all this I compiled and get the following error

    error MIDL2025 : syntax error : expecting MSCDLLIMPORT or MSCDLLEXPORT near "noreturn"

    /* function prototypes */

    #if     _MSC_VER >= 1200
    _CRTIMP __declspec(noreturn) void   __cdecl abort(void);
    _CRTIMP __declspec(noreturn) void   __cdecl exit(int);
    #else
    _CRTIMP void   __cdecl abort(void);
    _CRTIMP void   __cdecl exit(int);
    #endif

    error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation

    s let me know if U are able to understand my probs......and correct me where am I going wrong...

    The client is using Microsoft Dynamics NAV classic tool...I donno about this tool ..but when He adds our DLL in this tool then the tool doesnt show the "ucGetPinOnline" function and its parameters..

    What all needs to be done from my end to be able to satisfy the clients demands...I am working with VC++6.0

    Thanks for your support

    Shilpa

    Wednesday, October 2, 2013 11:13 AM
  • The IDL definition you currently have makes no sense at all. You want something like this:

    [uuid(some-GUID-here)]
    struct xGetPinOutNaw { BSTR sDate_Time; BSTR sRefTransaction_Number; BSTR spincode; BSTR sSerial_PinNo; BSTR sExpiry_date; BSTR sPromotion_msg; }; [ object, uuid(ECDB526E-80AF-4C61-871C-6151B9860082), dual, helpstring("Icdll Interface"), pointer_default(unique) ] interface Icdll : IDispatch { [id(1), helpstring("method ucGetPinOnline")] HRESULT ucGetPinOnline(
    [in] long isDemo, [in] long itemid, [in] BSTR dealerid, [in] BSTR Transaction_Number,
    [out] struct xGetPinOutNaw* struct_PinInfo,
    [out] BSTR* sStoreNo, [out] BSTR* sPOS_Serial, [out] long* serviceid); };

    I assumed, for the sake of argument, that all parameters before struct_PinInfo are [in] parameters, intended for the caller to pass information into the method; while struct_PinInfo and all parameters after that are [out] parameters, intended for the method to return information back to the caller. If this assumption is incorrect, adjust the declaration accordingly.


    Igor Tandetnik

    Wednesday, October 2, 2013 12:54 PM
  • Hi Igor,

    There was one include which I commented in the IDL which was creating problems I suppose

    //#include "MessageStruct.h"

    Now 

    one struct is defined in the idl

    struct xGetPinOutNaw {
     BSTR sDate_Time;
     BSTR sRefTransaction_Number;
     BSTR spincode;
     BSTR sSerial_PinNo;
     BSTR sExpiry_date;
     BSTR sPromotion_msg;
    };

    and the one more struct has been defined in the .h file

    struct xGetPinOutNaw {
    char sDate_Time[MESSAGE_DATE_TIME_LENGTH+1];
    char sRefTransaction_Number[MESSAGE_TXN_SERIAL_LENGTH+1];
    char spincode[MESSAGE_PIN_CODE_LENGTH+1];
    char sSerial_PinNo[MESSAGE_PIN_SERIAL_LENGTH+1];
    char sExpiry_date[MESSAGE_PIN_EXPIRY_LENGTH+1];
    char sPromotion_msg[MESSAGE_FILLER_LENGTH+1];
    };

    So now I get this error

    error C2011: 'xGetPinOutNaw' : 'struct' type redefinition..

    which one to remove...is  a big question now..

    regards

    Shilpa

    Thursday, October 3, 2013 10:59 AM
  • Which part of "You define the struct in the IDL file... MIDL compiler... outputs an .h file ... Your COM object implementation would just include that header" did you find unclear? Use the MIDL-generated definition, remove your hand-crafted one.

    Igor Tandetnik

    Thursday, October 3, 2013 12:36 PM
  • Hi Igor,

    Tried removing the hand crafted one from the .h file created by me EGATESOLUTION.h

    *******************************************************************************

    IDL File

    *******************************************************************************

    import "oaidl.idl";
    import "ocidl.idl";
    //#include "MessageStruct.h"



    struct xGetPinOutNaw {
     BSTR sDate_Time;
     BSTR sRefTransaction_Number;
     BSTR spincode;
     BSTR sSerial_PinNo;
     BSTR sExpiry_date;
     BSTR sPromotion_msg;
    };


    [
    object,
    uuid(ECDB526E-80AF-4C61-871C-6151B9860082),
    dual,
    helpstring("Icdll Interface"),
    pointer_default(unique)
    ]

    interface Icdll : IDispatch
    {

    [id(1), helpstring("method ucGetPinOnline")] HRESULT ucGetPinOnline([in] long isDemo, [in] long itemid, [in] BSTR dealerid, [in] BSTR Transaction_Number, [out] struct xGetPinOutNaw* struct_PinInfo, [in] BSTR* sStoreNo, [in] BSTR* sPOS_Serial, [in] long* serviceid);
    };


    [
    uuid(AE578AD6-6D96-442C-A2BD-6723DB16C123),
    version(1.0),
    helpstring("CoreProjectDLL 1.0 Type Library")
    ]

    library COREPROJECTDLLLib
    {
    importlib("stdole32.tlb");
    importlib("stdole2.tlb");

    [
    uuid(B14FF367-BF06-42C9-9B0E-4FDF6083A714),
    helpstring("_IcdllEvents Interface")
    ]



    dispinterface _IcdllEvents
    {
    properties:
    methods:

    };

    [
    uuid(3A7D0CB8-EE22-4E45-9732-D143FE645957),
    helpstring("cdll Class")
    ]
    coclass cdll
    {
    [default] interface Icdll;
    [default, source] dispinterface _IcdllEvents;
    };
    };

    *******************************************************************************

    Rest the hand crafted one is as follows- EGATESOLUTION.h

    *******************************************************************************

    #ifndef _EGATESOLUTION_H_
    #define _EGATESOLUTION_H_


    #include <iostream.h>
     #include <stdio.h>
     #include <windows.h>
    #include "GVariables.h"

    /*struct xGetPinOutNaw {
    char sDate_Time[MESSAGE_DATE_TIME_LENGTH+1];
    char sRefTransaction_Number[MESSAGE_TXN_SERIAL_LENGTH+1];
    char spincode[MESSAGE_PIN_CODE_LENGTH+1];
    char sSerial_PinNo[MESSAGE_PIN_SERIAL_LENGTH+1];
    char sExpiry_date[MESSAGE_PIN_EXPIRY_LENGTH+1];
    char sPromotion_msg[MESSAGE_FILLER_LENGTH+1];
    };
    */
     
    extern "C" __declspec(dllexport) int ucGetPinOnline(int isDemo,int itemid,char* dealerid,char* Transaction_Number,struct xGetPinOutNaw* struct_PinInfo,char sStoreNo[8],char sPOS_Serial[6],int serviceid);


    #endif

    *******************************************************************************

    Errors due to struct definition

    *******************************************************************************

    once I comment the hand crafted we get following errors

    D:\Working copiess\Shilpa\WORKING\2nd_Oct_2013 DutyFree DLL Nawras-Hayyak\DutyFreeDll\Cards.cpp(171) : error C2027: use of undefined type 'xGetPinOutNaw'
            d:\working copiess\shilpa\working\2nd_oct_2013 dutyfree dll nawras-hayyak\dutyfreedll\egatesolution.h(25) : see declaration of 'xGetPinOutNaw'
    D:\Working copiess\Shilpa\WORKING\2nd_Oct_2013 DutyFree DLL Nawras-Hayyak\DutyFreeDll\Cards.cpp(171) : error C2227: left of '->sDate_Time' must point to class/struct/union
    D:\Working copiess\Shilpa\WORKING\2nd_Oct_2013 DutyFree DLL Nawras-Hayyak\DutyFreeDll\Cards.cpp(172) : error C2027: use of undefined type 'xGetPinOutNaw'

    *******************************************************************************

    Coreproject.cpp

    *******************************************************************************

    The main function called by the client ucGetPinOnline () is defined in the main file ie coreproject.cpp

    • // CoreProjectDLL.cpp : Implementation of DLL Exports.


      // Note: Proxy/Stub Information
      //      To build a separate proxy/stub DLL, 
      //      run nmake -f CoreProjectDLLps.mk in the project directory.

      #include "stdafx.h"
      #include "resource.h"
      #include <initguid.h>
      #include "CoreProjectDLL.h"

      #include "CoreProjectDLL_i.c"
      #include "cdll.h"

      #include <winsock2.h>
      #include "EGATESOLUTION.h"


      #include "Terminal.h"
      #include "Services.h"
      #include "Cards.h"




      #define MAXMODULE 50

      char module[MAXMODULE];

      struct xGetPinOutNaw PinInfo;
      extern struct Service maServices[];//defined in Service.c

      CComModule _Module;

      BEGIN_OBJECT_MAP(ObjectMap)
      OBJECT_ENTRY(CLSID_cdll, Ccdll)
      END_OBJECT_MAP()

      /////////////////////////////////////////////////////////////////////////////
      // DLL Entry Point

      extern "C"
      BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
      {
          if (dwReason == DLL_PROCESS_ATTACH)
          {
              _Module.Init(ObjectMap, hInstance, &LIBID_COREPROJECTDLLLib);
              DisableThreadLibraryCalls(hInstance);
          }
          else if (dwReason == DLL_PROCESS_DETACH)
              _Module.Term();
          return TRUE;    // ok
      }

      /////////////////////////////////////////////////////////////////////////////
      // Used to determine whether the DLL can be unloaded by OLE

      STDAPI DllCanUnloadNow(void)
      {
          return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
      }

      /////////////////////////////////////////////////////////////////////////////
      // Returns a class factory to create an object of the requested type

      STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
      {
          return _Module.GetClassObject(rclsid, riid, ppv);
      }

      /////////////////////////////////////////////////////////////////////////////
      // DllRegisterServer - Adds entries to the system registry

      STDAPI DllRegisterServer(void)
      {
          // registers object, typelib and all interfaces in typelib
          return _Module.RegisterServer(TRUE);
      }

      /////////////////////////////////////////////////////////////////////////////
      // DllUnregisterServer - Removes entries from the system registry

      STDAPI DllUnregisterServer(void)
      {
          return _Module.UnregisterServer(TRUE);
      }
      /////////////////////////////////////////////////////////////////////////////

    extern "C" __declspec(dllexport) int ucGetPinOnline(int isProduction,int itemid,char* dealerid,char* Transaction_Number,struct xGetPinOutNaw* struct_PinInfo,char sStoreNo[8],char sPOS_Serial[6],int serviceid)

    {

    int ret_val=-1;
    int i=0;

    int idenomination_index=0;
    BOOL stop_transactions =TRUE; 

    InitAccountInformationDetails(Transaction_Number,sStoreNo,sPOS_Serial);

    ServiceNawrasInit(serviceid); //initialize the service.

    // ret_val=StartTransaction(&maServices[0],idenomination_index,&stop_transactions,struct_PinInfo);

    ret_val=StartTransaction(isProduction,&maServices[0],&stop_transactions,itemid,dealerid,struct_PinInfo);

    return ret_val;

    }

    Now 

    **********************************************************************************

    tried searching Coreproject.h for adding the declaration of the function and the struct but found nothing..

    so created a .h file...EGATSOLUTION.h file and included that in the main...

    We hav two more file created ccdl.c and ccdl.h

    **********************************************************************************

    Finally we hav

    **********************************************************************************

    one struct in idl

    one struct  in EGATESOLUTION.h

    Now after discussing with you hav added the struct in the IDL file and you know after that...

    where do you think I might be going wrong.....at this point of time...

    Thanks for your kind support

    Shilpa 

    Sunday, October 6, 2013 10:52 AM
  • Hi Igor,

    One more thing looks dicy to me..as below..I m not putting the uuid before the struct in the IDL

    [uuid(some-GUID-here)]
    struct xGetPinOutNaw { BSTR sDate_Time; BSTR sRefTransaction_Number; BSTR spincode; BSTR sSerial_PinNo; BSTR sExpiry_date; BSTR sPromotion_msg; };

    this might be the reason of struct not getting accepted by the the COM.

    really dont undesrtand why and where I am going wrong...

    Can we work on teamviewer some day ..if thats possible...

    Thanks

    Shilpa

    Sunday, October 6, 2013 12:22 PM
  • [id(1), helpstring("method ucGetPinOnline")] HRESULT ucGetPinOnline([in] long isDemo, [in] long itemid, [in] BSTR dealerid, [in] BSTR Transaction_Number, [out] struct xGetPinOutNaw* struct_PinInfo, [in] BSTR* sStoreNo, [in] BSTR* sPOS_Serial, [in] long* serviceid);
    };

    Drop the stars for [in] parameters; "[in]  BSTR sStoreNo" and so on. I only added stars in my example because I assumed these to be [out] parameters.

    extern "C" __declspec(dllexport) int ucGetPinOnline(int isDemo,int itemid,char* dealerid,char* Transaction_Number,struct xGetPinOutNaw* struct_PinInfo,char sStoreNo[8],char sPOS_Serial[6],int serviceid);

    I thought ucGetPinOnline is supposed to be a method of a COM object, but here you are declaring it as a standalone global function. Which way is it? I'm confused.

    D:\Working copiess\Shilpa\WORKING\2nd_Oct_2013 DutyFree DLL Nawras-Hayyak\DutyFreeDll\Cards.cpp(171) : error C2027: use of undefined type 'xGetPinOutNaw'

    Since you now want to use the struct definition in the MIDL-generated .h file, you need to, you know, actually #include said .h file. Had this though not once occurred to you?


    Igor Tandetnik

    Sunday, October 6, 2013 1:39 PM
  • One more thing looks dicy to me..as below..I m not putting the uuid before the struct in the IDL

    Why not? What's stopping you? There's a tool called "guidgen" (on my machine, it's in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools). Use it to generate a new random GUID.

    Igor Tandetnik

    Sunday, October 6, 2013 1:43 PM
  • Hi Igor,

    • Have removed the stars from the said parameters
    • ucGetPinOnline - for my normal DLL I is as a standalone global function running  successfully with Client
    • There is another client who wants to use the function for the ATL Dll...I really dont know where to put that.am confused.I tried adding that in the Idll in the Ccdl....as well...not getting success...
    • The normal project I merged with the ATL DLL and sent it to the Client...He says He cant find the function in the Ccdl class and cannot access the parameters.
    • So I added the function in the class Ccdl and sent ...so then he is not able to see the parameters in his Microsoft dynamics NAV tool...
    • Now am trying to add the function in the idll.....firstly with the struct in the EGATESOLUTION.h file
    • error--

    D:\Working copiess\Shilpa\WORKING\6th_Oct_2013 DutyFree DLL Nawras- Hayyak\DutyFreeDll\CoreProjectDLL.idl(43) : error MIDL2011 : unresolved type declaration : xGetPinOutNaw [ Parameter 'struct_PinInfo' of Procedure 'ucGetPinOnline' ( Interface 'Icdll
    ' ) ]
    D:\Working copiess\Shilpa\WORKING\6th_Oct_2013 DutyFree DLL Nawras- Hayyak\DutyFreeDll\CoreProjectDLL.idl(43) : warning MIDL2039 : interface does not conform to [oleautomation] attribute : [ Parameter 'struct_PinInfo' of Procedure 'ucGetPinOnline' ( 
    Interface 'Icdll' ) ]

    • Secondly I added the struct in the Idll..created the uuid as told by you and added above the 

    [
    uuid(D05544DE-281E-4a62-994A-44A94D5A04A3),
    ]


    typedef struct xGetPinOutNaw {
    BSTR sDate_Time;
    BSTR sRefTransaction_Number;
    BSTR spincode;
    BSTR sSerial_PinNo;
    BSTR sExpiry_date;
    BSTR sPromotion_msg;
    };

    Error:

    D:\Working copiess\Shilpa\WORKING\6th_Oct_2013 DutyFree DLL Nawras- Hayyak\DutyFreeDll\CoreProjectDLL.idl(26) : error MIDL2312 : illegal syntax unless using mktyplib compatibility mode : xGetPinOutNaw
    D:\Working copiess\Shilpa\WORKING\6th_Oct_2013 DutyFree DLL Nawras- Hayyak\DutyFreeDll\CoreProjectDLL.idl(98) : warning MIDL2214 : semantic check incomplete due to previous errors 

    • Thirdly if I remove the typedef from the struct then 
    • Error

    D:\Working copiess\Shilpa\WORKING\6th_Oct_2013 DutyFree DLL Nawras- Hayyak\DutyFreeDll\CoreProjectDLL.idl(26) : error MIDL2072 : inapplicable attribute : [uuid] [ Struct 'xGetPinOutNaw' ( Interface '__MIDL_itf_CoreProjectDLL_0000' ) ]
    D:\Working copiess\Shilpa\WORKING\6th_Oct_2013 DutyFree DLL Nawras- Hayyak\DutyFreeDll\CoreProjectDLL.idl(43) : error MIDL2072 : inapplicable attribute : [uuid] [ Struct 'xGetPinOutNaw' ( Parameter 'struct_PinInfo' ) ]

    So thats the current scene...

    I hope am clear in telling you the scene.Kindly correct me where am I going wrong or what am I missing..

    Thanks

    Shilpa

             
    Monday, October 7, 2013 10:30 AM
  • This IDL file compiles just fine with my copy of VC2012: http://pastebin.com/UN7uAEey

    Figure out what you are doing differently.


    Igor Tandetnik

    Monday, October 7, 2013 12:59 PM
  • Thanks Igor for the time and support...

    If  it is compiling with you then there is definitely some settings I need to check for the MIDL for VC++...

    every time I compile there are new errors.... :)

    so just trying hard...


    if there is some setting to be done do let me know...

    In Ccdl I treid implementing interface and the Icdl is implemented as an interface...but now the error isthis

    now the error is this...Just a trial and error is going on....

    winnt.h (364)  :error MIDL2003 : redefinition : _LARGE_INTEGER

    winnt.h(383) : error MIDL2003 : redefinition : _ULARGE_INTEGER

    \winnt.h(529) : error MIDL2003 : redefinition : Int64ShllMod32

    \winnt.h(529) : error MIDL2025 : syntax error : expecting ; near "{"

    \winnt.h(531) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation

    Anyways...Thanks for your help..from time to time...

    Regards 

    Shilpa

    Tuesday, October 8, 2013 1:11 PM
  • Are you trying to #include any headers into your IDL file? Don't.

    Igor Tandetnik

    Tuesday, October 8, 2013 1:14 PM
  • Hi Igor,

    Am not using any #includes here

    Hav added this piece of code in stdAFX.h

    #define __Icdll_FWD_DEFINED__
    #define __Icdll_INTERFACE_DEFINED__
     #undef __Icdll_FWD_DEFINED__
    #undef __Icdll_INTERFACE_DEFINED__

    Also have added  struct xGetPinOutNaw; in the Library in IDL

    So the MIDL 2003 error has gone

    Now we have MIDL

    error MIDL2072 : inapplicable attribute : [uuid] [ Struct 'xGetPinOutNaw' ( Interface '__MIDL_itf_CoreProjectDLL_0000' ) ]

    for this you hav recommended for installing a latest pplatform sdk for vc6

    Is this link correct and if correct which version to instal is a big question..

    http://docs.moodle.org/dev/FebruaryPlatformSDK

    Kindly giv ur kind review and correct me if I am going wrong

    Thanks 

    Igor


    Wednesday, October 9, 2013 2:09 PM

  • for this you hav recommended for installing a latest pplatform sdk for vc6

    Is this link correct and if correct which version to instal is a big question..

    http://docs.moodle.org/dev/FebruaryPlatformSDK

    Yes, February 2003 Platform SDK is the latest SDK that still works with VC6 (speaking of which; why are you still using a 15 year old compiler that's long out of support?). And yes, the links on that page do appear like the best bet to obtain a copy February 2003 Platform SDK at this time.

    Igor Tandetnik

    Wednesday, October 9, 2013 2:27 PM