|
AUM31
#124001
04/14/07 14:09
04/14/07 14:09
|
Joined: Feb 2006
Posts: 33 Herts, UK
danohu
OP
Newbie
|
OP
Newbie
Joined: Feb 2006
Posts: 33
Herts, UK
|
Hi, I hope someone can help? I am working with ‘Beginner’s corner: Using the sdk: learn to work with the software development kit’ in AUM31. I am using Microsoft Visual Studio.Net 2003.
I can build the first dll and get the following message:
Compiling… Stdafx.cpp first.cpp Linking
Build log was saved at \\File://c:\MyDlls\first\Debug\Buildlog.htm
Build:1 Succeeded, 0 Failed, 0 Skipped
---------Done-------
Build: 1 Succeeded, 0 Failed, 0 Skipped
When I then modify the first.cpp file and add:
DLLFUNC fixed KillFile(long file) { fixed *temp = (fixed*)adll_getwdlobj("temp"); A4_STRING *my_file = (A4_STRING *)file; return INT2FIX(remove (my_file -> chars));
I get the following message when I click on 'build':
------ Build started: Project: first, Configuration: Debug Win32 ------
Compiling... first.cpp c:\My Dlls\first\adll.h(14) : fatal error C1083: Cannot open include file: 'atypes.h': No such file or directory
Build log was saved at "file://c:\My Dlls\first\Debug\BuildLog.htm" first - 1 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
Would anyone know how to overcome the problemn when using Microsoft Visual Studio.Net 2003?
Thanks in advance!
|
|
|
Re: AUM31
[Re: danohu]
#124002
04/14/07 14:29
04/14/07 14:29
|
Joined: Aug 2006
Posts: 652 Netherlands
bstudio
User
|
User
Joined: Aug 2006
Posts: 652
Netherlands
|
put the atypes.h file in your project directory
BASIC programmers never die, they GOSUB and don't RETURN.
|
|
|
Re: AUM31
[Re: bstudio]
#124003
05/01/07 21:03
05/01/07 21:03
|
Joined: Feb 2006
Posts: 33 Herts, UK
danohu
OP
Newbie
|
OP
Newbie
Joined: Feb 2006
Posts: 33
Herts, UK
|
Hi
Thanks for your help. I have been away for some time but have returned to the problem. I now get the following error when I compile. Would you know if there is a simple reason for this?
------ Build started: Project: first, Configuration: Debug Win32 ------
Compiling...
first.cpp
c:\MyDlls\first\first.cpp(17) : error C2146: syntax error : missing ';' before identifier 'KillFile'
c:\MyDlls\first\first.cpp(19) : error C2065: 'temp' : undeclared identifier
c:\MyDlls\first\first.cpp(19) : error C2059: syntax error : ')'
c:\MyDlls\first\first.cpp(20) : error C2065: 'A4_STRING' : undeclared identifier
c:\MyDlls\first\first.cpp(20) : error C2065: 'my_file' : undeclared identifier
c:\MyDlls\first\first.cpp(20) : error C2059: syntax error : ')'
c:\MyDlls\first\first.cpp(21) : error C2227: left of '->chars' must point to class/struct/union
type is ''unknown-type''
c:\MyDlls\first\first.cpp(20) : error C3861: 'A4_STRING': identifier not found, even with argument-dependent lookup
c:\MyDlls\first\first.cpp(21) : error C3861: 'INT2FIX': identifier not found, even with argument-dependent lookup
c:\MyDlls\first\first.cpp(21) : error C3861: 'my_file': identifier not found, even with argument-dependent lookup
Build log was saved at "file://c:\MyDlls\first\Debug\BuildLog.htm"
first - 10 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
Below is the code which I think is OK:
// first.cpp : Defines the entry point for the DLL application.
#include "stdafx.h" #include "adll.h" #include "afuncs.h" #include <io.h>
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; }
DLLFUNC fixed KillFile(long file) { fixed *temp = (fixed *)adll_getwdlobj("temp"); A4_STRING *my_file = (A4_STRING *)file; return INT2FIX(remove (my_file -> chars));
|
|
|
Re: AUM31
[Re: danohu]
#124004
05/02/07 11:13
05/02/07 11:13
|
Joined: Aug 2006
Posts: 652 Netherlands
bstudio
User
|
User
Joined: Aug 2006
Posts: 652
Netherlands
|
Code:
DLLFUNC var fixed KillFile(long file) { fixed *temp = (fixed *)adll_getwdlobj("temp"); STRING *my_file = (STRING *)file; if(remove(my_file->chars)) { return _VAR(1); } else { return _VAR(-1); } }
No idea if it works, but you could try it
Last edited by bstudio; 05/03/07 09:16.
BASIC programmers never die, they GOSUB and don't RETURN.
|
|
|
Re: AUM31
[Re: danohu]
#124007
06/16/07 00:24
06/16/07 00:24
|
Joined: Oct 2004
Posts: 1,655
testDummy
Serious User
|
Serious User
Joined: Oct 2004
Posts: 1,655
|
Three days later you probably have this solved already, but if you don't: Remove fixed? Code:
DLLFUNC var KillFile(long file) { STRING *my_file = (STRING *)file; if(remove(my_file->chars)) { return _VAR(1); } else { return _VAR(-1); } } //fixed *temp = (fixed *)adll_getwdlobj("temp"); // temp is a pointer to VECTOR structure with newer SDK? VECTOR* vTemp = (VECTOR*) engine_getobj("temp"); if (vTemp == NULL) { return _VAR(0); } vTemp->x = _VAR(3.14f);
Alternately, use the SDK packaged with 6.40.5 or 6.50.6 along with the applicable 3DGS version, and this should probably work: Code:
DLLFUNC var KillFile(STRING* _sFile) { if (_sFile == NULL || _sFile->chars == NULL || strlen(_sFile->chars) < 1) { return _VAR(0); } return _VAR(remove(_sFile->chars)); }
// in C-Script plugindir = "."; // place the dll plugin in your project directory "." // or set this string to Visual C++ Directory dllfunction KillFile(_sFile);
|
|
|
|