Workaround for #import

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Workaround for #import

Louis Dionne via cfe-dev
Hello everyone,

currently I'm converting some old visual studio projects for the use with the clang compiler. Everything was fine, until I hit the following line:
#import <file.tlb> rename("SendMessage", "SendMessage")


Clang stop the work and complained:
error : #import of type library is an unsupported Microsoft feature


I get it - this doesn't work, but is there no workaround or another solution for this problem?

Kind regards
Björn

Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789
Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Workaround for #import

Louis Dionne via cfe-dev
Hi Björn, 

It's been a decade or two since I used #import, so I could be misremembering, but here's an idea: 

#import of x.tlb generates two files: x.tlh and x.tli. They are (heavily VC-specific) C++ sources.

If you can get your VC build to generate those, and #include the tlh and compile the tli as a source file in your Clang build, I think Clang supports enough language features for it to work. 

Fingers crossed, 
- Kim 

Den 23 mars 2018 11:42 fm skrev "via cfe-dev" <[hidden email]>:
Hello everyone,

currently I'm converting some old visual studio projects for the use with the clang compiler. Everything was fine, until I hit the following line:
#import <file.tlb> rename("SendMessage", "SendMessage")


Clang stop the work and complained:
error : #import of type library is an unsupported Microsoft feature


I get it - this doesn't work, but is there no workaround or another solution for this problem?

Kind regards
Björn

Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789
Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Workaround for #import

Louis Dionne via cfe-dev
Hey Kim,

your idea worked! Thank you a lot!

Kind regards
Björn



From:        Kim Gräsman <[hidden email]>
To:        [hidden email]
Cc:        Clang Dev <[hidden email]>
Date:        23.03.2018 18:20
Subject:        Re: [cfe-dev] Workaround for #import




Hi Björn, 

It's been a decade or two since I used #import, so I could be misremembering, but here's an idea: 

#import of x.tlb generates two files: x.tlh and x.tli. They are (heavily VC-specific) C++ sources.

If you can get your VC build to generate those, and #include the tlh and compile the tli as a source file in your Clang build, I think Clang supports enough language features for it to work. 

Fingers crossed, 
- Kim 

Den 23 mars 2018 11:42 fm skrev "via cfe-dev" <[hidden email]>:
Hello everyone,

currently I'm converting some old visual studio projects for the use with the clang compiler. Everything was fine, until I hit the following line:
#import <file.tlb> rename("SendMessage", "SendMessage")



Clang stop the work and complained:
error : #import of type library is an unsupported Microsoft feature



I get it - this doesn't work, but is there no workaround or another solution for this problem?


Kind regards

Björn


Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789
Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.

_______________________________________________
cfe-dev mailing list

[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789
Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev