Game Development Community

Getting error when encrypting the resources

by Pratik Murarka · in Torque Game Builder · 05/05/2008 (4:24 am) · 13 replies

I am using torque game builder pro 1.7.2 .

I have used this link : "http://tdn.garagegames.com/wiki/Torque_2D/Asset_Encryption" for encryption as a reference & followed it's in instruction step by step ( using Visual studio 2008 .net framework version 3.5 ).

I have added the source code (from CipherLib folder downloaded) in GarageGames\TorqueGameBuilder-1.7.2\engine\source & recompile the project.

After that I have written the encryption code : "$CipherTool = new Cipher();" into my project script file in gamescript.

Getting this following error on project run : "Unable to instantiate non-conobject class Cipher."

I am confused where is the problem it in TGB pro or project which I have created.

Can anybody help me on this !!!!!!!!!!!!!!!!!!!!!!!

Thanks In advance.

#1
05/05/2008 (10:15 am)
Hi,

did you add all source files to your VC-project (especially Cipher.cc)?
#2
05/05/2008 (9:14 pm)
Thanks for reply Michael 1st,

ya I have added all the source file (which was there in CipherLib folder including Cipher.cc
source file )

I would like to tell you that,I have add the source file under "TGBGame.vcproj" & "TorqueGameBuilder.vcproj".
#3
05/06/2008 (1:05 am)
Yes, that should be ok that way. I think I'll find some time to try it out myself with vs2008. The resource has not been tested with it yet.
#4
05/06/2008 (2:04 am)
Hi,
do you get any compiler errors. I just had problems compiling TGB out of the box with Visual C++ 2008 Express Edition. This seems to be a problem of re-building TGB in the first place. Are you using the Express Edition and did you install Microsoft's Platform SDK?
#5
05/06/2008 (4:03 am)
Yes I am using Visual C++ 2008 Express Edition & Microsoft's Platform SDK is not install on my PC!!!!!!!!


Ya do get compile error :

when I compile on VC++ (by pressing F5), It first ask me to enter the executable file for debug session

so I have given a path : "C:\Program Files\GarageGames\TorqueGameBuilder-1.7.2\tgb\TorqueGameBuilder.exe"
& clicked OK.

then it gives a error pop : "Debugging information for TorqueGameBuilder.exe cannot be found or does not match. Binary was not built with debug information."

This was my compile error Michael, thanks for reply again.
#6
05/06/2008 (11:24 am)
There are two recent threads on compiling TGB with Visual C++ Express Edition:

http://www.garagegames.com/mg/forums/result.thread.php?qt=73142
http://www.garagegames.com/mg/forums/result.thread.php?qt=72238

Maybe they can help you. At least for Todd Degani in the first thread it seemed to work in the end.
#7
05/06/2008 (11:10 pm)
Hi Michael thanks for help,

Ya I read 5 C++ Engine thread.
And worked on some of the thread also but didn't found any success yet.

I am new to torque scripting, there is one basic question (since I am not sure about it) that how can compile tgb should I ? "right click on .vcproj file & then click on build " or " choose debug option (by pressing F5 on VC)".

&

I want to tell that, I am not using windows platform SDk. Is it essential for this problem to get resolved ????????
#8
05/06/2008 (11:45 pm)
Hey,

recompiling Torque can be done by selecting "Build Solution" in the "Build"-menu in the menu bar. This will only produce a new executable if the whole build process completes without any errors. If there is an error, the executables distributed with TGB's standard installation will not be overwritten with the new ones, thus you won't be able to use any new functionality you added to the engine source. This is what probably causes your problem of not being able instantiate a Cipher object in script.

The Platform SDK is essential if you are using an Express Edition of Visual Studio. It just contains stuff that is needed by Torque and which is not distributed with the Express Editions.

However, C++ source modification is something rather advanced for a TGB user and requires some experience with C++ and compilers in general. Also, resource protection is something that can always be added at the end of your project if you still feel the need to do so. Maybe it is a good idea to wait a little with this, write your game in script, and come back to the problem when you got more comfortable with the whole environment.
#9
05/07/2008 (1:50 am)
Thanks for help Michael,

I am writing the errors which i got now,

just have a look if get some idea out of it.

1>------ Skipped Build: Project: TorqueGameBuilder, Configuration: Debug Win32 ------
1>Project not selected to build for this solution configuration
2>------ Build started: Project: TGBGame, Configuration: Debug Win32 ------
2>Compiling...
2>thread.cc
2>mutex.cc
2>win32MsgBox.cpp
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\nativedialogs\win32msgbox.cpp(76) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const UTF16 *' to 'LPCWSTR'
2> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>win32DirectoryResolver.cpp
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\nativedialogs\win32directoryresolver.cpp(74) : error C2664: 'PathAddExtensionW' : cannot convert parameter 1 from 'UTF16 [260]' to 'LPWSTR'
2> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\nativedialogs\win32directoryresolver.cpp(78) : error C2664: 'IPersistFile::Load' : cannot convert parameter 1 from 'UTF16 [260]' to 'LPCOLESTR'
2> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\nativedialogs\win32directoryresolver.cpp(93) : error C2664: 'IShellLinkW::GetPath' : cannot convert parameter 1 from 'UTF16 [260]' to 'LPWSTR'
2> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\nativedialogs\win32directoryresolver.cpp(97) : error C2664: 'PathIsDirectoryW' : cannot convert parameter 1 from 'UTF16 [260]' to 'LPCWSTR'
2> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
#10
05/07/2008 (1:56 am)
2>popupMenuWin32.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\menus\popupmenuwin32.cc(216) : error C2065: 'MIIM_STRING' : undeclared identifier
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\menus\popupmenuwin32.cc(293) : error C2065: 'MIIM_STRING' : undeclared identifier
2>winWindow.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(38) : error C2440: 'initializing' : cannot convert from 'const wchar_t [22]' to 'const UTF16 *'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(39) : error C2440: 'initializing' : cannot convert from 'const wchar_t [16]' to 'UTF16 [256]'
2>        There is no context in which this conversion is possible
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(146) : error C2664: 'CreateMutexW' : cannot convert parameter 3 from 'UTF16 [512]' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(199) : error C2664: 'CreateProcessW' : cannot convert parameter 1 from 'UTF16 [512]' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(246) : error C2664: 'CreateMutexW' : cannot convert parameter 3 from 'UTF16 [512]' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(282) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'UTF16 [1024]' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(299) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'UTF16 [1024]' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(316) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'UTF16 [1024]' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(537) : error C2664: 'ToUnicode' : cannot convert parameter 4 from 'U16 [3]' to 'LPWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(1268) : error C2440: '=' : cannot convert from 'const UTF16 *' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(1329) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const UTF16 *' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(1763) : error C2664: 'SetWindowTextW' : cannot convert parameter 2 from 'UTF16 [256]' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(1895) : error C2665: 'convertUTF16toUTF8' : none of the 2 overloads could convert all the argument types
2>        c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\core\unicode.h(69): could be 'const U32 convertUTF16toUTF8(const UTF16 *,UTF8 *,U32)'
2>        while trying to match the argument list '(wchar_t [512], char [512], int)'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(1933) : error C2664: 'CreateProcessW' : cannot convert parameter 2 from 'UTF16 [1024]' to 'LPWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(1942) : error C2440: 'initializing' : cannot convert from 'const wchar_t [28]' to 'const UTF16 *'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(1951) : error C2664: 'RegOpenKeyExW' : cannot convert parameter 2 from 'const UTF16 *' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(1974) : error C2664: 'RegOpenKeyExW' : cannot convert parameter 2 from 'const UTF16 *' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winwindow.cc(1996) : error C2664: 'RegOpenKeyExW' : cannot convert parameter 2 from 'const UTF16 *' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

2>winStrings.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winstrings.cc(118) : error C2664: 'wcscmp' : cannot convert parameter 1 from 'const UTF16 *' to 'const wchar_t *'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winstrings.cc(168) : error C2664: 'wcslen' : cannot convert parameter 1 from 'const UTF16 *' to 'const wchar_t *'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winstrings.cc(394) : error C2664: 'WideCharToMultiByte' : cannot convert parameter 3 from 'const UTF16 *' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winstrings.cc(406) : error C2664: 'MultiByteToWideChar' : cannot convert parameter 5 from 'UTF16 *' to 'LPWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
#11
05/07/2008 (1:57 am)
2>winSemaphore.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winsemaphore.cc : error C2471: cannot update program database 'c:\program files\garagegames\torquegamebuilder-1.7.2\engine\link\debug.win32\tgbgame.pdb'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winsemaphore.cc(59) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winsemaphore.cc(59) : error C2418: cannot delete browser file: ../../Link/Debug.Win32/TGBGame\winSemaphore.sbr
2>winRedbook.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winredbook.cc : error C2471: cannot update program database 'c:\program files\garagegames\torquegamebuilder-1.7.2\engine\link\debug.win32\tgbgame.pdb'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winredbook.cc(130) : error C2440: '=' : cannot convert from 'UTF16 [512]' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winredbook.cc(480) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winredbook.cc(480) : error C2418: cannot delete browser file: ../../Link/Debug.Win32/TGBGame\winRedbook.sbr
2>winProcessControl.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winprocesscontrol.cc : error C2471: cannot update program database 'c:\program files\garagegames\torquegamebuilder-1.7.2\engine\link\debug.win32\tgbgame.pdb'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winprocesscontrol.cc(28) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winprocesscontrol.cc(28) : error C2418: cannot delete browser file: ../../Link/Debug.Win32/TGBGame\winProcessControl.sbr
2>winOpenAL.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winopenal.cc : error C2471: cannot update program database 'c:\program files\garagegames\torquegamebuilder-1.7.2\engine\link\debug.win32\tgbgame.pdb'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winopenal.cc(132) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winopenal.cc(132) : error C2418: cannot delete browser file: ../../Link/Debug.Win32/TGBGame\winOpenAL.sbr
2>winOGLVideo.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winoglvideo.cc : error C2471: cannot update program database 'c:\program files\garagegames\torquegamebuilder-1.7.2\engine\link\debug.win32\tgbgame.pdb'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winoglvideo.cc(858) : error C2065: 'AW_BLEND' : undeclared identifier
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winoglvideo.cc(858) : error C3861: 'AnimateWindow': identifier not found
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winoglvideo.cc(1240) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winoglvideo.cc(1240) : error C2418: cannot delete browser file: ../../Link/Debug.Win32/TGBGame\winOGLVideo.sbr
2>winNet.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winnet.cc : error C2471: cannot update program database 'c:\program files\garagegames\torquegamebuilder-1.7.2\engine\link\debug.win32\tgbgame.pdb'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winnet.cc(827) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winnet.cc(827) : error C2418: cannot delete browser file: ../../Link/Debug.Win32/TGBGame\winNet.sbr
2>winMemory.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winmemory.cc : error C2471: cannot update program database 'c:\program files\garagegames\torquegamebuilder-1.7.2\engine\link\debug.win32\tgbgame.pdb'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winmemory.cc(56) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winmemory.cc(56) : error C2418: cannot delete browser file: ../../Link/Debug.Win32/TGBGame\winMemory.sbr
2>Generating Code...
2>Compiling...
2>winInput.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\wininput.cc : error C2471: cannot update program database 'c:\program files\garagegames\torquegamebuilder-1.7.2\engine\link\debug.win32\tgbgame.pdb'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\wininput.cc(940) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\wininput.cc(940) : error C2418: cannot delete browser file: ../../Link/Debug.Win32/TGBGame\winInput.sbr
2>winGLSpecial.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winglspecial.cc : error C2471: cannot update program database 'c:\program files\garagegames\torquegamebuilder-1.7.2\engine\link\debug.win32\tgbgame.pdb'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winglspecial.cc(2826) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\winglspecial.cc(2826) : error C2418: cannot delete browser file: ../../Link/Debug.Win32/TGBGame\winGLSpecial.sbr
2>winGL.cc
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\wingl.cc : error C2471: cannot update program database 'c:\program files\garagegames\torquegamebuilder-1.7.2\engine\link\debug.win32\tgbgame.pdb'
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\wingl.cc(352) : error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'UTF16 [1024]' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\wingl.cc(363) : error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'UTF16 [1024]' to 'LPCWSTR'
2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\wingl.cc(582) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>c:\program files\garagegames\torquegamebuilder-1.7.2\engine\source\platformwin32\wingl.cc(582) : error C2418: cannot delete browser file: ../../Link/Debug.Win32/TGBGame\winGL.sbr
#12
05/07/2008 (1:57 am)
And many more
#13
05/07/2008 (1:59 am)
Some of ending lines were
2>Generating Code...
2>Creating browse information file...
2>Microsoft Browse Information Maintenance Utility Version 9.00.21022
2>Copyright (C) Microsoft Corporation. All rights reserved.
2>BSCMAKE: error BK1506 : cannot open file '..\..\Link\Debug.Win32\TGBGame\cardProfile.sbr': No such file or directory
2>Build log was saved at "file://c:\Program Files\GarageGames\TorqueGameBuilder-1.7.2\engine\Link\Debug.Win32\TGBGame\BuildLog.htm"
2>TGBGame - 121 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 6 up-to-date, 1 skipped ==========