Archived

This topic is now archived and is closed to further replies.

Montana

Nasty Compile errors on each project i try :p

Recommended Posts

Hey all, i was wondering if you guys could help a newby like me out of a nasty situation :/ I think i found a pretty nifty tutorial site through the Turbo links, but i keep getting the same compile errors with every project i use there. The problem is with pixelsdx.pas , in the function Dxsurfacelock i keep erorring @ if TheSurface.Lock( @LockRect, TheSurfaceDesc, DDLOCK_SURFACEMEMORYPTR+DDLOCK_WAIT, 0 )<>DD_OK then Result:=False; with the message : Incompatible Types : ''TDDSurfaceDesc2'' and ''TDDSurfaceDesc2'' --- I tried to find what it actually was but due to my newbyness i just get frustrated by it... Might any of you have an idea what''s causing this ? http://www.multimania.com/jdelauney/dxgeissfx.zip is the source of the project i''m trying to compile... (it''s not just this example but with all the projects i found on that website...) Does anyone have an idea ? and if he does : how to fix it and what is actually wrong ? so i can learn from it... --- Greets!

Share this post


Link to post
Share on other sites
Well,

When I upgraded to some of the these versions of the DelphiX library I also encountered this error. It seems that some folks thought it was ok to go tinkering around with the DelphiX Classes itself without extensive testing.

My fix was to do a "clean" install of a trusted DelphiX library.

Note: I have found the Turbo DelphiX code to be quite stable.

Share this post


Link to post
Share on other sites
I'm not sure from the error message, but usually I'd expect the error to look like:

"Incompatible Types : 'T DDSurfaceDesc2' and 'P DDSurfaceDesc2'"
or
"Incompatible Types : 'P DDSurfaceDesc2' and 'T DDSurfaceDesc2'"

Or something like that, in that case you should try:

if TheSurface.Lock( @LockRect, TheSurfaceDesc^ , DDLOCK_SURFACEMEMORYPTR+DDLOCK_WAIT, 0 )<>DD_OK then Result:=False;

or

if TheSurface.Lock( @LockRect, @TheSurfaceDesc , DDLOCK_SURFACEMEMORYPTR+DDLOCK_WAIT, 0 )<>DD_OK then Result:=False;

Depending on the actual problem, that might fix everything for you.

Alternatively... look for a different pixel handler, like those provided by turbo:

turboPixels v1.2
or
PixelCore for DelphiX

At the very least you can learn from those examples how other programmers handle the same problem... GooDLucK

Henri aka A-Lore


Edited by - LoreKeeper on February 24, 2002 8:44:45 AM

Share this post


Link to post
Share on other sites
Just a thought:
One of yor addin units might be declaring its own TDDSurfaceDesc2, such that:


unit UnitA;
interface
type
TMyClass=class
{something}
end;
function func(MyClass:TMyClass);
implmentation
end.


unit UnitB;
interface
type
TMyClass=class
{something}
end;
implmentation
end.


//My program
uses UnitA,UnitB;


In your program the type UnitB.MyClass is used whenever you declare something as MyClass, however UnitA.Func requires a UnitA.MyClass. The same thing could also be happening on a deeper level (within one of the units being used)

Share this post


Link to post
Share on other sites