Thread

help with c++ error in linking (Bots)

help with c++ error in linking // Bots

1  |  

.scooter

Jun 25, 2006, 2:52pm
uhhhh, nope i dont know programming, just experimenting here but ...
this must have worked before in older c++ ver (VS98) & linking source with
aw 3.x sdk, ... but now with c++ ver8 (VS-2005 pro) , linking same source
with aw sdk 41 build 61, this "struct" line errors. (botdlg.ccp)


CString sTemp;
CString sNewBuffer;
int i, iOffset;
int iLen = sSource.GetLength();
CTime xTime = CTime::GetCurrentTime();
CTimeSpan xVRTOffset(0,2,0,0); // 2 hours offset from GMT
xTime -= xVRTOffset;
-> struct tm *xpTime = xTime.GetGmtTm();
char *spDest = sNewBuffer.GetBuffer(500);

// additional "if" , "for", "switch" , "case", stuff omited here
to save space

* linking error shows- error c2660: 'ATL::CTime::GetGmtTm' : function
does not take 0 arguments


ookay, like what arguments? ideas?
(using the 90 day trial IMG of VS2005 pro, and the msdn part of IMG has bad
files & wont install ,,, sure, i expected 2.7gig to dnload correctly, lol)

ok, experimenting & changing line to ...
struct tm *xpTime = xTime.GetGmtTm(0);
then at least project compiles / links / produces an exe wich runs, opens
main window, gets dns conversion for AW host name, but then errors after
selecting a script file to start a bot, "unknown error" , (debug ver of the
exe opens / runs same & says debug assertion failed and ref's to ATL &
cTime)

any other value or char within the ( ) causes linking error , so far.

..Scooter

.scooter

Jul 8, 2006, 11:01pm
Hi .. fwiw

(Hambot 3.3 source with AWSdk 4.1 build 61)

Using VS2005 pro, These changes allow Hambot ver3.3 source to compile, link,
and create a working Release-ver, that will connect & run in AW4.1 (w/o
getting the errors related to ATL & CTime)

This method won't create a Debug-ver, due showing an unresolved external.

--------------------------------------------------

StdAfx.h
=========
// added at begining

#define _SECURE_ATL 0 // Disable Secure ATL
#define _CRT_SECURE_NO_DEPRECATE // Disable Warnings
#define _ATL_SECURE_NO_DEPRECATE // Disable Warnings


HamBotDlg.ccp
==============
// changed port

#define PORT_UNIVERSE_SERVER 6670


Bot.ccp
========
// Added to anounce position away from a worlds GZ on entering world.
// Bot isn't moved to user's coords in bot script until after world entry.

// changed under - CBot::CBot( ... )

m_lWestEast = m_lNorthSouth = 1000000;

// Added under - AWV2_GetWorldInfo()

aw_int_set(AW_MY_X, m_lWestEast);
aw_int_set(AW_MY_Y, m_lAltitude);
aw_int_set(AW_MY_Z, m_lNorthSouth);
aw_state_change();
return TRUE;


HamBotDlg.ccp
==============
// commented out following lines or sections
// that caused errors

// lines under - CHamBotDlg::ProcessScript()

case WORLD_RGB_RED: ...
case WORLD_RGB_GREEN: ...
case WORLD_RGB_BLUE: ...

// sections under - CHamBotDlg::Evaluate( ... )

case 'c': // red backdrop
case 'f': // blue backdrop
case 'g': // green backdrop

// sections under - CHamBotDlg::ExpandMacros( ... )

case 'c': // add red backdrop
case 'f': // add blue backdrop
case 'g': // add green backdrop

Also
======
// change includes to aw.h per your project
// #include "..\cof\aw.h"

#include "aw.h"




[View Quote]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn