Do I need a 64 bit version of stdvcl40.dll?
Asked Answered
S

1

6

I am going to deploy a 64 bit version of an OCX written in Delphi. The OCX requires stdvcl40.dll to be available and registered in the target system. To my knowledge there is only a 32 bit version present in my Delphi installation, but as the sources are available I should be able to create a 64 bit version by myself.

Is there a need or an advantage doing so or should I stick with the contained version and only deploy that one?

Edit Just to give a little background: StdVCL40.dll mainly contains a type library exposing three interfaces declared in System.Win.StdVCL.pas. Later versions of this dll also implement some property pages handling these interfaces.

The result of removing the dependancy to stdvcl40.dll is that these interfaces (IStrings in my case) are no more available in my type library and any reference is replaced with IDispatch.

stdvcl40.dll is not a design-time package and it had to be deployed together with most of my ActiveX libraries in former Delphi versions. I have to deploy it because otherwise the OCX refuses to register in the first place.

It actually seems to work also with the 64-bit version of my OCX probably because Windows COM is clever enough to figure out that there is no 64 bit version and thus takes the 32 bit version. Although I am not sure if this is the way to go. Thus my question.

Superload answered 25/6, 2014 at 14:14 Comment(6)
StdVclXX.dll is a redistributable DLL listed in the deployment guide for older versions of Delphi. But as far as I can tell, it's no longer needed in modern Delphi. The deployment guide no longer lists it.Deletion
@DavidHeffernan, basically it only defines some interfaces (IStrings, IProvider, IDataBroker) whereof I am actually using IStrings. What bothers me is that it is automatically included when you create a new ActiveX library - even in XE6.Superload
Perhaps that's just historic and they forgot to remove it from the new project template. Have you tried removing any references to stdvclxx from the project?Deletion
@DavidHeffernan, when I remove the dependancy to stdvcl40 from the type library all references to IStrings are replaced with IDispatch. While I might find a workaround for that in my case by declaring IStrings in my own typelib, it seems that stdvcl40 is not that obsolete.Superload
@KenWhite, Start your XE6 IDE (a lower one would probably do, too) and create a new active X library. Save and check the RIDL file and you should see something like "importlib("stdole2.tlb"); importlib("stdvcl40.dll");. Inside the typelib editor declare a new interface, add a method with a parameter of type IStrings. Then you have that dependency. The same mechanism that allows the use of say IFont or IBitmap from stdole2.tlb makes IStrings available from stdvcl40.dll.Superload
@Uwe: Thanks. That's useful information. :-)Stace
B
2

I guess this DLL is used as storage for type library only (with definition of IStrings etc), at least in your case. And then answer is "NO", you don't need x64 version. When you register this x32 DLL, type library should be available for both x32/x64 apps. Sorry, i can not check it now, so it is just a guess.

UPDATE You can register stdvcl40.tlb (it is just 3kb in size, so it is much easier to deploy), then your OCX will depend on "stdvcl40.tlb" instead of "stdvcl40.dll" (maybe you will have to uncheck DLL and check TLB from tab "Uses" of type library editor, but i am not sure it is neccessary, but in my test project i don't have dependency at DLL anymore).

Bowerbird answered 25/6, 2014 at 18:11 Comment(5)
Why would be it available for both x86 and x64 apps? They have separate registries.Deletion
@David I think there is no x32/x64 type libraries, because it is not executable. DLL itself will be registered as x32, but it will register integrated type library and i believe it became available for any (x32/x64) application in the system. I updated my answer with comment how to avoid of dependency from stdvcl40.dll.Bowerbird
@Uwe did you try deploying 32 bit version and registering it. Maybe Andrei is right. Although I'm not quite sure how a 64 bit app sees the com registry of a 32 bit component. But maybe that happens.Deletion
@David: Just checked, "stdvcl40.tlb" is registered in both branches, "computer\hkey_classes_root\wow6432Node\Typelib" and "computer\hkey_classes_root\TypeLib", so it should be enough to register standalone TLB. But when registering DLL it should register TLB same way.Bowerbird
@AndreiGalatyn, thanks for the tlb tip. Will try that right tomorrow morning.Superload

© 2022 - 2024 — McMap. All rights reserved.