Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / December 2005



Tip: Looking for answers? Try searching our database.

Early Binding Fails

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jiju Joseph - 05 Oct 2005 13:56 GMT
Hi,

   I have a Piece of code as following,
   Dim oF    As prjFunction.clsFun
   Set oF = CreateObject("prjFunction.clsFun")

       Which bombs when running on one machine, If I Declare oF as Object,
it works fine, (Don't tell me its because of wrong Reference, I am 100% sure
that the Reference are correct - Because the DLL's deployed on another
machine is working fine.)

   Can anyone tell me whether this is dependent on some windows files??
What is the reason that the machine is not supporting Early Binding.

Thanks in Advance
Jiju Joseph
Douglas Marquardt - 05 Oct 2005 14:58 GMT
Hi Jiju:

You need to be more specific -- exactly what is the error?

In any case, because you can create the object but early
binding it fails, I suspect that the dll on the problem machine
is either not the latest version, or not physically the same one as
on the machine the works?

Doug.

> Hi,
>
[quoted text clipped - 12 lines]
> Thanks in Advance
> Jiju Joseph
Jiju Joseph - 05 Oct 2005 15:06 GMT
Hi Douglas,

    The issue, If I use Early Binding, the COM throws an Error "Error in
loading DLL", And I did cross verify the DLL's on the working box & problem
box, same version, same size, same creation date.

   I even copied the Dll from the working box, still the same issue.

Regards
Jiju Joseph

> Hi Jiju:
>
[quoted text clipped - 23 lines]
> > Thanks in Advance
> > Jiju Joseph
Ken Halter - 05 Oct 2005 15:13 GMT
> Hi Douglas,
>
[quoted text clipped - 7 lines]
> Regards
> Jiju Joseph

Check the dependencies for that DLL. Even though the DLL may be "fine", what
ever it needs to run may be missing.

Signature

Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..

Jiju Joseph - 05 Oct 2005 15:29 GMT
Hi Ken,

   If the DLL has Depends Problem, it will not work even if you use late
binding, But the DLL is working while done through Late Binding.

Regards
Jiju Joseph

> > Hi Douglas,
> >
[quoted text clipped - 10 lines]
> Check the dependencies for that DLL. Even though the DLL may be "fine", what
> ever it needs to run may be missing.
Schmidt - 05 Oct 2005 15:54 GMT
>     If the DLL has Depends Problem, it will not work even if you use late
> binding, But the DLL is working while done through Late Binding.

One additional idea, what you could try next.
Test, if you can instantiate your Class (early-bound) without using the
registry:

Standard-Dll-Helper is needed (DirectCom.Dll from)
www.datenhaus.de/Downloads/dh_DirectCom.zip

Put the Dll into your App.Path and declare this Call:
Private Declare Function GETINSTANCE Lib "DirectCom" _
 (FName$, CName$) As Object

Then you can change your instantiation-Line to:
Dim Obj as clsFun

Set Obj = GETINSTANCE(FileName, "clsFun")

If that works, then there are definitely wrong registry-entries at your
Problem-PC.

Olaf
Someone - 06 Oct 2005 05:09 GMT
You probably have problems with your ActiveX registry entries. Please delete
the keys mentioned in the following article:

PRB: DCOMCNFG Reports Multiple Copies of DCOM Server
http://support.microsoft.com/default.aspx?scid=kb;en-us;180525

Even if you don't have multiple copies of the same ActiveX in the registry,
the steps above still apply. They are equivalent to "regsvr32 /u
control.ocx", or "regsvr32 /u <vbide>".

A registry cleaner utility might do this for you if you delete your ActiveX
file, but I am not sure.

Note that the article refers to using DCOMCNFG.EXE in Windows 9x. You can
see the same list of objects by going to Project|References. In newer
versions of Windows, you can see the list of objects in Control
Panel|Administrative Tools|Component Services|Computers|My Computer|DCOM
Config. Typing "DCOMCNFG.EXE" will open "Component Services". You might see
some warnings that some AppID's are not recorded, choose No.

When you run an ActiveX project in the IDE, VB6 creates registry entries and
points them to the following file:

C:\Program Files\Microsoft Visual Studio\VB98\VB6DEBUG.DLL

When you stop the project, the IDE would auto delete these entries, unless
it crashes. When you compile your ActiveX project, VB6 auto create the
registry entries for them and point them to your compiled file. VB6 never
delete these entries, otherwise you can't use your component.

Also, in NT, you have to be a member of Power Users or Administrators in
order to develop and test ActiveX projects. That's because only Power Users
and Administrators can write to HKEY_LOCAL_MACHINE.

INFO: Registry Entries Made by an ActiveX Component
http://support.microsoft.com/default.aspx?scid=kb;en-us;183771

> Hi Douglas,
>
[quoted text clipped - 38 lines]
>> > Thanks in Advance
>> > Jiju Joseph
Martin de Jong - 06 Oct 2005 12:33 GMT
i guess you did register the latest version of the DLL on both machines?

Maybe you changed the DLL - interface so a new CLSID is generated and used.

Martin

> Hi,
>
[quoted text clipped - 12 lines]
> Thanks in Advance
> Jiju Joseph
Richard Jalbert - 08 Dec 2005 20:08 GMT
On Wed, 5 Oct 2005 05:56:08 -0700, "=?Utf-8?B?SmlqdSBKb3NlcGg=?="
<JijuJoseph@discussions.microsoft.com> wrote:

>Hi,
>
>    I have a Piece of code as following,
>    Dim oF    As prjFunction.clsFun
>    Set oF = CreateObject("prjFunction.clsFun")

I think the correct syntax for tat call is
    Set oF =
CreateObject(<applicationname>.<public-routine_that_Is_the_entry_point
into your COM)

I used to call all the entry pointa "Application"

Set oF = CreateObject("myDLL.Application")

>        Which bombs when running on one machine, If I Declare oF as Object,
>it works fine, (Don't tell me its because of wrong Reference, I am 100% sure
[quoted text clipped - 6 lines]
>Thanks in Advance
>Jiju Joseph

=====================================================
This is not a signature, it is an honour virus:
copy it at the bottom of all your e-mails.
richmann@sympatico.ca
=====================================================
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.