Hi Sternas,
firstly, thank you for your assistance. I'm still a somewhat green user of Delphi/CT, so appreciate your help. I'll try using the tool you mentioned as I'm sure that's very useful too. I seem to have found that although WNetAddConnection2 is well supported under Delphi, the API wrapper under CT appears to be missing most of the constants as listed by Microsoft (
msdn.microsoft.com/en-us/library/windows...385413(v=vs.85).aspx). In fact the only one I can find listed in the CT windows wrapper is CONNECT_UPDATE_PROFILE. When I insert this into my code and delete CONNECT_TEMPORARY, the program compiles just fine (though of course my program is not working as expected).
I tried adding CONNECT_TEMPORARY under defines.inc (part of API wrapper in CT) but when compiling, CT doesn't find it. Being inexperienced, I also don't know how the wrapper makes the connection between WNetAddConnection2 (redef.inc) and CONNECT_UPDATE_PROFILE (defines.inc), but that's a Pascal programming problem on my part, and not a CT issue.
The bottom line is it appears that WNetAddConnection2 is missing many constant definitions as prescribed by Microsoft. I wouldn't mind fixing the problem/files myself if I knew where to go/what to do.
I see you also say the CONNECT_TEMPORARY constant is available in
jwawinnetwk.pas but then shouldn't this be picked up when using the Windows unit? I would be very wary of throwing a random unit into my code, in case this constant (by coincidence) has the same name, but is referring to something else entirely different. Just my humble opinion. The example you have given me is (I think) a good example of this. Using the tool you mentioned, I have looked in the
jwawinnetwk.pas file and CONNECT_TEMPORARY is shown to have a value of 4 (hex) whereas Microsoft say the value should be 8.