Can .cls and .resx files be placed in pl files ?

Posted by saquib on 07-Apr-2009 04:02

I have built a libray with these file types included, but does not appear to work. I'm guessing these files may be required by elements which do not have access to the pl, so may need to reside outside a pl?

Thanks!

All Replies

Posted by kevin_saunders on 07-Apr-2009 05:35

One would think that .cls files would work just fine as liong as the directory structure is maintained when adding the .cls files to the PL..

What kind of errors are you seeing?

Posted by saquib on 07-Apr-2009 05:42

If I place the files in a directory, add the directory to my propath, then the code runs fine.

If I add the files to a pl, add the pl to my propath, get a run-time error (invalid datatype), assume because it cannot find the required files.

Posted by saquib on 07-Apr-2009 06:12

Actaully, tried again and it now works.

User error I think.

Posted by Admin on 08-Apr-2009 00:36

Does it actually work for the .cls and the .resx file? My understanding is that the .cls file (or the .r code) is not handled any different than .r code for procedures. .resx files are loaded by a .NET class (Progress.Util.ResourceHelper). Not sure if that supports .pl files.

Posted by saquib on 08-Apr-2009 02:27

Have simple class 'test2'. Added the 3 files to a library mylib.pl. If I try to run the following code without the library in the propath, get a compile error:

def var myObj as test2.

myObj = new test2().

myObj:doWait().

However, add the library to my propath and it works fine (comiles and runs).  I've renamed the existing files (test2.resx etc.), to ensure they are not accidentally being picked up.

Based on the above simple test, it does appear resx files can live in pl files.

Posted by rbf on 07-Sep-2009 02:16

Well we are now experiencing that it does not seem to work when you put .resx files in .pl files.

The explanation that the above test worked fine can be that the test.resx was created but since it has not contents it is not needed. However, if the .resx file *is* required it does not seem to work when you put it in a .pl file.

Has anyone experienced otherwise?

Posted by Admin on 07-Sep-2009 02:34

rbf schrieb:

Has anyone experienced otherwise?

No - but I'm actually not surprised that it does not work, .NET code has no access to .PL files, it's the same with image resources. I'd contact tech support and see what they suggest (probalby looging an ERS).

Posted by rbf on 07-Sep-2009 02:41

What are 'image resources?'

Posted by Admin on 07-Sep-2009 02:45

Image files, that may be loaded at runtime.

oImage = NEW System.Drawing.Bitmap ("images\bitmap.bmp") .

can't be located in .pl file. I've tested that and it appears logical to me - or at least not surprising.

Posted by rbf on 07-Sep-2009 03:21

Hmmm I thought that worked, but when I checked my collegue had indeed deployed these separately as well when solving the .resx issue.

BTW the OpenEdge -> Build -> Static file destination setting can be helpful for deploying these files in your development environment, although it deploys all or nothing so you have to be careful

Posted by Matt Baker on 08-Sep-2009 07:54

To answer the original question: NO. .resx files cannot be placed in .pl files and be expected to be accessible from .NET code.  You can certainly add them to the .pl file, but you won't be able to do anything with them.

This thread is closed