Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. MIDL: Error related to Forward Dec;aration

MIDL: Error related to Forward Dec;aration

Scheduled Pinned Locked Moved COM
c++helpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ahsan Abbas
    wrote on last edited by
    #1

    Hi All, I am working on a project(.dsp in Visual C++ 6.0) which has multiple .idl files, many of these .idl files has cross reference. Actually what I mean is, a function inside file1's interface(interface_of_file1) takes a parameter of file2's interface(interface_of_file2). Plus, a function in interface_of_file2 takes parameter of interface_of_file1. I hope you people got the idea that both files need the other file to be compiled. In this situation, if I import file2 in file1 and compile file1, compiler tries to compile file2 first and gives error that: error MIDL2025 : syntax error : expecting a type specification near "interface_of_file1" . Now this is a kind of Dead Lock. I did Forward declaration instead of importing the file(I do not exactly know the method offorward declaration in MIDL). I did it in file1 like: interface interface_of_file2; Now this gives a different error and a warning: ============================================== error MIDL2011 : unresolved type declaration : interface_of_file2 [ Parameter 'parameter1' of Procedure 'get_CashPeriod' ( Interface 'interface_of_file1' ) ] warning MIDL2039 : interface does not conform to [oleautomation] attribute : [ Parameter 'parameter1' of Procedure 'get_CashPeriod' ( Interface 'interface_of_file1' ) ] ============================================== Now please tell me, whether I'm doing forward declaration wrongly? or can anyone suggest some other solution to this problem? I will be really thankful for any good answer. Regards, Ahsan Ahsan

    S 1 Reply Last reply
    0
    • A Ahsan Abbas

      Hi All, I am working on a project(.dsp in Visual C++ 6.0) which has multiple .idl files, many of these .idl files has cross reference. Actually what I mean is, a function inside file1's interface(interface_of_file1) takes a parameter of file2's interface(interface_of_file2). Plus, a function in interface_of_file2 takes parameter of interface_of_file1. I hope you people got the idea that both files need the other file to be compiled. In this situation, if I import file2 in file1 and compile file1, compiler tries to compile file2 first and gives error that: error MIDL2025 : syntax error : expecting a type specification near "interface_of_file1" . Now this is a kind of Dead Lock. I did Forward declaration instead of importing the file(I do not exactly know the method offorward declaration in MIDL). I did it in file1 like: interface interface_of_file2; Now this gives a different error and a warning: ============================================== error MIDL2011 : unresolved type declaration : interface_of_file2 [ Parameter 'parameter1' of Procedure 'get_CashPeriod' ( Interface 'interface_of_file1' ) ] warning MIDL2039 : interface does not conform to [oleautomation] attribute : [ Parameter 'parameter1' of Procedure 'get_CashPeriod' ( Interface 'interface_of_file1' ) ] ============================================== Now please tell me, whether I'm doing forward declaration wrongly? or can anyone suggest some other solution to this problem? I will be really thankful for any good answer. Regards, Ahsan Ahsan

      S Offline
      S Offline
      safee ullah
      wrote on last edited by
      #2

      i think what you can do is to compile the first idl file using midl compiler and then include the generated files into the 2nd midl and then compile it..in this way hopefully u wont come across this problem again.. regards safee

      A 1 Reply Last reply
      0
      • S safee ullah

        i think what you can do is to compile the first idl file using midl compiler and then include the generated files into the 2nd midl and then compile it..in this way hopefully u wont come across this problem again.. regards safee

        A Offline
        A Offline
        Ahsan Abbas
        wrote on last edited by
        #3

        I am doing the same thing. What I do is that I right click the .idl file and compile only that file from there. Do you want me to specifically do it from command prompt? Btw, I have tried this as well :( But this gives the same problem. What do you suggest now? Ahsan

        S 1 Reply Last reply
        0
        • A Ahsan Abbas

          I am doing the same thing. What I do is that I right click the .idl file and compile only that file from there. Do you want me to specifically do it from command prompt? Btw, I have tried this as well :( But this gives the same problem. What do you suggest now? Ahsan

          S Offline
          S Offline
          safee ullah
          wrote on last edited by
          #4

          oh ok...i think then there is some problem in: 1. either the dependencies settings 2. the header files.. regards

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups