Click to See Complete Forum and Search --> : "Side-by-side configuration is incorrect"


Kremlin
January 25th, 2008, 12:59 AM
I'm starting a pretty basic C++ DirectX program. All it does it define and show a simple empty window with a title. It works for me, but when I try to run it on other computers, I get "Side-by-side configuration is incorrect, program cannot run" or something like that. I'm using Visual C++ 2008 Express.

Here's my source:

#include <windows.h>
#include <windowsx.h>

// the WindowProc function prototype
LRESULT CALLBACK WindowProc(HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam);

// the entry point for any Windows program
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// the handle for the window, filled by a function
HWND hWnd;
// this struct holds information for the window class
WNDCLASSEX wc;

// clear out the window class for use
ZeroMemory(&wc, sizeof(WNDCLASSEX));

// fill in the struct with the needed information
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC)WindowProc;
wc.hInstance = hInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
wc.lpszClassName = L"WindowClass1";

// register the window class
RegisterClassEx(&wc);

// create the window and use the result as the handle
hWnd = CreateWindowEx(NULL,
L"WindowClass1", // name of the window class
L"Flux Online", // title of the window
WS_OVERLAPPEDWINDOW, // window style
300, // x-position of the window
300, // y-position of the window
500, // width of the window
400, // height of the window
NULL, // we have no parent window, NULL
NULL, // we aren't using menus, NULL
hInstance, // application handle
NULL); // used with multiple windows, NULL

// display the window on the screen
ShowWindow(hWnd, nCmdShow);

// enter the main loop:

// this struct holds Windows event messages
MSG msg;

// Enter the infinite message loop
while(TRUE)
{
// find out the starting time of each loop
DWORD starting_point = GetTickCount();

// Check to see if any messages are waiting in the queue
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
// If the message is WM_QUIT, exit the while loop
if (msg.message == WM_QUIT)
break;

// translate keystroke messages into the right format
TranslateMessage(&msg);

// send the message to the WindowProc function
DispatchMessage(&msg);
}

// Run game code here
// ...
// ...

// wait until 1/40th of a second has passed
while ((GetTickCount() - starting_point) < 25);
}

// return this part of the WM_QUIT message to Windows
return msg.wParam;
}

// this is the main message handler for the program
LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
// sort through and find what code to run for the message given
switch(message)
{
// this message is read when the window is closed
case WM_DESTROY:
{
// close the application entirely
PostQuitMessage(0);
return 0;
} break;
}

// Handle any messages the switch statement didn't
return DefWindowProc (hWnd, message, wParam, lParam);
}

Mike Harnad
January 25th, 2008, 08:08 AM
This (http://channel9.msdn.com/ShowPost.aspx?PostID=23261) might help.

Kremlin
January 25th, 2008, 07:13 PM
Didn't help :(

Thanks though...

CBasicNet
January 27th, 2008, 08:07 PM
You need to install VC++ 2008 runtime redistributable package on other PCs which doesn't have VC 2008 installed.

Microsoft Visual C++ 2008 Redistributable Package (x86) (http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en)

Kremlin
January 28th, 2008, 01:11 AM
Wait, so how do I compile this so that it will run on any computer that doesn't have MSVC++ 2008 or the redistributable package?

stephenteh
January 28th, 2008, 11:44 AM
Wait, so how do I compile this so that it will run on any computer that doesn't have MSVC++ 2008 or the redistributable package?

change your project settings to not use the runtime library, but this will make the output exe bigger.

Project Properties -> C/C++ -> Code Generation -> Runtime Library -> use/MT or /MTd depends on your current configuration.

johnsvakel
November 10th, 2009, 10:38 PM
Side by side configuration will comes in picture, if we are buiding an application with later version of an assembly, and our client machine doesnt have this.

Please go to event viewer windows and check widows event view.
There should be an entry with sidebyside.From that we can see which reference assembly is missing
for Eg.

"Activation context generation failed for "\\machine_sha\share\exe\release\SwitchConfig.exe". Dependent Assembly Microsoft.VC90.MFC,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis."

This means that particular version of the assembly file is missing from C:\Windows\WinSxs Folder.
We need to install microsoft redistributable package here
Download from
http://www.microsoft.com/downloads/details.aspx?familyid=2051A0C1-C9B5-4B0A-A8F5-770A549FD78C&displaylang=en#top
Then reboot the PC.The application will start working now.

If you are running VS2005, redistributable package is available in

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=766a6af7-ec73-40ff-b072-9112bab119c2

http://www.microsoft.com/technet/security/bulletin/MS09-035.mspx

Install this and reboot PC, application will start working.

Usage of sxstrace.exe is as follows
Start VS command prompt(start->all programs->Microsoft visual studio 2008->visual studio tools->
command prompt)

Usage: SxsTrace [Options]
Options:
Trace -logfile:FileName [-nostop]
Enabling tracing for sxs.
Tracing log is saved to FileName.
If -nostop is specified, will not prompt to stop tracing.
Parse -logfile:FileName -outfile:ParsedFile [-filter:AppName]
Translate the raw trace file into a human readable format and save the re
sult to ParsedFile.
Use -filter option to filter the output.
Stoptrace
Stop the trace if it is not stopped before.
Example: SxsTrace Trace -logfile:SxsTrace.etl
SxsTrace Parse -logfile:SxsTrace.etl -outfile:SxsTrace.txts

Regards
John Samuel

johnsvakel
December 8th, 2009, 09:15 PM
Sxtrace.exe is useful for identifying side by side configuration error

Sputnik555
September 9th, 2010, 11:31 PM
To me this error just came up when writing a plugin for Maya.
I've compiled it, and on my machine it works great, however on other machines (same maya-version, same system) it doesn't, and I'm getting:
// Error: line 1: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.


I was a little confused about a few things mentioned here - about the patch for Microsoft Visual Studio 2005 (http://www.microsoft.com/downloads/d...2-9112bab119c2 ), do I have to install that, or the person that wants to use the plugin (where this error comes up)?

I tried installing the patch on my computer, however there seems to be a mistake that the install suddenly breaks up without any error message..