MIDL: Error related to Forward Dec;aration
-
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
-
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
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
-
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
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
-
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
oh ok...i think then there is some problem in: 1. either the dependencies settings 2. the header files.. regards