nugame Posted October 10, 2006 Share Posted October 10, 2006 I have a compiler problem and get this message - ERROR: $WM_GETTEXT previously declared as a 'Const' Global Const $WM_GETTEXT = 0x000D. Here are my includes: #include <SysTray_UDF.au3> #include <GUIConstants.au3> #include <Date.au3> #include <File.au3> #include <pnplib.au3> ; my libraries of custom functions This Const is in SysTray_UDF.au3 and WindowsConstants.au3 in GUIConstants.au3. Other language compilers I used handles duplicates but not here. I looked at the directives and saw nothing to resolve this. Is there some switch I can use to allow duplicate or what is the procedure to resolve this? Thanks. Dr SherlockAlways a way Link to comment Share on other sites More sharing options...
CoePSX Posted October 10, 2006 Share Posted October 10, 2006 You could try to replace the code in them. Using IsDeclared solves this problem. If (Not IsDeclared($WS_GETTEXT)) Then Global Const $WS_GETTEXT = 0x000D EndIf This will check if the constant was already declared. If it wasn't, then declare it. [quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"]╔══════════════════════════════╗║░░██░░░░░░░░██░░███░░░████░░░█║║░█░░█░░██░░█░░█░█░░█░█░░░░█░█░║║░█░░░░█░░█░████░███░░░██░░░█░░║║░█░░█░█░░█░█░░░░█░░░░░░░█░█░█░║║░░██░░░██░░░██░░█░░░░███░█░░░█║╚══════════════════════════════╝[/font] Link to comment Share on other sites More sharing options...
GaryFrost Posted October 10, 2006 Share Posted October 10, 2006 (edited) You could try to replace the code in them. Using IsDeclared solves this problem. If (Not IsDeclared($WS_GETTEXT)) Then Global Const $WS_GETTEXT = 0x000D EndIf oÝ÷ Ù8b³¥È^rH¶¢{-j{pjÆ¥æÉתÞtâ·¬m¶§uç%j·¢·ú®¢×mébz÷«pY[¢fè©pk+,k(ßÛ'¢×^rV¢ç^Ø^¯²jëh×6 If Not IsDeclared("WM_GETTEXT") Then Assign("$WM_GETTEXT", 0x000D) Edited October 10, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 10, 2006 Share Posted October 10, 2006 (edited) gets nasty, but the above won't work 100% correctly either. best to just comment out the line in the UDF This looks like it might work, but I think you'll find people like Valik that frown on this Only difference is there is no $ in the IsDeclared If (Not IsDeclared("WS_GETTEXT")) Then Global Const $WS_GETTEXT = 0x000D EndIf Edited October 10, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Valuater Posted October 10, 2006 Share Posted October 10, 2006 I have always had problems with this If Not IsDeclared(..... never seems to work for me 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 10, 2006 Moderators Share Posted October 10, 2006 I have always had problems with thisIf Not IsDeclared(.....never seems to work for me8)I don't think I've ever used it personally. I generally just edit my files as neccessary when I have issues like the above. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
nugame Posted October 10, 2006 Author Share Posted October 10, 2006 (edited) Thanks for the fast update. I am trying to resolve the final code develeopment so I can deliver the next phase. I cannot comment out the UDF. This UDF was put it to deal with the icon left in the system tray after the process is killed. So, one has to hack around to make it work. Would this be a good feature for the compiler? I can make my own modified include file but could be the beginning of a maintenance nightmare. Any other thoughts before I customize? Edited October 10, 2006 by nugame Dr SherlockAlways a way Link to comment Share on other sites More sharing options...
GaryFrost Posted October 10, 2006 Share Posted October 10, 2006 Thanks for the fast update. I am trying to resolve the final code develeopment so I can deliver the next phase. I cannot comment out the UDF. This UDF was put it to deal with the icon left in the system tray after the process is killed. So, one has to hack around to make it work. Would this be a good feature for the compiler? I can make my own modified include file but could be the beginning of a maintenance nightmare. Any other thoughts before I customize?I didn't say comment out the UDFbest to just comment out the line in the UDF SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
nugame Posted October 10, 2006 Author Share Posted October 10, 2006 Read it wrong. I already commented line out and it compiled. Thanks. Dr SherlockAlways a way Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now