Solved

New CallByName function in VB-6

Posted on 1998-12-09
2
219 Views
Last Modified: 2008-03-03
I have a property Text(0) in one of my VC DLLs. When I try to assign the value to Text(0) property in VB-6 using CallByName method it gives me an error
'Object doesn't support this property or method'

Code is as follows.

dim po as PORESOURCELib.beResource

CallByName po, sPropname$, VbLet, aTstData(pst)

Where po is the object, sPropname$ contains the property name Text(0) and aTstData(pst) contains the value which I want to assign to that property.

Please tell me the reason why it's failing?
Does VB-6 support such property assignment?
0
Comment
Question by:sunita111698
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:sunita111698
ID: 1448975
Edited text of question
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 200 total points
ID: 1448976
The name of the property is "text" not text(0). The property text is most likely a safearray and you have to pass the entire array to C.
If text is a parametered property than you have to pass it as an argument
CallByName po, sPropname$, VbLet, 0, aTstData(pst)
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Copy a row 12 77
VBA: Personal Macro Retain/Highlight/Remove values in a selected column 4 37
Prevent checkbox click event occur while editing it in vb6 8 75
Hide vba in gp 7 127
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question