Is there a CW20 equivalent of %Globalmap to add module/api declarations?

I wondered what the embed is to add additional module’s and api’s in CW20 is, I cant see anything in program.tpw. Is there an embed point to add windows api’s and other module/api declarations in CW20?

TIA

%GlobalMap exists in the CW20 template chain. Additionally, there is %ProcedureDeclarationsInsideGlobalMap

I’ll search for this although I think this was just the procedure declarations. At least with the version of Clarion I have here, which could be different to everyone’s version of Clarion.

Be aware you can have more than one MAP structure.

Of course, local procedures in a procedure rely on a MAP structures declared in the procedure, classes can also use MAP structures.

I have a template which I use for win32 api’s and I didnt want to duplicate for every template chain, ie one for ABC, one for Clarion, one for the template chains I’ve created here, so I wrote a single template which defines and reinforces the different api’s to reduce prototyping mistakes which works in all the different template chains.

Next is to do a template to call dotnet methods, then I can use dotnet code using #RunDll. Hopefully that will work, but until I try I wont know for sure how the C6 or C11 IDE will handle that.

The map contains procedure declarations for procedures both inside this app, and also those external to this app.

So, if you have something like

  Module('windows') ! <-- the module name is actually irrelevant
       stGetCurrentProcessId(),ulong,Pascal,raw,name('GetCurrentProcessId')
       stGetCurrentThreadId(),ulong,Pascal,raw,name('GetCurrentThreadId')
  End

then these functions are callable in your code. The linker needs to resolve them at link time, in the above case using the builtin windows.lib

but I feel like you know this, and so I’m misinterpreting your question… Perhaps you can clarify?

Cheers
Bruce

In the Clarion Templates I have here, inside program.tpw, I cant see any %globalmap equivalent embed for someone using the clarion templates to add a module(’’) and windows api prototypes.

Not in C6 or C11.

Thats why I asked what the equivalent is as I cant see any embed.

I can see the cw20 templates pull in various abc classes, but thats all.

It doesnt help that I cant find any example apps that use the clarion template chain either in C6 or C11 which is really weird and makes me wonder if I have got everything.

#at(%globalmap)
Works in both abc and legacy.

Declared in a Program.Tpw and program.tpw

I see it, line 93, indented just above #Embed(%ProcedureDeclarationsInsideGlobalMap, ‘’),HIDE

I couldnt see it the other night.

Edit. I found out why.
My Redirection file has my templates before the paths to the shipping templates. The template registry was picking up the first matching #include(‘filename.tpw’) it could find which happened to be one of my templates, ie CW.tpl was picking up my program.tpw and then using that in the CW20 template, same with other files.

It looks like the template registry doesnt start with the search for #include files in the folder the tpl is found in when its being registered, but rather finds an #Include statement and then goes through the redirection file looking for a matching file which can be different as in my case.

I think for now, for safety reasons, I need unique tpw file names and possibly unique %symbol names to be on the safe side.

Before

[Common]
*.dll = .;%ROOT%\BIN; %ROOT%\3RDPARTY\BIN; C:\CLARION6\3rdParty\Bin
*.tp? = %ROOT%\3rdParty\template\C6grpSendDebugViewMsg
*.tp? = %ROOT%\3rdParty\template\C6grpViewEmbedSourceButton
*.tp? = %ROOT%\3rdParty\template\C6UtilDLL
*.tp? = %ROOT%\3rdParty\template\IS_api32
*.tp? = %ROOT%\3rdParty\template\IS_AppInfo
*.tp? = %ROOT%\3rdParty\template\IS_AutoBackup
*.tp? = %ROOT%\3rdParty\template\IS_BasicAppTemplate
*.tp? = %ROOT%\3rdParty\template\IS_BasicAppTemplateV2
*.tp? = %ROOT%\3rdParty\template\IS_BasicAppTemplateV3
*.tp? = %ROOT%\3rdParty\template\IS_BasicAppTemplateV4
*.tp? = %ROOT%\3rdParty\template\IS_BlankColumn
*.tp? = %ROOT%\3rdParty\template\IS_BrowseTreecontrol
*.tp? = %ROOT%\3rdParty\template\IS_ClassWriter
*.tp? = %ROOT%\3rdParty\template\IS_COMMS
*.tp? = %ROOT%\3rdParty\template\IS_CtrlAltP
*.tp? = %ROOT%\3rdParty\template\IS_DebugView
*.tp? = %ROOT%\3rdParty\template\IS_DebugView_Template_Group_Include_File
*.tp? = %ROOT%\3rdParty\template\IS_DllTemplate
*.tp? = %ROOT%\3rdParty\template\IS_DisableWindowCloseButton
*.tp? = %ROOT%\3rdParty\template\IS_EmbedInfo
*.tp? = %ROOT%\3rdParty\template\IS_EntryFieldCutNPaste
*.tp? = %ROOT%\3rdParty\template\IS_ExeManifest
*.tp? = %ROOT%\3rdParty\template\IS_FileFolderLookup
*.tp? = %ROOT%\3rdParty\template\IS_FilePath
*.tp? = %ROOT%\3rdParty\template\IS_FormFirstField
*.tp? = %ROOT%\3rdParty\template\IS_FormSettings
*.tp? = %ROOT%\3rdParty\template\IS_GlobalEquates
*.tp? = %ROOT%\3rdParty\template\IS_HasAutoInc
*.tp? = %ROOT%\3rdParty\template\IS_LoadImage
*.tp? = %ROOT%\3rdParty\template\IS_LoadSettings
*.tp? = %ROOT%\3rdParty\template\IS_LocalError
*.tp? = %ROOT%\3rdParty\template\IS_LocalProcedure
*.tp? = %ROOT%\3rdParty\template\IS_LookupButton
*.tp? = %ROOT%\3rdParty\template\IS_Notes
*.tp? = %ROOT%\3rdParty\template\IS_ParameterPrototyper
*.tp? = %ROOT%\3rdParty\template\IS_RedirectionFile
*.tp? = %ROOT%\3rdParty\template\IS_RefreshTemplate
*.tp? = %ROOT%\3rdParty\template\IS_SetFont
*.tp? = %ROOT%\3rdParty\template\IS_SharedGlobals
*.tp? = %ROOT%\3rdParty\template\IS_SimpleApp
*.tp? = %ROOT%\3rdParty\template\IS_SingleProcAppPRJ
*.tp? = %ROOT%\3rdParty\template\IS_SingleProcAppPRJextras
*.tp? = %ROOT%\3rdParty\template\IS_SubClass
*.tp? = %ROOT%\3rdParty\template\IS_Synch
*.tp? = %ROOT%\3rdParty\template\IS_SysTray
*.tp? = %ROOT%\3rdParty\template\IS_SysTray2
*.tp? = %ROOT%\3rdParty\template\IS_TemplateWriter
*.tp? = %ROOT%\3rdParty\template\IS_TemplateBuilderV1
*.tp? = %ROOT%\3rdParty\template\IS_Test
*.tp? = %ROOT%\3rdParty\template\IS_ThiswindowRunExtender
*.tp? = %ROOT%\3rdParty\template\IS_ViewBuilder


*.tp? = %ROOT%\TEMPLATE;%ROOT%\3RDPARTY\TEMPLATE; 
*.trf = %ROOT%\template
*.txs = %ROOT%\template
*.stt = %ROOT%\template
*.*   = .; ROOT%\*.*\*.*\*.*\*.*;%ROOT%\libsrc; %ROOT%\images; %ROOT%\template; %ROOT%\examples; %ROOT%\convsrc; %ROOT\3rdparty;%ROOT%\3rdparty\template;

After

[Common]
*.tp? = %ROOT%\TEMPLATE;%ROOT%\3RDPARTY\TEMPLATE; 
*.trf = %ROOT%\template
*.txs = %ROOT%\template
*.stt = %ROOT%\template
*.*   = .; ROOT%\*.*\*.*\*.*\*.*;%ROOT%\libsrc; %ROOT%\images; %ROOT%\template; %ROOT%\examples; %ROOT%\convsrc; %ROOT\3rdparty;%ROOT%\3rdparty\template;

*.dll = .;%ROOT%\BIN; %ROOT%\3RDPARTY\BIN; C:\CLARION6\3rdParty\Bin
*.tp? = %ROOT%\3rdParty\template\C6grpSendDebugViewMsg
*.tp? = %ROOT%\3rdParty\template\C6grpViewEmbedSourceButton
*.tp? = %ROOT%\3rdParty\template\C6UtilDLL
*.tp? = %ROOT%\3rdParty\template\IS_api32
*.tp? = %ROOT%\3rdParty\template\IS_AppInfo
*.tp? = %ROOT%\3rdParty\template\IS_AutoBackup
*.tp? = %ROOT%\3rdParty\template\IS_BasicAppTemplate
*.tp? = %ROOT%\3rdParty\template\IS_BasicAppTemplateV2
*.tp? = %ROOT%\3rdParty\template\IS_BasicAppTemplateV3
*.tp? = %ROOT%\3rdParty\template\IS_BasicAppTemplateV4
*.tp? = %ROOT%\3rdParty\template\IS_BlankColumn
*.tp? = %ROOT%\3rdParty\template\IS_BrowseTreecontrol
*.tp? = %ROOT%\3rdParty\template\IS_ClassWriter
*.tp? = %ROOT%\3rdParty\template\IS_COMMS
*.tp? = %ROOT%\3rdParty\template\IS_CtrlAltP
*.tp? = %ROOT%\3rdParty\template\IS_DebugView
*.tp? = %ROOT%\3rdParty\template\IS_DebugView_Template_Group_Include_File
*.tp? = %ROOT%\3rdParty\template\IS_DllTemplate
*.tp? = %ROOT%\3rdParty\template\IS_DisableWindowCloseButton
*.tp? = %ROOT%\3rdParty\template\IS_EmbedInfo
*.tp? = %ROOT%\3rdParty\template\IS_EntryFieldCutNPaste
*.tp? = %ROOT%\3rdParty\template\IS_ExeManifest
*.tp? = %ROOT%\3rdParty\template\IS_FileFolderLookup
*.tp? = %ROOT%\3rdParty\template\IS_FilePath
*.tp? = %ROOT%\3rdParty\template\IS_FormFirstField
*.tp? = %ROOT%\3rdParty\template\IS_FormSettings
*.tp? = %ROOT%\3rdParty\template\IS_GlobalEquates
*.tp? = %ROOT%\3rdParty\template\IS_HasAutoInc
*.tp? = %ROOT%\3rdParty\template\IS_LoadImage
*.tp? = %ROOT%\3rdParty\template\IS_LoadSettings
*.tp? = %ROOT%\3rdParty\template\IS_LocalError
*.tp? = %ROOT%\3rdParty\template\IS_LocalProcedure
*.tp? = %ROOT%\3rdParty\template\IS_LookupButton
*.tp? = %ROOT%\3rdParty\template\IS_Notes
*.tp? = %ROOT%\3rdParty\template\IS_ParameterPrototyper
*.tp? = %ROOT%\3rdParty\template\IS_RedirectionFile
*.tp? = %ROOT%\3rdParty\template\IS_RefreshTemplate
*.tp? = %ROOT%\3rdParty\template\IS_SetFont
*.tp? = %ROOT%\3rdParty\template\IS_SharedGlobals
*.tp? = %ROOT%\3rdParty\template\IS_SimpleApp
*.tp? = %ROOT%\3rdParty\template\IS_SingleProcAppPRJ
*.tp? = %ROOT%\3rdParty\template\IS_SingleProcAppPRJextras
*.tp? = %ROOT%\3rdParty\template\IS_SubClass
*.tp? = %ROOT%\3rdParty\template\IS_Synch
*.tp? = %ROOT%\3rdParty\template\IS_SysTray
*.tp? = %ROOT%\3rdParty\template\IS_SysTray2
*.tp? = %ROOT%\3rdParty\template\IS_TemplateWriter
*.tp? = %ROOT%\3rdParty\template\IS_TemplateBuilderV1
*.tp? = %ROOT%\3rdParty\template\IS_Test
*.tp? = %ROOT%\3rdParty\template\IS_ThiswindowRunExtender
*.tp? = %ROOT%\3rdParty\template\IS_ViewBuilder


``

This #Include using the redirection file instead of the folder the original template was loaded in has made me think my computer was being hacked, talk about grief from something so simple. Anyway I know how the #include is now working!