Problem for translating C function in lotuscript

Hello,

i would like to convert BMP file to Jpeg in lotusscript.

I use the DLL IMGDLL, but i have problems for using the function that get the BMP picture into an handle :

DEclaration of this function (in C):


HGLOBAL IMGEXP ImgDLLReadRGBFromBMP(const char * fileName, UINT32 *width,UINT32 *height);

HGLOBAL :Caller must use GlobalUnlock to get a ptr to this buffer!

Caller is responsible for calling GlobalFree on this buffer!


I don’t know how to translate the call of this function in lotusscript (or maybe in lotusscript it’s not possible ?).

Can anybody help me ?

Subject: problem for translating C function in lotuscript

GlobalUnlock: This function is provided only for compatibility with 16-bit versions of Windows.

are you programming for Windows 3.x?

plus, to get a ptr to a buffer, in 16bits Windows, you need to GlobalLock the handle, use it, and then only GlobalUnlock it (before freeing it)

but I dont see how you could easily use the pointer in LotusScript… the best solution is actually to write the core in ‘C’ and provide simple functions to be called from LotusScript, as was advised.

HTH

Subject: problem for translating C function in lotuscript

I think (but I’m no expert,too) that you have to :write a program in c externally, which does this stuff for you (build it to a dll). There the above function can be called.

But you have to define a function which can be used by Lotusscript as sort of interface; to this function you maybe just give the path to the bmp-file as a string or something like that. Then you put your new dll into your LotusScript code, call the “interface” - function and there you go.

Subject: RE: problem for translating C function in lotuscript

ok, i will try to do that.

thanks for your help.