Sign in to follow this  
Followers 0
nugame

Duplicate declared values during compiling

9 posts in this topic

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

Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 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.

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 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.

 

Share this post


Link to post
Share on other sites

I have always had problems with this

If Not IsDeclared(.....

never seems to work for me

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

I have always had problems with this

If Not IsDeclared(.....

never seems to work for me

8)

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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by nugame

Dr SherlockAlways a way

Share this post


Link to post
Share on other sites

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 UDF

best 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.

 

Share this post


Link to post
Share on other sites

Read it wrong. I already commented line out and it compiled. Thanks.


Dr SherlockAlways a way

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0