Help with 2 missing files - CLASSES.CLW and CWAPI.INC

Hello everyone, I urgently need two files that are corrupted in my Clarion 9.1 “CLASSES.CLW” and ‘CWAPI.INC’, Can someone help me please without them I can’t finish my project, I’ve already reinstalled Clarion but it didn’t help.

The reason re-installing Clarion did not help,is because those are not files shipped with Clarion. They’re likely files custom to your application, or perhaps files gotten from some 3rd party.

If someone recognises the files, perhaps they can tell you where they came from.

It’s also worth noting, that generally it’s not a great idea to be asking for files from the community at large. Most files are subject to some sort of copyright, so we encourage you to get the files direct from the copyright holder. So, for example, had these been part of Clarion I would have recommended contacting SoftVelocity to get them. If you don’t know the owner, then framing the question to determine the source is usually ideal.

I appreciate your contact, friend Bruce. I believe that these are innocent files that do no harm to anyone. I know that there is a lot of protection around Clarion, but since these are just complementary files and not executable, there would be no problem. However, I am grateful for your attention.

As noted though, they’re not part of shipping Clarion.

Also, source files are generally copyrighted. Lots of Clarion (templates, classes etc) are shipped as source files, but copyright remains, so sharing files should be done with caution, regardless of their format.

But, as noted above, that’s not your current issue. Your current issue is that you need to know where these files have come from so you can get them. Once you know where they come from you can correspond with their author.

Okay, my friend Bruce, thank you for your guidance and clarification.
Thank you very much.

I would expect if these files matter you would see various errors. With the CwApi.Inc probably Unresolved Externals.

Tell us what specific errors or problems you get when building?

Hello friend CarlBarnes
I apologize for the delay in responding, but I was traveling.
As I said before, these two files are just additions to a program. Since Clarion uses a type of RGB to HEX conversion, I am developing a ColorPicker that does this conversion so that we can use different colors without errors in the codes. So when I try to compile, at the end, it displays this message. It is not a code error, but rather a missing file. These are the two files I mentioned. But I have already solved this problem without these files. Thank you for contacting me.

Here is a small part of the code.

MAP
  MODULE('WinAPI')
    ChooseColorA(*LONG),BOOL,PASCAL,RAW
  END
END

ColorData  GROUP,TYPE
  lStructSize     LONG
  hwndOwner       LONG
  hInstance       LONG
  rgbResult       LONG
  lpCustColors    LONG
  Flags           LONG
  lCustData       LONG
  lpfnHook        LONG
  lpTemplateName  LONG
END

ColorDataVar ColorData
CustColors   LONG(16)

ColorDataVar.lStructSize = SIZE(ColorDataVar)
ColorDataVar.hwndOwner = 0
ColorDataVar.lpCustColors = ADDRESS(CustColors)
ColorDataVar.Flags = 1h

IF ChooseColorA(ColorDataVar)
  COL:Red   = BAND(ColorDataVar.rgbResult,0FF0000h) / 65536
  COL:Green = BAND(ColorDataVar.rgbResult,000FF00h) / 256
  COL:Blue  = BAND(ColorDataVar.rgbResult,00000FFh)
  COL:HEX   = '#' & RIGHT('000000' & FORMAT(BAND(ColorDataVar.rgbResult,0FFFFFFh),@n06),6)
  COL:NomeCor = GetColorName(ColorDataVar.rgbResult)

  ?CorPreview{PROP:FILL} = ColorDataVar.rgbResult
  ?StrRGB{PROP:Text} = 'RGB: ' & COL:Red & ',' & COL:Green & ',' & COL:Blue
  ?StrHEX{PROP:Text} = 'HEX: ' & COL:HEX
  ?StrNome{PROP:Text} = 'Nome: ' & COL:NomeCor
END

IMO in the above code it would be best to use only Bitwise functions i.e. use BSHIFT rather than Divide e.g.

  COL:Red   = BSHIFT( BAND(ColorDataVar.rgbResult,0FF0000h), -16 )   !was  / 65536
  COL:Green = BSHIFT( BAND(ColorDataVar.rgbResult,000FF00h), -8 )    !was / 256
  COL:Blue  = BAND(ColorDataVar.rgbResult,00000FFh)

You can test the Bitwise functions using my Bit Mapper tool on GitHub. I usually want to verify I have BSHIFT with the right value. It should be easy to remember that a Negative Shift is Divide, but I usually double check. The Help on BSHIFT is good and shows a Divide.

Above started with FF0000h and did BSHIFT(,-16) which shows the result is 0000FFh. I think that’s what you were trying to do was just get the Red Bits.