I wrote a simple PB COM DLL consisting one property, one method and one event. It actually works with VB6 with some differences from other COM objects compiled not in PB:
1. On a VB Form
Private WithEvents objSamplePBCOM As New SamplePBCOM.REMAILSEND
is not accepted. However
Private WithEvents objSamplePBCOM As SamplePBCOM.REMAILSEND
is fine and the New keyword is accepted in Form_Load providing the same results. While the results are the same I wish PB would not impose any special handling requirements on users of a DLL written in PB.
2. It looks like I have to distribute the type library instead of the DLL? Using the DLL was not working for me.
3. In the events VB displays Param1, Param2 and so on for passed parameters instead of the descriptive name I actually created. I wish if PB would retain the original names otherwise users will have no hint what the parameter is for.
4. It looks like we have to be very careful handling string values. We have to convert them to unicode before assigning the value to a method or to a parameter in an event or when returning a property value that we modified/created in the PB DLL.
5. All property names, method names etc. appear in upper case in VB. Is any way of reatining the case I used in the code?
Peter Redei
1. On a VB Form
Private WithEvents objSamplePBCOM As New SamplePBCOM.REMAILSEND
is not accepted. However
Private WithEvents objSamplePBCOM As SamplePBCOM.REMAILSEND
is fine and the New keyword is accepted in Form_Load providing the same results. While the results are the same I wish PB would not impose any special handling requirements on users of a DLL written in PB.
2. It looks like I have to distribute the type library instead of the DLL? Using the DLL was not working for me.
3. In the events VB displays Param1, Param2 and so on for passed parameters instead of the descriptive name I actually created. I wish if PB would retain the original names otherwise users will have no hint what the parameter is for.
4. It looks like we have to be very careful handling string values. We have to convert them to unicode before assigning the value to a method or to a parameter in an event or when returning a property value that we modified/created in the PB DLL.
5. All property names, method names etc. appear in upper case in VB. Is any way of reatining the case I used in the code?
Peter Redei
Comment