Software Archive
Read-only legacy content
17060 Discussions

String (char) Property Functions with VB

Intel_C_Intel
Employee
1,674 Views
I am having a problem when defining a string "put" property in a COM Server created with Compaq FORTRAN. The corresponding "get" works correctly when I call it from VB; when I attempt to "put" a value by assigning a VB string to it, I get an Access Violation (address = 0xC000005).

Any help would be greatly appreciated
0 Kudos
3 Replies
Intel_C_Intel
Employee
1,674 Views
It should work (it worked for me).
Post some code, and someone can take a look.

hth,
John
0 Kudos
Intel_C_Intel
Employee
1,674 Views
I did some further checking on the problem. I find that I can assign a string VARIABLE to the property in VB like this:

dim s as string, obj as Fortran.COMObject
set obj = new COMObject
s = "Some String Data"
obj.stringproperty = s

If I try this, it generates the error:

obj.stringproperty = "Some String Data"

Also, If i declare s as a string constant, it blows up.
0 Kudos
Intel_C_Intel
Employee
1,674 Views
Again, both string literals and string constants work for me.

-John
0 Kudos
Reply