Silverfrost Forums

Welcome to our forums

Threads

18 Oct 2006 8:56 #1155

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

18 Oct 2006 12:14 #1156

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.

19 Oct 2006 6:39 #1158

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 Files\Salford Software\FTN95\include as do: MSW32PRM.MOD, MSWIN32.MOD and CLRWIN.MOD

Any help much appreciated 😮)

Bri

19 Oct 2006 9:52 #1159

Brian

All that I can suggest is

  1. Switch to Plato3 and use the associated help file and/or

  2. use SLINK directly.

Please login to reply.