Wednesday 24 July 2013

Structure member alignment for client and server programming with JDE

Quick note to self:

When writing an OSA to work on a windoze (windows) server, use a structure member alignment of 4, /Zp4 .  If you are testing your OSA on the client then ensure that the struct member alignment is 1, or /Zp1.  It's easy too look at the command in various iterations of visual studio to ensure that the struct member alignment is correct.

Highlight the project (not the solution) and fork project, properties

Open general menu item
Then c/C++ then code generation.  Under there you'll find "Struct Member Alignment" - set this.

Then goto command line under the c/c++ window and you're command will look something like:

/Od /I "D:\E910_1\DV910\include" /I "D:\e910_1\system\includev" /I "d:\e910_1\system\include" /D "_WINDLL" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Zp1 /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /Wp64 /ZI /TP /errorReport:prompt

What is that for?  windows CLIENT of course!

Note also (to help you if you're struggling), the link command looks like:

/OUT:"C:\Users\shannonm\Documents\Visual Studio 2008\Projects\myBIGPDF\Debug\myBIGPDF.dll" /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"Debug\myBIGPDF.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\Users\shannonm\Documents\Visual Studio 2008\Projects\myBIGPDF\debug\myBIGPDF.pdb" /DYNAMICBASE:NO /MACHINE:X86 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Ensure that you include jde.h (you'll need this).  You'll need to include dirs like "include and include) under system and you'll also need to include lib and libV dirs.  Also the specific resource files for functions that you call will need to be added to the project.

No comments: