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 

Threads

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



Joined: 15 Jun 2006
Posts: 46

PostPosted: Wed Oct 18, 2006 9:56 am    Post subject: Threads Reply with quote

Hi

When I was using v4.8 I could get multiple threads working.
When I upgraded to v4.9.0 it stopped working.

In a function I use this:
C_EXTERNAL beginthread '_beginthread' (REF, VAL, REF):Integer*4

and then call it with:
iNoErrorL = beginthread(iCalcSidesThreadTwo, 0, 0)

The function has the form:
Integer*4 Function iCalcSidesThreadTwo(iDummyP)

Integer*4 iDummyP

Return
End Function

In the Project Explorer References I have:
KERNEL32.LIB
LIBCMT.LIB
msvcrt.dll
MSVCRT.LIB
SIMPLE.DLL

I have no idea as to whether this is correct, I just bunged in what I need for my software.
I have taken msvcrt.dll out as it wasn't in my Plato 2 project, but it makes no difference.

When I used Plato 2, under Options -> Default Libraries, I had:
MSVCRT.LIB
LIBCMT.LIB
KERNEL32.LIB
MPR.LIB

The thread is not called as I have output to the screen that does not appear.
I changed nothing but upgraded from v4.8 to v4.9.0.

I don't get any errors/warnings from the compiler to say that the libraries could not be loaded etc.
If I use project/properties/configuration properties/compiler options/source/import libraries, I get the error:
"unable to import library msvcrt.lib"
or
"unable to import library msvcrt.dll"

depending on what I try to set.

When attempting to use project/properties/configuration properties/compiler options/source/import libraries, I
notice the use of the word STDCALL. Does that mean I need to find another way of using C_EXTERNALs?

Please could anyone shed some light on the matter, thanx.


Bri
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Oct 18, 2006 1:14 pm    Post subject: Threads Reply with quote

Brian

There is no obvious reason why 4.9 should be different from 4.8 in this respect.

beginthread is an old C_EXTERNAL Microsoft function that is in msvcrt.dll.
You should link with either msvcrt.dll or msvcrt.lib but not both.

You may need to use a basic SLINK command to discover what is going wrong.
Perhaps msvsrt.dll is either missing or is in the wrong folder.

The alternative, more modern, function to use is CreateThread which is STDCALL.
Back to top
View user's profile Send private message AIM Address
MarzAttax



Joined: 15 Jun 2006
Posts: 46

PostPosted: Thu Oct 19, 2006 7:39 am    Post subject: Threads Reply with quote

Thanx for that.

I have tried using CreateThread but to no avail.

Now, when I switch on "Full debug information" I get this:

WARNING the following symbols are missing
Module MSW32PRM ..................*.obj
(...............*.for)
Module CLRWIN..................*.obj
(...............*.for)

This does not appear if I only use "Debug information"

I believe this is due to:
USE MSWIN

If I remove this (and comment out relevent code) the warnings goes away.

mswin.f95 and MSWINMOD.F90 appear in:
C:Program FilesSalford SoftwareFTN95include
as do:
MSW32PRM.MOD, MSWIN32.MOD and CLRWIN.MOD

Any help much appreciated Surprised)

Bri
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Oct 19, 2006 10:52 am    Post subject: Threads Reply with quote

Brian

All that I can suggest is

a) Switch to Plato3 and use the associated help file and/or

b) use SLINK directly.
Back to top
View user's profile Send private message AIM Address
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