PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Problems with upgrade to 3.50

Hello all... Just dropped 3.50 into a project I was getting started under 3.01, and I have a problem I can't seem to overcome:

With this defintion:
CGapiSurface* pCurrentMapTiles[100];

This line throws an exception:
pCurrentMapTiles[1]->CreateSurface(NULL, pCGame->hInst, GFX_TILE_MAP_1_01, TEXT("GRAPHICS"));

It's an access violation, I believe because pCurrentMapTiles[1] is null.

Now, previously I had the following line right before that:

pCurrentMapTiles[1] = new CGapiSurface();

But now when I try that, I get:

error C2512: 'CGapiSurface' : no appropriate default constructor available

So, my question is:

Am I not dealing with surfaces properly? It used to work fine this way, and I kind of want to be dealing with pointers to surfaces all the time, so how do I now construct a CGapiSurface so that this will work (i.e., what do I pass to the constuctor? I don't see anything related to that in the samples or in the docs... am I missing it?)

Thanks!
Never mind, I DID miss it... Need to pass m_cGapiDraw now.
Ok, that problem is solved, but I still have another problem, although a more minor one...

Doing a desktop build, I get:

LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library

I'm anal when it comes to clean builds, so I want to get rid of this. Doing a quick Google search led me to add the following library ignores in Project Settings under Link/Input/Ignore Libraries:

libcmt.lib msvcrt.lib libcd.lib libcmtd.lib msvcrtd.lib

That DIDN'T help. Checking Ignore Default Libraries leads to compile ERRORS, so it wouldn't appear to be the right answer.

Any suggestions? Thanks!
Yes, as is usually the case, I solved it a minute after posting...

Needed to change the project setting under C/C++ / Code Generation / Use Runtime Library (to Single-Threaded).

Thanks self, all problems solved! :)
Argh, the first question I had WAS in the documentation... Note to self... Always read the readme!

Another question though...

I created an ARM binary but when I try and run it on my Axim I get the "...one of it's components is missing" message. I thought everything in this version was statically linked? So I shouldn't need to include any DLL, should I? I noticed the GapiDraw.dll for ARM, and copied it to the device but still no go.

Would I get this message if I didn't have the HI_RES_AWARE resource present? (because I didn't). But, that raises another question... My Axim (X5) is obviously not VGA, but the project is... will it run at all? Even if I only see a quarter of the screen? Or will it die horribly?
Yes indeed, I answered this one myself...

As I thought, NO DLL is required. It's just in the GD folder for linking. Makes sense.

The "missing component" was NOT GD-related at all... I forgot I had Hekkus in the project already, even though there's no sound yet. My bad.

Ok, all is right with the world, and you can ignore the silly man here! :)
Oh yeah, and the answer to the question about what will happen on a QVGA device... It in fact does display the upper left-hand corner of the screen, so at least I know my project is working even if I can't see the full VGA screen.
Talking to yourself again Frank? =p
Argh, way to much some days! ;)

The funny thing is, I usually laugh when I see mlepage doing this, it's kind of his trademark. :)
ha ha ha

Who's laughing now? :lol:
Glad you find it amusing... I was worried you'd sue me for trademark infringement ;)
what a nice thread.. everyone participated :P
Frank, for a minute there I thought I was reading your blog. :lol:
Might make a good blog entry...
Erick: Same here! :)
Can we change the thread title to

" Teach yourself GD 3.01 conversion to GD 3.5 in 1 hour ? "

:D
Too late, I'm writing the Idiot's Guide.

(I'm sure there's a joke in there, something along the lines of "takes one to teach one", or something of that nature :) )
Well, I'm also converting my code from 3.01 to 3.5 and this post helps :D