- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I am converting my win32 application to 64bit version and I have problem with beginthreadex function. Interface for this function is not present in IVF include files.
Where I can find interface for this function?
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
This is a MSVC library routine, with special hooks into the MSVC runtime, not a Windows API routine.Use CreateThread.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
try this:
[fortran]
! Interfaces to Microsoft Visual C library thread routines
! Must link against multithreaded libraries
interface
function $beginthreadex (security, stack_size, start_address, arglist, &
initflag, thrdaddr)
use ifwinty
integer(UINT) :: $beginthreadex
!DEC$ ATTRIBUTES C, alias:"__beginthreadex" :: $beginthreadex
type(T_SECURITY_DESCRIPTOR), intent(IN) :: security
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: security
integer(UINT), intent(IN) :: stack_size
integer(PVOID), intent(IN) :: start_address ! Must be STDCALL calling was (PVOID)
! mechanism, 1 arg
integer(PVOID), intent(IN) :: arglist
integer(UINT), intent(IN) :: initflag
integer(UINT), intent(OUT):: thrdaddr
!DEC$ ATTRIBUTES REFERENCE,IGNORE_LOC :: thrdaddr
end function $beginthreadex
end interface
[/fortran]
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
To Steve Lionel: Thanks for response I expected it is API function. Now I understand why it is not part of IVF headers.
To Paul Curtis: Thanks for Your example. I already use very similar interface, but it seems to work only for win32. When I compile my code for x64 I obtain error:
error LNK2019: unresolved external symbol __beginthreadex referenced in function xxx
I suppose problem is in two initial underscores. I am little bit confused in naming conventions of x64.
You have no problems to compile x64 with Yours interface?
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
The following is from old code and "works" but should be updated to use the inter-operational feature for DWORD
! use ControlPanel as thread_func integer(INT_PTR_KIND()) :: ControlPanelArg = 0 integer(4) :: ControlPanelFlags = 0 integer(INT_PTR_KIND()) :: ControlPanelThread_ID = 0 INTERFACE integer(4) FUNCTION ControlPanel(arg) !DEC$ ATTRIBUTES STDCALL, ALIAS:"_controlpanel" :: ControlPanel integer(4),POINTER :: arg END FUNCTION END INTERFACE ................... ! Create seperate thread to run the Modal Dialog control pannel ControlPanelHandle = CreateThread(& & NULL, ControlPanelStack, loc(ControlPanel), loc(ControlPanelArg), ControlPanelFlags, loc(ControlPanelThread_ID)) ...................... integer(4) FUNCTION ControlPanel(arg) !DEC$ ATTRIBUTES STDCALL, ALIAS:"_controlpanel" :: ControlPanel USE IFLOGM use GlobalData implicit none INCLUDE 'RESOURCE.FD' integer(4),POINTER :: arg .......
Jim Dempsey
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Use this instead:
!DEC$ ATTRIBUTES C, DECORATE, alias:"_beginthreadex" :: $beginthreadex
