|
hi guys,
i have coded a simple program that give the list of files in a directory. i use Visual C++ 2008 to code it. But when i copy and run the exe file from debug folder on other pc its showing " application failed to start because its side-by-side configuration is incorrect.Please see the application event log or use the command-line sxstrace.exe tool for more detail". what should i do ? i need to do this program to run portable in any windows base pc. kidly help me.
Thank you.
Regards ,
Thilek
|
|
|
|
|
Do you have any specific reason why you are "distributing" your DEBUG build? If no, try with a RELEASE build instead.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
Change the Microsoft foundation classes in the projet settings(projectmenu->settings->general tab)to Use MFC in a static library.
Then execute the appln again .Then copy the exe file and try to run in another pc.
|
|
|
|
|
where can i find the projectmenu... is it on the tool bar ?
|
|
|
|
|
Why is it so difficult to find project menu ???
Alternatively Press Alt + F7
|
|
|
|
|
i did as u said but now its showing error...
Embedding manifest...
mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\Debug\testing.exe.embed.manifest". The parameter is incorrect.
kindly help me...
|
|
|
|
|
its ok ya.. its running now.. thanks a lot u been very helpful.. thanks a lot....
|
|
|
|
|
thanks for ur idea mate... its working fine now.. thanks a lot ya...
|
|
|
|
|
Hi, can u please help.
Its a small project and involves communication with a device. The data sent by the device is Written to .DAT file (WeightValue.dat).
Following is the code:
CStdioFile fil;
fil.Open("WeightValue.dat",CFile::modeReadWrite);
fil.WriteString(LPCTSTR(value));
fil.Close();
When I try running the exe in Release / Debug Configuration, I get a debug assertion saying :
"Debugging information for ADRTest.exe cannot be found or doess not match.Binary was not built with debug information."
ADRTest.exe has triggered a breakpoint and breaks to show.
void CStdioFile::WriteString(LPCTSTR lpsz)
{
ASSERT(lpsz != NULL);
breakpoint here-> ASSERT(m_pStream != NULL);
if (lpsz == NULL)
{
AfxThrowInvalidArgException();
}
if (_fputts(lpsz, m_pStream) == _TEOF)
AfxThrowFileException(CFileException::diskFull, _doserrno, m_strFileName);
}
Awaiting your kind reply.
Thanks and Regards.
Divya.
|
|
|
|
|
It seems you are trying to run your RELEASE build in debug mode. Could it be that the output directory for your DEBUG and RELEASE targets is the same directory and you previously built a release EXE and now you are trying to run it in DEBUG mode? Even if not, a simple "clean and rebuild" can't hurt...
Aside of that, my guess would be that fil.Open("WeightValue.dat",CFile::modeReadWrite); fails, i think if it does not find the file specified it won't create it for you, so it can't open it. Check the flags for open here[^], i guess you need CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite | CFile::typeText , maybe with the hint of a seeking to the end of the file if you wish to append to it.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Try:
CStdioFile fil;
CFileException e;
if (fil.Open("WeightValue.dat", CFile::modeReadWrite, &e) != FALSE)
{
fil.WriteString((LPCTSTR) value);
fil.Close();
} What type of variable is value ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
i m using this.
1. declare it in header file.
protected:
CBrush m_brush;
2. now on OnInitDialg()
m_brush.CreateSolidBrush(RGB(245, 245, 245));
3.now on OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
return m_brush;
but here edit contol also colored with this color.
please tell me how can i change Back ground color of dialog box and back ground color of static control.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi,
Create a class for the control, then return the brush in OnCtlColor()(in the new class).Just try it iam not sure about the result.
|
|
|
|
|
If you read here[^], you find WM_CTLCOLORDLG[^] and WM_CTLCOLORSTATIC[^], maybe try handling these messages instead of WM_CTLCOLOR, aside of that, the documentation also states this for WM_CTLCOLOR:
lParam
A handle to a child window (control).
This is the handle of the control asking for the color information, you could use that to filter out the controls you wish to change the background color.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Thanks,
please tell how can i color the background of formview.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
hi All
I m writing a directshow application in vc++ 2005. My problem is that I m trying to merge two or more videos clips but i can't get any help from anywhere please help me how do i this.
please help me
Thanks in advance
|
|
|
|
|
What do you mean by merge?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I'm new to C++.
I try to build the Simple application in Microsoft's detours project in VS08.
Detours is used to inject dlls into API processes or into applications. You can find it at:
http://research.microsoft.com/en-us/projects/detours/
I managed to build:
detoured.dll
detours.lib
Simple.dll (That's the hook)
setdll.exe (The program that injects the hook)
sleep5.exe (The exe that uses the hooked API)
When I try to run the hook:
setdll /d:simple.dll
I get the error message:
Error: simple.dll does not export function with ordinal #1.
It's because Simple.dll doesn't export anything.
Detoured.dll does export the function detoured.
detoured.h:
#ifdef DETOURED_EXPORTS
#define DETOURED_API __declspec(dllexport)
#else
#define DETOURED_API __declspec(dllimport)
#endif
HMODULE DETOURED_API WINAPI Detoured();
detoured.cpp:
#include <windows.h>
#include "detoured.h"
static HMODULE s_hDll;
HMODULE WINAPI Detoured()
{
return s_hDll;
}
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved)
{
(void)reserved;
if (dwReason == DLL_PROCESS_ATTACH) {
s_hDll = hinst;
DisableThreadLibraryCalls(hinst);
}
return TRUE;
}
</windows.h>
But simple.cpp is just this in the package:
#include <stdio.h>
#include <windows.h>
#include "detours.h"
static LONG dwSlept = 0;
static VOID (WINAPI * TrueSleep)(DWORD dwMilliseconds) = Sleep;
VOID WINAPI TimedSleep(DWORD dwMilliseconds)
{
DWORD dwBeg = GetTickCount();
TrueSleep(dwMilliseconds);
DWORD dwEnd = GetTickCount();
InterlockedExchangeAdd(&dwSlept, dwEnd - dwBeg);
}
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved)
{
LONG error;
(void)hinst;
(void)reserved;
if (dwReason == DLL_PROCESS_ATTACH) {
printf("simple.dll: Starting.\n");
fflush(stdout);
DetourRestoreAfterWith();
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(&(PVOID&)TrueSleep, TimedSleep);
error = DetourTransactionCommit();
if (error == NO_ERROR) {
printf("simple.dll: Detoured Sleep().\n");
}
else {
printf("simple.dll: Error detouring Sleep(): %d\n", error);
}
}
else if (dwReason == DLL_PROCESS_DETACH) {
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourDetach(&(PVOID&)TrueSleep, TimedSleep);
error = DetourTransactionCommit();
printf("simple.dll: Removed Sleep() (result=%d), slept %d ticks.\n",
error, dwSlept);
fflush(stdout);
}
return TRUE;
}
</windows.h></stdio.h>
So I tried to make it similar to detoured.dll:
simple.h:
#ifdef SIMPLE_EXPORTS
#define SIMPLE_API __declspec(dllexport)
#else
#define SIMPLE_API __declspec(dllimport)
#endif
HMODULE SIMPLE_API WINAPI Simple();
Simple.cpp:
#include <stdio.h>
#include <windows.h>
#include "..\detours\detours.h"
#define SIMPLE_EXPORTS
static LONG dwSlept = 0;
static VOID (WINAPI * TrueSleep)(DWORD dwMilliseconds) = Sleep;
static HMODULE s1_hDll;
HMODULE WINAPI Simple()
{
return s1_hDll;
}
VOID WINAPI TimedSleep(DWORD dwMilliseconds)
{
DWORD dwBeg = GetTickCount();
TrueSleep(dwMilliseconds);
DWORD dwEnd = GetTickCount();
InterlockedExchangeAdd(&dwSlept, dwEnd - dwBeg);
}
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved)
{
LONG error;
(void)reserved;
if (dwReason == DLL_PROCESS_ATTACH) {
s1_hDll = hinst;
printf("simple.dll: Starting.\n");
fflush(stdout);
DetourRestoreAfterWith();
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(&(PVOID&)TrueSleep, TimedSleep);
error = DetourTransactionCommit();
if (error == NO_ERROR) {
printf("simple.dll: Detoured Sleep().\n");
}
else {
printf("simple.dll: Error detouring Sleep(): %d\n", error);
}
}
else if (dwReason == DLL_PROCESS_DETACH) {
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourDetach(&(PVOID&)TrueSleep, TimedSleep);
error = DetourTransactionCommit();
printf("simple.dll: Removed Sleep() (result=%d), slept %d ticks.\n",
error, dwSlept);
fflush(stdout);
}
return TRUE;
}
</windows.h></stdio.h>
But Simple.dll still doesn't export anything, because SIMPLE_EXPORTS is undefined. How to build this project correctly?
|
|
|
|
|
Put the line
#define SIMPLE_EXPORTS
before the line
#include "simple.h"
«_Superman_»
|
|
|
|
|
Thanks, that worked. But I still don't know, why detoured.dll exported without "#define DETOURED_EXPORTS".
|
|
|
|
|
The pre-processor definitions can also be given as a project settings instead of putting it inside the code file.
Check the PreprocessorDefinitions key inside .vcproj file.
It could be there.
«_Superman_»
|
|
|
|
|
Bingo!
I copied it from an other project and I forgot about it. Man, it's so complicated!
|
|
|
|
|
Hi,
I wanted to open a media file thru 'IWMMetadataEditor' struct variable in C++. After opening this file , I am initialising the 'IWMHeaderInfo' struct variable so that I can collect the meta data of media file(audio/video) through it's properties..
Can anybody tell me how to get the file name which is being played in WMP which will be input to 'IWMMetadataEditor' (pEditor->Open(???))
Regards,
Supriya Tonape.
|
|
|
|
|
Hi all!
I'm on a ciphering Win32 project and i have the following problem:
I have created the thread and I don't use SendMessage calls inside the thread procedure. I use PostMessage with user defined messages to display progress information on the main window. But when the thread starts the whole program dead locks. Is that means that it needs a Sleep function or something else that you could suggest me?
Thanks!
|
|
|
|
|
Show code. Could be anything, you could -maybe- be flooding your GUI thread with messages, or maybe your thread is a run-away thead (it eats up all the CPU time so your GUI has no chanche to do anything), or it could be a deadlock caused by a cross-lock problem, or or or...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|