Similar Threads:
1.List of some of the bugs fixed bugs in DeXter
2.Fix VC++/Borland libpq build - pqsignal
3.problem using delphi dll in vc++
hi,
I am using a delphi DLL in vc++,static linked with ".h"and "lib".
the export functions in DLL are "__stdcall",but the function doesn't
work well,it often returns some weird values.
when I add codes as follows,it suddenly works well. why??
DWORD returnAdd;
__asm
{
mov ecx,[ebp+4]
mov returnAdd, ecx
}
I am confused,if there is something wrong with stack,I have already
using "__stdcall",why it is still wrong?
I don't even know what those asm code do,I just add them to get some
status about stack.what else they do to the program that I don't know?
thank you .
Ryan
4.porting from 16 bit Borland c to 32 vc++ (emergency)
hi
this is an emergency and i need to know wat wud be the sizes of various
stuctures wriiten in 16 bit borland c (c++ i think). i need to read the
files of the old version software and i have read most of the objects stored
but some still need help.
struct OldMultiBuffer {
unsigned unused:3; // Unused flags
unsigned isCeiling:1; // Object is on the ceiling
int x0,y0,z0; // 3D reference point
RECT topBounds; // Plan view bounds
int unused2[2]; // Unused space
int height; // Height of bottom of obj
BYTE unused3[28]; // Unused space
void *unused4; // Meaningless pointer
int rotatedAngle;
int thisWallHeight;
};
this is one struct i need to know the sizeof.
Another is a piece of code which i need to know how much it reads so i can
skip the part. it is storing a bitmap.
file.get((PARENT*) this+1,sizeof *this-sizeof(PARENT)-sizeof hDib);
the PARENT is:
struct far Obj: public ObjBase
{
HOBJ group; // Owning group or NULL
HOBJ hNext; // Next object in group or NULL
HOBJ hPrev; // Previous object in group or NULL
enum Type { // Object type
Group, // (00) Group of objects
Text, // (01) Text
Line, // (02) Line
Conline, // (03) Constrained line
Rect, // (04) Rectangle
RoundRect,// (05) Rounded Rectangle
Ellipse, // (06) Ellipse
Arc, // (07) Arc
Poly, // (08) Polygon
Sketch, // (09) Freehand sketch
Chart, // (0A) Chart
Bitmap, // (0B) Clip art
Slice, // (0C) Pie slice
Chord, // (0D) Chord of ellipse
DimLine, // (0E) Dimension line
Wall, // (0F) Wall
Multi, // (10) Multiview object
HollowLine,// (11) Hollow line
Stud, // (12) Studs
Horizon, // (13) Horizon line
} type;
WORD obView; // Object view
WORD obLayer; // Object layer
struct far Flags {
unsigned isLocked:1; // Object is currently locked
unsigned isHidden:1; // Object is currently not visible
unsigned canAltSelect:1;// Object has alternate select mode
unsigned isSelected:1;// Object is currently selected
unsigned isAltSelected:1;// Object in alternate select mode
unsigned isPartial:1; // Object is being edited
unsigned isGroup:1; // Class is (derived from) GroupObj
unsigned boundsDirty:1;// Object bounds must be recalculated
unsigned isEstimable:1;// Include in estimator export
unsigned isMaterial:1; // Include in materials list
unsigned cantFlip:1; // Object is reflectively retarded
unsigned cantRotate:1;// Object is rotationally retarded
unsigned reserved2:4;// Future use
Flags (void) { *(LPWORD) this=0; }
operator WORD (void) const { return *LPWORD(this); }
void operator = (WORD w) { *LPWORD(this)=w; }
} flags;
char szdescribe1[20]; // Object character description
char szdescribe2[20]; // Estimating text field
char szUnit[3]; // Estimating unit field
int nObjID; // Identification number
WORD magnifyX; // Horz magnification in 1024ths
WORD magnifyY; // Vert magnification in 1024ths
WORD nDataIndex1; // Plant number in plant database
int nAge; // Age for plants, -1 if N/A
RECT workBounds; // Cached bounds rectangle
int height; // Height of wall; height of other
// objs off ground; ignored for // Multi-view objs on ceiling
static BOOL bReadingOldMigFile; // From pre-ObjReadBuffer days
static POINT hitPoint;
static char scratch[80];
Obj(Type); // Constructor
virtual ~Obj (void); // Destructor
static Obj *read (InFile&); // Read object from input file
Obj *next (void); // Get next object in group
Obj *prev (void); // Get previous object in group
virtual void select (void); // Select object for editing
void unselect (void); // Unselect object
virtual RECT getBoundsRect (void)=0; // Get logical bounds
virtual RECT getUpdateRect (void);// Get drawing bounds
virtual RECT getHandleRect (void);// Get sizing handle rect
virtual WORD describe (void); // Return description string ID
virtual int getRotatedAngle (void);// Get angle object has rotated
virtual int getObjHeight (void); // Return object height off ground
virtual int getObjWidth (void); // Return width (x) and length (y) of
virtual int getObjLength (void); // object in logical units
virtual long getObjArea (void); // Return area in square logical units
virtual long getObjLinearfeet (void);// Get linear ft if applicable
virtual LPSTR getObjAngle (void);// Get angle from vertical
// (not rotated angle)
virtual BOOL hit (RECT*)=0; // Test hit by rectangle
virtual TextObj *hitText (RECT*);// Test hit on editable text
virtual Handle *getHitHandle (POINT); // Test hit on handle
virtual void outline (void); // Draw object outline
virtual void draw (BOOL grayed=FALSE);// Draw complete object
virtual void drawHandles (void); // Draw object handles
virtual void moveHandle (Handle*,POINT); // Move handle of object
virtual void unMoveHandle (HaMemo*);// Undo handle movement
virtual void releaseHandle (Handle*);// End handle movement
virtual void doChange (Change*); // Apply attribute change
virtual void unChange (Change::Type,ChMemo*); // Unapply attribute change
virtual void reChange (Change::Type,ChMemo*); // Reapply attribute change
virtual void apply (Xform&)=0; // Apply coordinate xform
virtual void unApply (XfMemo*); // Unapply coordinate xform
virtual void reApply (XfMemo*); // Reapply coordinate xform
virtual void devChange (void); // Adjust to new device or res
virtual void setScale (WORD,WORD); // Change drawing-to-world scale
virtual void prep (void); // Prepare to write to file
virtual void put (OutFile&); // Write object to file
virtual Obj* getDeleteObj (void); // Get underlying obj to delete
virtual InfoDlg *getInfoDlg (void); // Return properties dialog
int getDescription (LPSTR,int);
LPSTR getObjLayer (void); // Return layer object is in
protected:
virtual int enumHandles (BOOL f(int,int)); // Enumerate handles
static BOOL drawHandle (int,int); // Draw one object handle
static BOOL hitHandle (int,int); // Test hit on handle
static int enumCorners (RECT*,BOOL f(int,int));
};
and below is this:
struct BitmapObj: public Obj {
RECT pos; // Location, not normalized
POINT size; // Bitmap size in pixels
int accuHandle; // Handle to Accusoft bitmap
HGLOBAL hDib; // Handle to the DIB
};
i think this is reading 14 bytes but i am not sure since on some files it
seem to work but not on all.
5.problem using delphi dll in vc++
hi,
I am using a delphi DLL in vc++,static linked with ".h"and "lib".
the export functions in DLL are "__stdcall",but the function doesn't
work well,it often returns some weird values.
when I add codes as follows,it suddenly works well. why??
DWORD returnAdd;
__asm
{
mov ecx,[ebp+4]
mov returnAdd, ecx
}
I am confused,if there is something wrong with stack,I have already
using "__stdcall",why it is still wrong?
I don't even know what those asm code do,I just add them to get some
status about stack.what else they do to the program that I don't know?
thank you .
Ryan