replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - calling dll trouble
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

calling dll trouble

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
acp693



Joined: 04 Sep 2006
Posts: 56

PostPosted: Tue Mar 03, 2009 3:08 pm    Post subject: calling dll trouble Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Wed Mar 04, 2009 9:15 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
acp693



Joined: 04 Sep 2006
Posts: 56

PostPosted: Wed Mar 04, 2009 11:52 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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