Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, AndrewAMD), 14,749 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
AUM31 #124001
04/14/07 14:09
04/14/07 14:09
Joined: Feb 2006
Posts: 33
Herts, UK
D
danohu Offline OP
Newbie
danohu  Offline OP
Newbie
D

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 Offline
User
bstudio  Offline
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
D
danohu Offline OP
Newbie
danohu  Offline OP
Newbie
D

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 Offline
User
bstudio  Offline
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: bstudio] #124005
05/02/07 22:57
05/02/07 22:57
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
I'm not sure what version of the engine you are using to test the dll; as an example, "temp" has disappeared from the current version of the engine. Anyway, reading the email I've got from you makes me think that you might have forgotten to link the .lib file to the project.

One more thing: the syntax has changed a lot since Aum31, so my ancient code will only run with the old sdk. The new sdk is much more user friendly.

Re: AUM31 [Re: George] #124006
06/12/07 21:44
06/12/07 21:44
Joined: Feb 2006
Posts: 33
Herts, UK
D
danohu Offline OP
Newbie
danohu  Offline OP
Newbie
D

Joined: Feb 2006
Posts: 33
Herts, UK
Hi

I am still struggling with this but haven't given up. I tried the code above which did not help. I noticed when I click on 'T' I get the message 'Malfunction W1523 KillFile Not found in DLL'. When I then click 'OK' it incorrectly says 'The file was deleted successfully'. My questions are:

1. Does anyone know what 'Malfunction W1253' means?
2. Does anyone know how to check that I have linked the lib.file to the project?

Thanks for all the support received previously!

Re: AUM31 [Re: danohu] #124007
06/16/07 00:24
06/16/07 00:24
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

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);



Re: AUM31 [Re: testDummy] #124008
07/15/07 15:04
07/15/07 15:04
Joined: Feb 2006
Posts: 33
Herts, UK
D
danohu Offline OP
Newbie
danohu  Offline OP
Newbie
D

Joined: Feb 2006
Posts: 33
Herts, UK
Hi

Thanks for the help. I have taken some time to get back to it.
When I try to build the DLL with the following code mentioned above:


#include "stdafx.h"
#define DLL_USE
#include "adll.h"

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
engine_bind();
return TRUE;
}
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);
}

I get the following three errors.

c:\Projects\Last\Last.cpp(17): warning C4312: 'type cast' : conversion from 'long' to 'STRING *' of greater size
c:\Projects\Last\Last.cpp(18): error C3861: 'remove': identifier not found, even with argument-dependent lookup
c:\Projects\Last\Last.cpp(25): warning C4312: 'type cast' : conversion from 'long' to 'VECTOR *' of greater size

Would you have any advice on how to correct these? I found a good tutorial on the GameStudio site about creating a DLL in .Net which seems to have helped me as well.


Moderated by  George 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1