static object in function? (C++)

BlitzMax Forums/BlitzMax Programming/static object in function? (C++)

slenkar(Posted 2010) [#1]
hi I have a function or a method of an object in c++
my Scene object is called scn
Scene scn;

the method is load

scn.load(char *filename);

how would i call that from blitzmax?

I have a c++ function called loadscene that i created:

extern "C"{
int loadscene(char *filename);
}

int loadscene(char *filename)
{
AmbroseScene scn;
scn.load(filename);
}

but it causes an access violation and i dont know the reason

I have tried putting AmbroseScene scn; out side of the function which still gives an access violation.
the code is cpp


Brucey(Posted 2010) [#2]
To start with, according to the docs, it's a static function :
AmbroseScene::load()

You don't use an instance of AmbroseScene to call it.

Your other issue is likely to be that it appears to be a Visual C++ library... which you'll have to wrap with a C-based DLL if you want to access it from BlitzMax (which is GCC-based).


slenkar(Posted 2010) [#3]
In the download they had some sample code,
they called load from an instance,
(in the ambrose3d\src folder in main.cpp)

How can you tell its a visualc++ library?(for future reference)