Untested but worth trying
#if file("C:\Program Files\netappdirectory\filename.tlb")
# define TLB_FILE "C:\Program Files\netappdirectory\filename.tlb"
#else
# define TLB_FILE "C:\Program Files (x86)\netappdirectory\filename.tlb"
#endif
DEFINE CLASS AppEvents AS SESSION
IMPLEMENTS iEvents IN TLB_FILE
or
DEFINE CLASS AppEvents AS SESSION
#if file("C:\Program Files\netappdirectory\filename.tlb")
IMPLEMENTS iEvents IN "C:\Program Files\netappdirectory\filename.tlb"
#else
IMPLEMENTS iEvents IN "C:\Program Files (x86)\netappdirectory\filename.tlb"
#endif
>I posted this question yesterday, but do not see it in my list of messages so reposting....
>
>
>I have a class defined for com interop with a .net dll which works great -- i hook into the events and can pass to/from the .net dll and fire events in vfp from the .net dll.
>
>The issue is Windows 7 64 versus 32 bit. The .net dll is always installed in the program files unless of course it is 64 bit windows which then installs into program files (x86).....
>
>In the DEFINE CLASS section, I have to point to the .tlb in the IMPLEMENTS statement
>
>If I point explicitly to the location:
>
>DEFINE CLASS AppEvents AS SESSION
>IMPLEMENTS iEvents IN "C:\Program Files\netappdirectory\filename.tlb"
>
>or
>
>IMPLEMENTS iEvents IN "C:\Program Files (x86)\netappdirectory\filename.tlb"
>
>both work fine.
>
>However in the class definition, I cannot use (syntax errors -- not allowed):
>
>IF DIRECTORY(look for x86) AND FILE() etc...
> IMPLEMENTS iEvents IN "C:\Program Files (x86)\netappdirectory\filename.tlb"
>ELSE
> .....
>ENDIF
>
>But I can:
>before class definition: lcNetDirfile = "C:\Program Files....."
>and then in the class definition do this:
>
>IMPLEMENTS iEvents IN (EVALUATE(lcNetDirFile))
>
>however, it doesn't really work. It builds fine (no errors), but doesn't really work. I cannot hook into the events.
>
>I need a way to have a conditional use of implements in the class definition....
>
>Any ideas?
Gregory