Very mysterious variable reference error!

Discussions specific to Team Developer 5.1.

Very mysterious variable reference error!

Postby JaakkoTerhonen » Wed Dec 02, 2009 8:31 am

Hello!

TD5.1/SP6 running on XP/SP3: a compiled and fine-working application was installed into another machine and there it suddenly started giving error

"variable <variable name> does not exist or it cannot be referenced from current location"

(maybe not exactly in these words but everyone probably recognizes the error :wink: ).

Question: how can an .EXE give _syntax error_ after deploying it ?

I have confirmed that the deployment version is the same in both machines.

Could it be some Windows C++ library in the target machine ? Where should I look ?

Thank You very much for any help!

Best regards,
Jaakko Terhonen
JaakkoTerhonen
 
Posts: 33
Joined: Fri Jan 25, 2008 9:20 am

Re: Very mysterious variable reference error!

Postby clemdoc » Wed Dec 02, 2009 8:40 am

Hi!

Just a quick thought: You're sure, you didn't forget an APD?
greetings, clem
clemdoc
 
Posts: 238
Joined: Tue May 12, 2009 8:18 pm
Location: Graz, Austria

Re: Very mysterious variable reference error!

Postby JaakkoTerhonen » Thu Dec 03, 2009 12:47 am

"APD" ? Sorry but I'm not familiar with that abbreviation ?
JaakkoTerhonen
 
Posts: 33
Joined: Fri Jan 25, 2008 9:20 am

Re: Very mysterious variable reference error!

Postby clemdoc » Thu Dec 03, 2009 12:59 am

Hi!

I was referring to a 'Dynalib'. The files usually have an extension of '.apd'. However, I just did a test, and a missing dynalib results in a different error, so just forget my post. sorry I couldn't help you.
greetings clem
clemdoc
 
Posts: 238
Joined: Tue May 12, 2009 8:18 pm
Location: Graz, Austria

Re: Very mysterious variable reference error!

Postby JaakkoTerhonen » Thu Dec 03, 2009 2:43 am

Thanks anyway, Clem! For a while I was thinking of Anti-Psychotic-Drugs....sometimes feels like they would help :wink:
JaakkoTerhonen
 
Posts: 33
Joined: Fri Jan 25, 2008 9:20 am

Re: Very mysterious variable reference error!

Postby tlauzi » Thu Dec 03, 2009 3:23 am

Hi Jakko,

here some questions and some advises:

-Do you play with the context in your app e.g. SalContextSet(..)?
-Please provide more details... e.g. when does the error happen (during Sql operation,....) exactly, what are the differences between the machines,....?

For finding the error I have to suggestions (without knowing more details from your application and environment):

-Compile your application in "playback mode": "Menu: Project\Build Settings\Enable Playback"
The application generates now a playback file when running. Load your application-source file in TD 5.1 and the load the playback file "Menu: Debug\Playback" and the application runs with the playback file through the source until the error occurs.

-Download WinDebug from Microsoft: With this you could debug any application on the WinAPI level. I had some irregular spontan crashes of our application on some machines and I did not know from where they come. I used WinDebug to find out, that they came from an Vis* function where I put a null value in. I located all places in my application and checked for an empty value and the error was vanished.
Best Regards,
Thomas L.
tlauzi
 
Posts: 196
Joined: Mon Jan 07, 2008 10:26 am
Location: near Frankfurt, Germany

Re: Very mysterious variable reference error!

Postby JaakkoTerhonen » Thu Dec 03, 2009 3:51 am

Hi Thomas!

Thank You for those very good suggestions! I have never used the playback but that really seems useful in this case. Great !

I don't use SalContextSet, and I believe that the error occurs when executing a SELECT statement.

The scenario: a dialog is activated while processing the SAM_Activate message of a column in a table. The dialog also has a table which is populated. That's when the error occurs, naming a column which it cannot refer to. I managed to create a work-around for this by making the column name unique in the whole application, so this obviously is a context issue. No, the table from where the dialog was called does not contain an equally named column, that would be too easy :-)

Besides this table column I have had the same error with a variable name in a class function. Again, context problem. But there's no error in the development PC :o

The development environment is in a WMWare virtual PC and the target machine is a Citrix server. I have not yet had time to look closer into the differences.

mfg,
Jaakko
JaakkoTerhonen
 
Posts: 33
Joined: Fri Jan 25, 2008 9:20 am

Re: Very mysterious variable reference error!

Postby tlauzi » Thu Dec 03, 2009 6:21 am

Hi Jaakko,


>>SAM_Activate message of a column in a table

How does your code look exactly from structure?


1. Try to post a message on the stack, so that you activation message processing is finished, before you open the dialog, perhaps this helps.
Changing focus/context during focus changing/activation could sometimes lead to problems.

On SAM_Activate/ SAM_SetFocus
Call SalPostMsg(hWndForm, PAM_PostActivate,0,0)

On PAM_PostActivate
Call SalModalDialog(...)

2. Try to fetch the result in global variables (the are everywhere/time present in the application) and look it the error occurs.
Then try to set the values in the columns...

You have to try different scenarios/workaround to come more closer to the problem....
Best Regards,
Thomas L.
tlauzi
 
Posts: 196
Joined: Mon Jan 07, 2008 10:26 am
Location: near Frankfurt, Germany

Re: Very mysterious variable reference error!

Postby JaakkoTerhonen » Thu Dec 03, 2009 9:45 am

Hi! New information: the platform where I created the .EXE was Windows XP, and the runtime is Windows Server 2003 R2 Enterprise Edition. So is TD not compatible with that? :shock:
JaakkoTerhonen
 
Posts: 33
Joined: Fri Jan 25, 2008 9:20 am

Re: Very mysterious variable reference error!

Postby tlauzi » Fri Dec 04, 2009 1:43 am

I don´t think so, because we run TD4.2 on Windows Server 2003/2008.

Try to come more closer to the error...
Best Regards,
Thomas L.
tlauzi
 
Posts: 196
Joined: Mon Jan 07, 2008 10:26 am
Location: near Frankfurt, Germany

Re: Very mysterious variable reference error!

Postby Peter.Hugk » Fri Dec 04, 2009 4:37 am

We have encountered that if the develpment system and the deployment system used different Windows Formats (Regional and Language Options). For example an exe created with Format Englisch (Great Britain) will not run under Czech (Czech republic).
You need to compile the exe with the appropriate Format set.

This is a bug in TD 5.1 which we so far did not communicate to Unify yet.
User avatar
Peter.Hugk
 
Posts: 274
Joined: Mon Feb 18, 2008 12:27 am
Location: Germany

Re: Very mysterious variable reference error!

Postby huiskala » Mon Dec 07, 2009 6:15 am

Just as Peter told, this really is a bug in Team Developer. Unify is aware of this issue and it has a TD number TD-7207.

The only fully working workaround is to compile the exe with the same Regional Settings as which are used on the end user's workstation. Of course this is not an acceptable solution, and may even be impossible since at least we cannot know which settings the end users are having.

You can also try to rename the variable, but most probably this will only help a short while until you get the same error message from another variable.

We are waiting a fix to this problem from Unify. IMHO I think they should publish a new Service Pack including fix to this issue.
Oskari Huiskala
Tieto Finland
User avatar
huiskala
 
Posts: 71
Joined: Wed Dec 19, 2007 12:29 pm
Location: Finland

Re: Very mysterious variable reference error!

Postby randy » Fri Jul 02, 2010 5:02 am

This error has been fixed in TD52 SP1, but today we got this error reported from a czech customer. We deploy T52 SP1 + EMP5259.
Building the exe with Czech Regional settings is a workaround and fixed our problem for the moment. Does anyone else still have this problem?
--
Best Regards
Andreas Rau
randy
 
Posts: 83
Joined: Tue Dec 18, 2007 9:18 am
Location: Karlsruhe, Germany


Return to Team Developer 5.1

Who is online

Users browsing this forum: No registered users and 1 guest

cron