Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PictureBox VB6

Status
Not open for further replies.

R7Dave

Programmer
Oct 31, 2007
181
US
Hello

I have not used VB in the past - my windows programming was using Delphi.

I have inherited an application that was written in a version previous to 6.

We currently have Visual Basic/Visual Studio 6.

The end-user is requesting a small change, but I am receiving an error when creating a new ocx file. (File | Make filename.ocx)

"Compile error: Method or data member not found."

The debugger points to this line of code...
Filed(16).Text=.rsCmdGl("MBrokerNo")

Field(16) is a PictureBox - another developer here explained that in version 6, the picturebox no longer has the text property and that the whole form needs to be rewritten - which he did himself on another ocx.

Would it be possible to open this file with a previous version of Visual Studio and create the ocx?

Does Visual Studio 4 support text property with pictureboxes?

If VS4 is correct, where can I get a copy?

Thanks in advance
Dave


 
I will stand corrected but I've been using VB since version 1 and I don't think the PictureBox has ever had a .Text property - to have such a property doesn't make sense. Perhaps you could use the .Tag property instead, which will hold text?

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
I am also finding it hard to recollect a Text property for the Picturebox in any version of VB.

One thing to note is that unrecognized ActiveX controls used in previous versions of VB are converted to Pictureboxes when the old projects are imported into VB6.

In other words it is likely that Field(16) was originally, in fact, some other ActiveX control
 
strongm said:
In other words it is likely that Field(16) was originally, in fact, some other ActiveX control
On the basis that you're new to VB, if this assumption by strongm is correct - which seems likely - you need to go back to a copy of the source code before you loaded it into VB (in case you tried to run the code and it saved the changes). When you open the project look out for error messages - VB will create a .log file for each form which contains an error. If you look in the log file it'll say which component couldn't be found and that'll give you the clue you need. Find and install that component in Windows, then reload the project - repeat until you don't get any errors and be careful when you close the project each time NOT to save the changes. Only save the changes when the project loads without errors.

If you get stuck, post the text from the log file here and I'm sure someone will help.

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
That makes total sense - I will try that - Thank you
 
Hello again

I found this link


My error reads "C:\Folder\TipMcsField.ocx' could not be loaded - Continue Loading Project" , click Yes and I receive a message refering me to the log which reads

"Class TIPMCSFIELDLib.TipMcsField of control Field was not a loaded control class."

According to my link - I can open my vbp file in notepad and change the CLSID

this looks like the line I want

Object={F05AAC85-C69D-11D2-9456-00AA004BCD9E}#2.5#0; TipMcsField.ocx


I am running Ole2View.exe (from and searching the registry but with no luck so far on finding the correct CLSID

If anyone can post the steps I need to take to find the correct CLSID I would appreciate it

Thanks
Dave
 
That KB article doesn't apply - the CLSID has not changed. What has happened is that the control is not installed on your machine. Since it is a non-standard, custom control (at least I've never heard of it) this is not surprising, and you'll need to find a source for it and install/register it on your PC before VB6 will recognise it.

Presumably it is included with the original application's installation files ...
 
Hello

I found TipMcsField.ocx and

Project | References | Browse | Select "TipMcsField.ocx" (type =ActiveX Controls)

The first time I did this, the ocx was on the network

I still received the error "\\Networkpath\TipMcsField.ocx could not be loaded - Continue Loading Project"

I tried selecting the ocx from my local drive but now get the error

"Name conflicts with existing module, project, or object library"

My questions are -

1- Am I registering the ocx correctly?
2- How do I get VB to not look at the TipMcsField.ocx on the network - I no longer see it in the references list - and it seems I can't use the ocx from my local drive because of the name conflict - how can i remove the network TipMcsField.ocx ?

- I'm hoping that using the ocx from my local drive will be sucessful - maybe VB had trouble acessing the ocx from our network

Thank you for your help
Dave
 

To register the ocx, in Windows, click on Start - Run... and type:

[tt]
regsvr32 "C:\Path\To\Your\Location\TipMcsField.ocx"
[/tt]

Have fun.

---- Andy
 
If you want to unregister the network version of the OCX do:
regsvr32 "//networkpath/tipmcsfield.ocx" /u

Then do as Andrzejek suggests and register the local version.

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
I tried that

It seems like Visual Basic is still holding onto the old one because I get the message

"Name conflicts with existing module, project, or object library"

when I try

Project | References | Browse | Select "TipMcsField.ocx"

would reinstalling VB help this?

also, after I use regsvr32, do I still need to do...

Project | References | Browse | Select "TipMcsField.ocx"

Is the correct procdure...

1- Use regsvr32
2- Project | References | Browse | Select "TipMcsField.ocx"


Thanks
Dave
 
When (after) using regsvr32 it usually reports if it successful or not, what is it telling you?

After successful registration the ocx which represents a Control should be listed via

Project | Components | on the Controls tab.
 
It is reporting successful for the install and the uninstall

I can see the ocx listed under Project | Components | on the Controls tab.

If I click the checkbox and click OK, I get the error message "Name conflicts with existing module, project, or object library"

It seems that unregistering the ocx does not prevent VB from attemting to access the file.

Thanks
Dave
 
Yoiu are trying to add it as a reference AND a control - hence the conflict. Remove it from the toolbox and refeernces. Then, once yiou are sure the control is registred in Windows, add the control back into the toolbox
 
Thank you - I am receiving this message

"The file 'C:\Program Files\Tip\WorkStation\Bin\TipMcsField.ocx' was not registerable as an ActiveX Component"

I have tried

regsvr32 /u "C:\Program Files\Tip\WorkStation\Bin\TipMcsField.ocx"

then...

regsvr32 "C:\Program Files\Tip\WorkStation\Bin\TipMcsField.ocx"

I don't have the file name in references (Project | References) To double check, I started a new project and tried to add the ocx and receive the same message.

Project | Components | click BROWSE on the Controls tab - if I select the ocx, I receive the error above

Are there ActiveX files that need other ActiveX files registered first?

I have been googling and only found the regsvr fix and the other possibility of permissions - are there any other suggestions?

How can an ocx be sucessfully used by an application but I can't get it registered as an active x component in VB6?

Thanks for your patience and help

Dave
 
>not registerable as an ActiveX Component

There may, unfortunately, be a licensing issue with the control. Or dependencies on other files.

However, try the following. See if you can find

TipMcsField.oca

on your machine, and delete it. Then try and reregister the ocx.
 
What version of Windows are you using? I ask because newer versions require 'Run As Administrator' for many things.

If at first you don't succeed, then sky diving wasn't meant for you!
 
Hello - I am using windows xp pofessional

How do I know if I am an administrator of my own machine?
 
Hello

I think making myself an admin did the trick - I'm not 100% sure - but I think so, also making sure everything was local - and learning about regsvr32

Thank you very much to everyone for their patience and help - very much appreciated

Thanks
Dave
 
Now you just need to go back to the 'developer' who told you picture boxes had a Text property and tell them they were talking nonsense ... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top