upgrade vb6 project using msdxm.ocx to wmp.dll - windows-7

We have a legacy vb6 application that uses an ancient windows media player component, msdxm.ocx, to embed ultrasound (pregnancy) video's in the medical record.
This doesn't work any more on Windows 7: it has a newer version of msdxm.ocx which cannot be referenced from vb6.
The newer version of the embeddable player is wmp.dll, so we are planning to upgrade the application to the newer version for Windows 7.
Before we have to find it all out the hard way by ourselves: does someone have experience with this upgrade from msdxm.ocx to wpm.dll? Is there a list of things to consider when upgrading? Or a table to convert constants and events from the first to the second?

I haven't seen anything listing their object models side-by-side or offering any "conversion."
The msdxm.ocx was really a scriptable IE object and should not have been used in VB6 programs. Lots of people did though. Windows 7 still has this OCX but starting with Vista (or perhaps IE7?) its interfaces changed in a way that seems to prevent use in VB6 programs.
You might want to try running a tool like ActiveX Documenter aginst working versions of both libraries to assist your efforts though. The RTF output documents might be a starting point for writing your own conversion guide.

msdxm.ocx should still work if you put the OCX file in C:\Windows\SysWOW64 and register it.
I've tried on my Win7 and it works on my music player legacy app.
Don't know about Windows 8 though, but it might still be the same, MS might changed folder again then.

Related

Canonical approach to display mgmt in Windows: User32 or DXGI?

We publish an app for Windows 10, and part of what it does is display management; the kind of thing you normally go to Display Settings for. We add/remove displays from the desktop, arrange them, change size and orientation, etc.
Currently I'm using APIs from User32.dll for all of the above (ChangeDisplaySettingsEx, EnumDisplayDevices, DEVMODE, DISPLAY_DEVICE, etc).
Recently I was looking over a display management .NET library project on GitHub. I particularly noticed that the author(s) were using a lot of Direct3D/DXGI APIs. I've worked in Windows for decades, but I never had occasion to use Direct3D at all.
Much of the information and reference material I consulted before writing the User32-based code has been around since the early days of Windows. My current version works fine, but I'd like to feel confident that I'm not using an outdated or inferior approach.
If the standard Display Settings app in Windows 10 were written today, would the display-management functionality be done with Direct3D/DXGI API calls, or is User32 still considered the canonical approach?

Several versions of Delphi

For reasons related to customers with different applications versions i need to maintain in my laptop several versions of Delphi (7, XE 7, XE 8, XE 10.1 Berlin and XE 10.2 Tokyo). My main concern is about PATH variable and problems during compilation and linking time. There'll be any problems ? Do i need to change what ? Any suggestion is most welcome.
I have all versions of Delphi from 7 thru XE8 installed in a single VM and versions 1 thru 6 in another (my Delphi "museum" :)).
The Delphi "museum" is a Windows XP VM to avoid the problems that those older versions of Delphi have with more recent Windows versions. The Delphi 7+ VM started life as Windows 7 VM but has since been upgraded to Windows 8.x and then Windows 10 without any problem.
The two sets of VM's are kept separate in this way to avoid OS complications with those older versions and because I use 1-6 only very, very rarely and version 7+ more often. The precise version at which the "cut-off" was made was determined by the fact that dotted unit names were also only supported from version 7 onward so a lot of the code I ever wrote for 7+ is simply not even usable with 1-6 so there's no point having them alongside each other.
In both cases the IDE/compilers (any version) have no intrinsic problems running alongside other versions.
The only real difficulty is installing Delphi 2006 on Windows Vista (or later). Should you ever need to, this is the only one that presents any real difficulty due to a dependency on .NET which is not handled very well by the installer. But it is do-able and not especially difficult as long as you follow the steps described in detail by Dr. Bob.
Install Locations: Minimising PATH Length/Manageability
With a large number of Delphi versions installed the overall length of the PATH variable can become a problem, but in my experience this is a problem only of manageability. To simplify things on that score and to avoid problems with earlier versions of Delphi on more recent versions of Windows, I installed all my IDE's in a sub-folder directly off the root:
c:\delphi\<version>
Where version is each Delphi version number (e.g. 7.0, 2007, 2009, XE, XE2 etc etc). I then have a number of other folders for shared components:
c:\delphi\bde
c:\delphi\database desktop
c:\delphi\shared files
When I setup the VM I installed each Delphi version in order and changed the installation locations for these components to these locations. In this way there is one common installation of these shared components which is updated by each more recent version as required.
I also have a c:\delphi\common\ folder where I keep things such as pre-compiled FastMM_FullDebugMode.dll etc to be shared across all Delphi versions.
I did all this primarily for my own benefit however, to keep things organised and consistent rather than to solve any particular problem (apart from the previously mentioned issues affecting older versions if installed under Program Files).
e.g. if you simply install into default locations then you will end up with versions "scattered" across Borland, CodeGear and Embarcadero folders. All my IDE versions are in one place.
With or without these considerations, the IDE should be perfectly happy to run all the different versions you mention without any particular configuration required, but you may need to pay attention to configuration/assumptions made by some 3rd party packages/libraries.
3rd Party Packages
Most 3rd party libraries/packages are usually fine, but there may be the occasional one that needs a bit of help. I myself have never come across anything that couldn't be resolved but have to say that I also don't use 3rd party libraries particularly extensively so simply may not have come across any "trouble makers".
In any event, it's unfortunately difficult to give general advice on this point since it obviously depends very much on the 3rd party libraries and the particular "problems" that any particular one might have.
I have all Delphi versions from 6 to 10.2 installed on a computer running Windows 8.1 64 bit. It's not easy to setup, especially for the older versions. The first rule would be: Do not install to "c:\program files", use a separate directory (I use "c:\delphi" with a numerical subdirectory for each version.)
That has two effects:
Older versions, that still write to the installation directory, will work.
The path entries will not be as long (even though, they will be too long after the 5th or 6th Delphi install, see the comments to your question for possible solutions)
Why did I not use multiple VMs? I maintain GExperts for the versions mentioned above and it is too much hassle to maintain the VMs. As long as it works, I will keep all Delphi versions on my computer. If it stops working, I will probably drop GExperts suppport for some Delphi versions.
There are multiple articles on getting older Delphi versions to work on Windows 8.1. They might be useful if you try it.
They are all in the category Windows 8.1:
https://blog.dummzeuch.de/category/windows/windows-8-1/

VB4 app, Jet 3.0

I've got an old VB4 app I want to look at to convert/re-write into something maintainable.
I have the source, but of course, nothing to compile it with, and VS2010 doesn't like the vbp and won't open it.
Although it installs, it won't run - failing with an out of memory error. I want to try an updated version of Jet 3.0, but I can't seem to get the files referenced in this link http://support.microsoft.com/kb/q151186/
So a few questions:
1) Where is the latest version of Jet 3.0?
2) Is running the app in VB4/5/6 the only viable option to be able to view the forms, designers, etc to convert the app?
1) If at all possible move to Jet 4.0/DAO 3.6 as they have been included in every version of Windows since Windows 2000. It's not worth your while trying to use an older version of Jet with all the install problems you will likely encounter. You might have a few syntax changes to make but I doubt they will be that severe.
2) I have no idea about how good or bad the upgrade path is from VB3 to newer versions of VB. If you don't get an answer here the real long time VB Classic (not VB.NET) experts hang out in http://groups.google.com/group/microsoft.public.vb.general.discussion/topics?hl=en That said the VB6 IDE works well in Windows 7 once you know about one particular install trick which requires creating a 0 byte msjava.dll file in the Windows directory.
1) Where is the latest version of Jet 3.0?
2) Is running the app in VB4/5/6 the only viable option to be able to
view the forms, designers, etc to convert the app?
1 - I'd try to dig up an old copy of Access (or Office)
2 - Actually I doubt it'll even work in vb6 (and vb5 might be an adventure), the project upgrade paths weren't very smooth back then, but yes, you're pretty much stuck. As far as I know there was never anything else that would emulate those designers.
If you can find a version of VB4, or Access 95, then this would come with JET3.
2) Realistically you would need VB4 to have the best chance of opening this. Try to find someone who has some old MSDN disk sets.
You might try a later version. The jump from VB4 to 6 might be too much. I imagine it would open but perhaps not run in VB5 as I presume Microsoft looked at people upgrading projects from the immediately prior version.

Need some pointers/hints in writing a Windows Application

I want to create applications in windows that has complete portability (within windows OSes of course). I have tried using one application written in Visual C++ but I had a real tough time in making it run in other windows OS (like it required .net framework libraries to be installed). This put me on the back foot because I had to copy a set of DLLs from one machine to another and most of the time something works some does not.
And I am TOTAL amateur in writing windows based applications since my technological forte is mostly Java. Where to kick off? (like which tools/IDEs to begin with since I am seriously into writing my own utilities/tools).
I am open to clarification should you guys feel my question is vague/blunt.
Thanks.
Visual C++ should be easily able to do what you want. It sounds like you created a C++/.NET project, which will generate a dependency on the .net libraries. You need to choose a different project type when the wizard starts up.
If you have a paid version of Visual C++, you might try clicking on "MFC Application". A lot of people are down on MFC these days, but it's still a quick way to get a C++ Windows app off the ground. Make sure you choose the option to statically link the MFC libraries, or you'll have another dependency.
MFC isn't included in the free version of Visual C++, so you'll need to go old-school and work directly with the Windows API or find another package such as QT or Wx to link with.
You can use .NET, and if you stay in 2.0, use standard components, it should work fine. You may need to make a few changes to work anywhere, buy very possible.
http://www.mono-project.com/Main_Page
You could either use Visual Studio or the free IDE. Sharp develope or Mono Develope.
If you really want it to work on every version of windows your best bet may be to go the route of full cross-compatibility. Grab the Boost, QT, and possibly ACE libraries and stay away from making OS calls directly. There's a free version of Visual Studio which is probably what you want for an IDE for personal development, if you're doing commercial stuff then get the full version.
Why not use Java. The JVM is on more systems then .NET and now your app will work on any OS not just windows. Plus java is easier for a beginner then C/C++ and less chance that your program will cause BSODs.

C# mono from windows to mac

I wanted to know what i shouldn't do in code that will prevent my C# app from running on mac.
In general you shouldn't use anything from the Microsoft.* namespaces, no PInvoke (DllImport in C#) and UI might be problematic as well.
Further information on Mono compatibility is contained in the Mono Guide Porting Winforms Applications. Existing applications can be checked for compatibility using the Migration Analyzer tool.
UPDATE: PInvoke actually works in Mono, but if you want to have it working cross-platform you must provide a native shared library with the same interface for each platform (i.e. Win API most likely will not work).
Mono's Application Portability guide is a good reference.
In addition to divo's recommendations, I would recommend the Mono Migration Analyzer (MoMA) tool: "The Mono Migration Analyzer (MoMA) tool helps you identify issues you may have when porting your .Net application to Mono"
Also, I would keep an eye on Miguel de Icaza's blog, and the Mono Project website.
In his presentation for the Boston.NET Users Group this month, he showed a preview of a Visual Studio plugin that launches your app on Mono using a VM! This lets you test compatibility during the development process.
I believe their goal was to release it at TechEd 2009, so look for an update over the next month or so.
You will, at the very least, want to try and avoid using Windows Forms, since that is just a paper-thin layer on top of the Windows native UI.
Mono emulates it somewhat with help from WINE, but I wouldn't trust that.
Mono did this a while ago but the effort was abandoned. See WinForms on Mono for more information. Thanks jpobst.
Try using GTK# or Qt# (although I'm not too sure the latter one actually exists) for cross platform support. You might also consider using Java with SWT or even Swing instead of C#, but that will probably not be an option you're willing to consider.
Using anything related to P/Invoke is probably also a bad idea, since that invokes native code which will probably not be portable (unless you write it yourself, then you can choose to make it portable).
I'm not sure if it is possible with mono, but WIN32 API calls will definitly not work ;)

Resources