64Bit App mit ActiveX Schnittstelle aus 32Bit App steuern



  • Hallo zusammen,

    ich möchte eine 3rd Party 64Bit Applikation welche eine ActiveX Schnittstelle hat mit meiner 32Bit App benutzen. Da ActiveX ja eine "genormte" Schnittstelle ist, vermute oder besser hoffe ich, dass ich diese ActiveX auch aus einer 32Bit Applikation ansprechen kann.

    Ist das richtig oder liege ich da falsch?

    Leider kann ich das nicht ausprobieren da die Lizenzgebühr für diese 3rd Party App zu gross für trial and error ist.



  • Nein, grundsätzlich muss die Bittigkeit schon zusammenpassen. Wenn du aber nicht deine ganze Anwendung auf 64 Bit portieren willst, könntest du vielleicht zumindest einen kleinen Wrapper um die ActiveX Komponente schreiben.
    Hab grad geschaut, evtl. gibts da sogar schon was vorgefertigtes:

    https://msdn.microsoft.com/en-us/library/ms687320(v=VS.85).aspx

    Hab damit aber keine Erfahrung.


  • Mod

    Außer es handelt sich um einen out of process Server! Dann eist es egal.



  • Wenn es ein 64 Bit *Programm* ist, also etwas was unabhängig von anderen Programmen einfach so gestartet und verwendet werden kann, dann wäre die übliche Variante dass dieses 64 Bit Programm einen Out-Of-Process Server anbietet. Und den kannst du dann auch aus einem 32 Bit Programm heraus verwenden.

    Wobei es dann komisch wäre das Ding als ActiveX zu bezeichnen. Denn ActiveX ist eigentlich ein Standard für GUI Elemente die "in process" laufen, weil sie eben in andere Programme "integriert" werden sollen. Also als Teil von anderen Programmen laufen sollen.
    In dem Fall hättest du ein Problem.

    Also auf jeden Fall beim Hersteller nachfragen. Ideal wäre eine Demoversion, also auch diesbezüglich nachfragen.



  • Diese 3rd Party Applikation (250B) ist ein "Network Analyzer" zum messen von Quarzen 15kHz bis 220MHz. Diese Applikation kann sowohl Eigenständig wie auch "ferngesteuert" benutzt werden.

    Im Taskmanager erscheint sie unter Processes als 250B.exe.

    Ich weiss nie ob OLE, COM oder ActiveX oder irgend eine andere Bezeichnung aus dem NameLab von MS die richtige Bezeichnung ist 😉

    So sieht die (gekürzte) Schnittstelle zur aktuellen 32Bit 250B.exe aus.

    // Machine generated IDispatch wrapper class(es) created with Add Class from Typelib Wizard
    
    #import "R:\\MCLIB\\ThirdParty\\Saunders\\C250B\\250B.tlb" no_namespace
    // C250B wrapper class
    
    class C250B : public COleDispatchDriver
    {
    public:
    	C250B(){} // Calls COleDispatchDriver default constructor
    	C250B(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
    	C250B(const C250B& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
    
    	// Attributes
    public:
    
    	// Operations
    public:
    
    	// I250B methods
    public:
    	double GetVersion()
    	{
    		double result;
    		InvokeHelper(0x1, DISPATCH_METHOD, VT_R8, (void*)&result, NULL);
    		return result;
    	}
    	void GetResults(BSTR * pbstrCrystal, VARIANT * pvResults)
    	{
    		static BYTE parms[] = VTS_PBSTR VTS_PVARIANT ;
    		InvokeHelper(0x2, DISPATCH_METHOD, VT_EMPTY, NULL, parms, pbstrCrystal, pvResults);
    	}
    	void FileOpen(BSTR * bstrFileName)
    	{
    		static BYTE parms[] = VTS_PBSTR ;
    		InvokeHelper(0x3, DISPATCH_METHOD, VT_EMPTY, NULL, parms, bstrFileName);
    	}
    	void SetNextSerialNumber(long lSerialNumber)
    };
    

    Also auf jeden Fall beim Hersteller nachfragen. Ideal wäre eine Demoversion, also auch diesbezüglich nachfragen.

    Werde ich versuchen, ist aber extrem umständlich, die sind ein bisschen kompliziert 😉



  • Wenn dein Programm und die 250B.exe auch im "Fernsteuermodus" als zwei getrennte EXEn im Task-Manager aufscheinen, dann kannst du 32/64 Bit mischen.
    Wenn nicht, dann nicht.

    Ansonsten...
    250B.tlb aufmachen und dann in der Registry bzw. mit OLEView nachgucken wie die Klassen registriert sind -- also ob als inproc oder out-of-process Server.



  • Wenn dein Programm und die 250B.exe auch im "Fernsteuermodus" als zwei getrennte EXEn im Task-Manager aufscheinen, dann kannst du 32/64 Bit mischen.

    Ja, sind getrennte EXEn.

    Danke!



  • Kleiner Nachtrag

    Auf der Website des Herstellers des 250B Messsystems:
    "The 250B is now supported in Windows XP and Windows 7 (64-bit)."

    Dann die Antwort auf meine Frage zur Unterstützung 32-bit:

    The 250B software for Windows 7 is actually a 32-bit application, but we run on a 64-bit machine. We do not currently have an installation program for a 32-bit machine. Running on a 64-bit machine only affects our access to the 250B card and the driver that is loaded for that. The driver is a 64-bit driver. Our application handles the translation from the 64-bit driver to the 32-bit application. What Walter is proposing will work perfectly on a 64-bit machine. Their 32-bit software will run on that machine along with the 250B which is also a 32-bit application. The 250B software will handle the communication with the 64-bit driver without impacting their requirements.

    Also alles klar... 1 Satz mehr auf der Website und die ganze Unsicherheit wäre gar nicht entstanden.


  • Mod

    hustbaer schrieb:

    Wobei es dann komisch wäre das Ding als ActiveX zu bezeichnen. Denn ActiveX ist eigentlich ein Standard für GUI Elemente die "in process" laufen, weil sie eben in andere Programme "integriert" werden sollen. Also als Teil von anderen Programmen laufen sollen.

    ActiveX ist mehr. Undeigentlich ist der Begriiff mittlerwiele so unscharf, dass er alle COM-Komponenten einschließt. 😉

    Zitat:

    *ActiveX components interact with your application — and with each other — through a client/server relationship. The client is the application code or component that uses the features of a component. The server is the component and its associated objects. For example, suppose your application uses an ActiveX control to provide a standard Employee form for multiple applications in your company. The ActiveX control that provides the Employee form is the server; the applications that use the control are its clients.

    Depending on how an ActiveX component has been implemented, it may run in the same process as its client applications, or in a different process. For example, if your application uses a component that is part of an ActiveX-enabled application, it runs in a separate process. If the component has been implemented as a programmable object in a dynamic-link library (.dll file), it runs in the same process as your application.

    In general, if an ActiveX component has been implemented as part of an executable file (.exe file), it is an out-of-process server and runs in its own process. If it has been implemented as a dynamic-link library, it is an in-process server and runs in the same process as the client application. Applications that use in-process servers usually run faster than those that use out-of-process servers because the application doesn't have to cross process boundaries to use an object's properties, methods, and events.*



  • Gibt es eine vergleichende, tabellarische Nebeneinanderstellung von COM/COM+, ActiveX, OLE, ..., die Gemeinsamkeiten/Unterschiede prägnant aufzeigt?


Anmelden zum Antworten