Setting Types in C

BlitzMax Forums/BlitzMax Programming/Setting Types in C

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

No way with Byte Ptr, my Strings are alway empty :(

So whats with C++? I've tested this:
Ref.cpp
#include <brl.mod/blitz.mod/blitz.h>
#include <windows.h>

class TTest {
public:
	BBString *a;
	BBString *b;
	BBString *c;

	TTest() {
		a = &bbEmptyString;
		b = &bbEmptyString;
		c = &bbEmptyString;
	}

	virtual ~TTest() {
		a = &bbEmptyString;
		b = &bbEmptyString;
		c = &bbEmptyString;
	}
	
	virtual void getTest() {
		a = bbStringFromCString("Foo");
		b = bbStringFromCString("Bar");
	
		char info[255];
		sprintf(info, "%d ms", GetTickCount());
		c = bbStringFromCString(info);
	}
};


extern "C" {

TTest *CreateTTest(){
	return new TTest;
}

void DestroyTTest(TTest *test) {
	delete test;
}

}


Ref.bmx
SuperStrict

Framework BRL.Blitz

Import "ref.cpp"

Extern 

Type TTest
	Field a : String
	Field b : String
	Field c : String

	Method _pad1() ' padding for virtual destructors
	Method _pad2()
	Method getTest()
End Type

Function CreateTTest:TTest()
Function DestroyTTest(test:TTest)

End Extern

Local test:TTest = CreateTTest()
For Local i:Int = 0 Until 1000
	test.getTest()
	DebugLog test.a + " " + test.b + " " + test.c
	Delay 10
Next

DestroyTTest(test)


Getting some times output like:
DebugLog:FooDebugLog:Foo Bar 4498281 ms
...
DebugLog:Foo 4500109 ms 4500109 ms


Whats wrong?

cu olli