Hello,
nowadays I have this piece of code:
#import "C:\Users\Public\SoundLog\DLLs\ForPython\SoundLogDLL.tlb" named_guids
but I want to substitute the C:\Users\Public part by the %PUBLIC% environment variable.
How can I do this ?
Hello,
nowadays I have this piece of code:
#import "C:\Users\Public\SoundLog\DLLs\ForPython\SoundLogDLL.tlb" named_guids
but I want to substitute the C:\Users\Public part by the %PUBLIC% environment variable.
How can I do this ?
Using a hard coded path in your code is never a good idea.
I recommend using a relative path and keeping your type library under the same folder structure as your code.
Then doing something like this:
#import <SoundLogDLL.tlb> named_guids
It would be wise to store your projects in a common folder so that you can use relative paths. The #import directive also searches files in the same folders where it looks for #include files. In the IDE, you can add them with Project + Properties, C/C++, General, Additional Include Directories.
I think that your best option is to write #import "SoundLogDLL.tlb" named_guids
in your code, and then use either the INCLUDE
environment variable, the /I
command-line switch to the compiler, or the Additional Include Directories
IDE option to point the compiler in the right direction.