Our office Release: Microsoft® Word for Microsoft 365 MSO (Version 2208 Build 16.0.15601.20148) 64-bit
Our OS Release: Windows 11 Enterprise - Windows Feature Experience Pack 1000.22000.978.0
Issue:
We used to open Word embedded in one of our windows application component.
In the last Office Release, Word is not embedded anymore. It opens in popup (outplace).
This is a big issue for us since our customers require to keep the embedded functionality.
Word Configuration: « optimize for compatibility” is checked.
In the previous Releases (before windows 11), Without the following configuration, Word opens outplace (popup).
As soon as we check « optimize for compatibility”, Word used to open embedded.
However, with the last Office/Windows updates, This option has no more effect and Word always opens outplace whereas we need it to open inplace.
We identified that everything is working well until the Office Release 2202 (Build 16.0 14931.20132) and it stops working from the Office Release 2203 (Build 16.0 15028.20160).
Process:
We develop in C++ with OLE Components.
Step1 : Word is created as follow:
https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatefromfile
CIStorage ciStorage(pStorage);
IFT(!ciStorage.IsEmpty() || COMCALL(StgCreateDocfile(NULL, STGM_SHARE_DENY_WRITE|STGM_DELETEONRELEASE|STGM_READWRITE|STGM_TRANSACTED|STGM_CREATE, 0, ciStorage)))
{
CIOleObject ciOleObject;
IFCOM(OleCreateFromFile(CLSID_NULL, cbsFileName, ciOleObject.iidOf(), renderopt, pFormatetc, pSite, ciStorage, ciOleObject))
{
CLSID_NULL : as documented
cbsFileName : {m_bstr=0x0000027a33146098 L"C:\\ProgramData\\MEGA\\Hopex Application Server\\5000\\.shadowFiles\\hopex.core\\15.5.0+6267\\Mega_Std\\megastyl620.dot" }
renderopt : null
pFormatetc : null
pSite : our site component implementing the following interfaces:
public IOleClientSite,
public IOleInPlaceSite,
public IOleDocumentSite,
public IAdviseSink,
public IServiceProvider,
public IInternetSecurityManager,
public IDocHostUIHandler
ciStorage : storage
Step2: Display Word embedded in our windows application
https://learn.microsoft.com/en-us/windows/win32/api/oleidl/nf-oleidl-ioleobject-doverb
if(!(bOK = (m_ciOleObject.DoVerb(lVerb, &stMsg, m_pSite, 0L , m_pSite->m_hWndSite, m_pSite->m_rcClip) == S_OK)))
lVerb : -1 (match to OLEIVERB_SHOW)
sMsg : empty
m_pSite : our site
m_pSite->m_hWndSite : the parent HWND where word must be embedded.
m_pSite->m_rcClip : the coordinates of the area in which we want to insert the OLE Object (word). For example: {LT(0, 0) RB(943, 437) [943 x 437]}.
It should be noticed that DoVerb is directly called after the OLE Object creation.
We tried different verbs such as below without success.
OLEIVERB_PRIMARY (0L)
OLEIVERB_SHOW (-1)
OLEIVERB_UIACTIVATE (-4)
Those APIs are always supported.
We are wondering how to fix this issue.
Related
On Windows Server 2003 32-bit, IIS 6.0 I currently have a working ASP classic page successfully using a VB6 DLL to render text as images using many varied fonts (the DLL references GDI+ to render a jpeg of the text in the specified font, etc.):
[working VBScript calling out to a VB6 DLL which calls to GDI+]
Set ig = Server.CreateObject("MyCo.ImageGenerator") 'the DLL
ret = ig.GenerateImage(text, font, size, path, color, italics, bold)
I need to transfer this site to a Windows 2008 or later server. On the new server, GDI+ has an error, specifically at this line in the VB6 DLL code:
lRes = GdipCreateBitmapFromHBITMAP(pict.Handle, 0, lBitmap) 'ret 2 (0 is success)
When I call the same DLL function (i.e. GenerateImage) from a Windows Forms App on the new server, it generates the image with no problem. I don't think it's a permissions issue because:
the target folder for generated images that the ASP VBScript directs the DLL to has full permissions for "Everyone" (for setup testing only) and
logging code in the DLL can write to the target directory
EDIT I (later) gave the Network Service user (the app pool account) read / read-execute permission without seeing a change in behavior (as suggested in a comment by #Lankymart).
I'm confused why the DLL works fine from a Windows Forms app call, but not from within IIS 7.
Hi IIS>Advanced Properties> Enable 32-Bit Application> is True check please and windows server x64 then dll register for C:\Windows\SysWOW64
My custom tool window in a Visual Studio Extension package is supposed to evaluate custom expressions during debug sessions for VS2012 and VS2013. The final goal is to build a graphical watch window. Therefore, I must fetch the value of the expression result from the debug engine.
The evaluation works fine via
IDebugStackFrame2 -> IDebugExpressionContext2 -> ParseText
IDebugExpression2 -> EvaluateSync -> IDebugProperty2
The first problem here: On Visual Studio 2013 ParseText() does not correctly report errors. But the IDebugProperty2 retrieved is valid (for valid expressions). On VS2012 I get proper errors for invalid expressions.
This is where the real problem starts. The result Property2 represents a complex custom object. In order to visualize it, a specific property from one of its base classes needs to get retrieved. In my current attempt, I am using IDebugProperty2.EnumChildren() to walk along its members up to the right place in the class hierarchy, similar as one would do in the Locals window in Visual Studio:
[result] -> base -> Raw -> base -> Non-public Members -> [private field] ... a.s.o.
This is somehow working but introduces the following problems:
Problem 1: Get an internal member of some complex object
The members and their order received from EnumChildren() seem to depend on some factors, which are not obvious to me:
* Does the object has a Debug Visualizer attached? (VS2013 ignores enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE_RAW in EnumChildren and gives back the beautified version + a "Raw View" node, VS2012 works as expected)
* Is a 'Non-public Members' node shown? Sometimes it is, sometimes not - dunno from what it depends on
* Setting of 'Just my code' (? I read about it in several posts but couldn't really figure out a reliable rule)
* ... there must be other dependencies ?
This turns out to be a really hacky way of aquiring an internal member of some complex expression result object. What could be a better way? Using IDebugProperty3 and some Debugger Visualizer tricks? Any pointer would be great.
Problem 2: VS2012 fails to give memory bytes
Once I have the private member of the result object, I use IDebugProperty2.GetMemoryBytes() in order to 'serialize' its value (a plain System.Array) and transfer it to my Custom Tool Window. While this is working in VS2013, in VS2012 IDebugProperty2.GetMemoryBytes() always returns VS_Constants.S_FALSE. I am really out of ideas here. Since there is a Memory Window in VS2012, there ought to be some way to get this working here also? What am I missing?
The code used to query the memory API:
IDebugMemoryContext2 memCtx = null;
IDebugMemoryBytes2 memBytes = null;
// getting the memory context is working ok
if (tmpProperty2.GetMemoryContext(out memCtx) == VSConstants.S_OK
// VS2012 fails here, always returns S_FALSE, memBytes remains null:
&& (tmpProperty2.GetMemoryBytes(out memBytes) == VSConstants.S_OK)) {
...
Some more context:
OS: Windows 8 and 8.1
Visual Studio: 2012 / 2013
Tool Window built with MPF (C#) in VS2013, (removed all vers. 12 references from the package before deploying to VS2012)
Debug engines: C# and Visual Basic
I am using OSVERSIONINFO to check the OS in my vb6 application. But i am not able differentiate between windows 7 and windows server 2008 R2 because they have same version number,dwMajorVersion and dwMinorVersion. So how to differentiate between these. I think it can be done in vb.net using some other method. But how it can be done in vb6?
As Xearinox noted in the above comment, OSVERSIONINFOEX returns more information.
In particular, you can examine wProductType to determine whether VER_NT_WORKSTATION (0x0000001) is set or not. If it is, the machine is running a client OS, otherwise, server.
The chart in the remarks section of the OSVERSIONINFO MSDN entry even has a column which points out detecting the various OS's using that struct item.
Right Click On Tool Bar > Components And Add > Microsoft SysControl 6.0.
Double Click The SysInfo Button to Add on Form and use this code
Private Sub Form_Load()
Dim HancyRockz as string
HancyRockz = "OsVersion :- " & SysInfo1.OSVersion & " / Built " & SysInfo1.OSBuild
Text1.Text=HancyRockz
End Sub
I have installed MS Visual Web Developer 2010 which includes IIS Express.
Before this, I had installed XAMPP server for my php applications.
I would like to know how can I stop IIS in order to be able to start XAMPP? It appears that they use the same port. I guess those could be changed, but I do not want to interfere with other programs, and more than that I think this should be simpler.
Thanks!
Closing IIS Express
By default Visual Studio places the IISExpress icon in your system tray at the lower right hand side of your screen, by the clock. You can right click it and choose exit. If you don't see the icon, try clicking the small arrow to view the full list of icons in the system tray.
then right click and choose Exit:
Changing the Port
Another option is to change the port by modifying the project properties. You'll need to do this for each web project in your solution.
Visual Studio > Solution Explorer
Right click the web project and choose Properties
Go to the Web tab
In the 'Servers' section, change the port in the Project URL box
Repeat for each web project in the solution
If All Else Fails
If that doesn't work, you can try to bring up Task Manager and close the IIS Express System Tray (32 bit) process and IIS Express Worker Process (32 bit).
If it still doesn't work, as ni5ni6 pointed out, there is a 'Web Deployment Agent Service' running on the port 80. Use this article to track down which process uses it, and turn it off:
https://sites.google.com/site/anashkb/port-80-in-use
An excellent answer given by msigman. I just want to add that in windows 10 you can find IIS Express System Tray (32 bit) process under Visual Studio process:
Open Task Manager and Kill both of these processes. They will autostart back up.
Then try debugging your project again.
I came across the same issue. My aim is to test PHP scripts with Oracle on Windows 7 Home and without thinking installed IIS7 express and as an afterthought considered Apache as a simpler approach. I will explore IIS express's capabilities seperately.
The challenge was after installing IIS7 express the Apache installation was playing second fiddle to IIS express and bringing up the Microsoft Homepage.
I resolved the port 80 issue by :-
Stopping Microsoft WedMatrix :- net stop was /y
Restarted the Apache Server
Verifying Apache now was listening on the port :- netstat -anop
Clearing out the Browsers caches - Firefox and IE
Running localhost
Here is a static class implementing Start(), Stop(), and IsStarted() for IISExpress. It is parametrized by hard-coded static properties and passes invocation information via the command-line arguments to IISExpress. It uses the Nuget package, MissingLinq.Linq2Management, which surprisingly provides information missing from System.Diagnostics.Process, specifically, the command-line arguments that can then be used to help disambiguate possible multiple instances of IISExpress processes, since I don't preserve the process Ids. I presume there is a way to accomplish the same thing with just System.Diagnostics.Process, but life is short. Enjoy.
using System.Diagnostics;
using System.IO;
using System.Threading;
using MissingLinq.Linq2Management.Context;
using MissingLinq.Linq2Management.Model.CIMv2;
public static class IisExpress
{
#region Parameters
public static string SiteFolder = #"C:\temp\UE_Soln_7\Spc.Frm.Imp";
public static uint Port = 3001;
public static int ProcessStateChangeDelay = 10 * 1000;
public static string IisExpressExe = #"C:\Program Files (x86)\IIS Express\iisexpress.exe";
#endregion
public static void Start()
{
Process.Start(InvocationInfo);
Thread.Sleep(ProcessStateChangeDelay);
}
public static void Stop()
{
var p = GetWin32Process();
if (p == null) return;
var pp = Process.GetProcessById((int)p.ProcessId);
if (pp == null) return;
pp.Kill();
Thread.Sleep(ProcessStateChangeDelay);
}
public static bool IsStarted()
{
var p = GetWin32Process();
return p != null;
}
static readonly string ProcessName = Path.GetFileName(IisExpressExe);
static string Quote(string value) { return "\"" + value.Trim() + "\""; }
static string CmdLine =
string.Format(
#"/path:{0} /port:{1}",
Quote(SiteFolder),
Port
);
static readonly ProcessStartInfo InvocationInfo =
new ProcessStartInfo()
{
FileName = IisExpressExe,
Arguments = CmdLine,
WorkingDirectory = SiteFolder,
CreateNoWindow = false,
UseShellExecute = true,
WindowStyle = ProcessWindowStyle.Minimized
};
static Win32Process GetWin32Process()
{
//the linq over ManagementObjectContext implementation is simplistic so we do foreach instead
using (var mo = new ManagementObjectContext())
foreach (var p in mo.CIMv2.Win32Processes)
if (p.Name == ProcessName && p.CommandLine.Contains(CmdLine))
return p;
return null;
}
}
You can stop any IIS Express application or you can stop all application. Right click on IIS express icon , which is located at right bottom corner of task bar. Then Select Show All Application
to stop IIS manually:
go to start menu
type in IIS
you get a search result for the manager (Internet Information Services (IIS) manager, on the right side of it there are restart/stop/start buttons.
If you don't want IIS to start on startup because its really annoying..:
go to start menu.
click control panel.
click programs.
turn windows features on or off
wait until the list is loaded
search for Internet Information Services (IIS).
uncheck the box.
Wait until it's done with the changes.
restart computer, but then again the info box will tell you to do that anyways (you can leave this for later if you want to).
oh and IIS and xampp basically do the same thing just in a bit different way. ANd if you have Xampp for your projects then its not really all that nessecary to leave it on if you don't ever use it anyways.
I have added the Windows Media Player com control into my toolbox and then used the control successfully on a Form in Debug mode.
However, when I try running the application in Release mode it errors with...
Could not load file or assembly
'Interop.WMPLib, ... or one of its
dependecies. An attempt was made to
load a program with an incorrect
format.
Through some tracing I've established that the error occurs not when creating the control but on the EndInit method.
Public Sub New
InitializeComponent()
wmp = New AxWMPLib.AxWindowsMediaPlayer()
wmp.BeginInit()
wmp.Enabled = True
wmp.Name = "wmp"
wmp.OcxState = CType(resources.GetObject("wmp.OcxState"), AxHost.State)
Me.Controls.Add(wmp)
Me.Controls.SetChildIndex(wmp, 0)
wmp.Dock = System.Windows.Forms.DockStyle.Fill
wmp.EndInit() ' <<< errors here !
End Sub
What am I missing?
You changed the Platform target setting in the Debug configuration. Possibly weeks ago, maybe even in a previous version of Visual Studio. But didn't change it in the Release configuration. It is one of the settings that is configuration specific.