 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
acp693
Joined: 04 Sep 2006 Posts: 56
|
Posted: Tue Mar 03, 2009 3:08 pm Post subject: calling dll trouble |
|
|
Hello,
I'm trying to call a function from an external dll. However, I'm getting an Access violation error message. I'm using the Import libraries option in the project configuration dialogue box in Plato. The project compiles ok, but doesn't run. I'm doing something wrong but I don't know what!
Thanks
Albert
This is my code:
Code: | winapp
program test_metagif
C_EXTERNAL MetaGif 'MetaGif' ( val,val,val,val)
Integer,parameter :: w = 100, h = 100
call MetaGif('Temp\gif001.wmf', 'Temp\gif001.gif', w, h)
endprogram |
This is the information I have about the function in the dll:
MetaGif
Declare Function MetaGif Lib "METAGIF32.DLL" (ByVal inputFile As String, ByVal outputFile As String, ByVal scaleX As Long, ByVal scaleY As Long) As Long
Parameters
* inputFile - input file name (wmf/emf/bmp)
* outputFile - output file name (gif)
* scaleX - scale factor percentage (100 = width*1)
* scaleY - scale factor percentage (150 = height*1.5) |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Mar 04, 2009 9:15 am Post subject: |
|
|
My guess is that you will need
Code: |
STDCALL MetaGif 'MetaGif' (instring,instring,val,val) |
at the very least but I am not sure that this will work. |
|
Back to top |
|
 |
acp693
Joined: 04 Sep 2006 Posts: 56
|
Posted: Wed Mar 04, 2009 11:52 am Post subject: |
|
|
Thanks Paul, I eventually got it to work with the following. It works with .wmf files produced from other applications, but unfortunately not with .wmf files saved from simpleplot, which is what I need....
I think I've reached the end with simpleplot as it seems almost impossible to save images to disc without problems. I can't save an image to a bitmap from a %pl window, the resulting bitmap is size 1 pixel by 1 pixel.
I can save a .wmf, but can't work further with this. The exercise here was a workaround for not being able to save bitmaps from a simpleplot window, the idea being to save as .wmf and then convert to .gif or .bmp with the function below, but this doesn't work either.
Now where were those opengl demos....
Code: | winapp
program test_metagif
stdcall MetaGif 'MetaGif' (ref,ref,val,val) : integer*4
Integer, parameter :: w = 100, h = 100
integer:: r, MetaGif
r= MetaGif('C:\gif001.wmf', 'C:\gif001.gif', w, h )
endprogram |
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|