|
I keep getting an access violation when a certain dialog box closes in my program.
When I ran it through the debugger, I found that the error is occuring
somewhere withing mfc42.dll, where I can't actually see the code and know
what it is doing. Here is the line the debugger did give me though:
5F404FCF mov eax,dword ptr [ecx]
Can anyone tell me what this is trying to do? I have been stuck on this problem
for a while and haven't been able to track it down. The call stack was also fairly useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
Thanks,
Adam
pandcc3@comwerx.net
http://members.xoom.com/Q3KillStats
|
|
|
|
|
I keep getting an access violation when a certain dialog box closes in my program.
When I ran it through the debugger, I found that the error is occuring
somewhere withing mfc42.dll, where I can't actually see the code and know
what it is doing. Here is the line the debugger did give me though:
5F404FCF mov eax,dword ptr [ecx]
Can anyone tell me what this is trying to do? I have been stuck on this problem
for a while and haven't been able to track it down. The call stack was also fairly useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
Thanks,
Adam
pandcc3@comwerx.net
http://members.xoom.com/Q3KillStats
|
|
|
|
|
I keep getting an access violation when a certain dialog box closes in my program.
When I ran it through the debugger, I found that the error is occuring
somewhere withing mfc42.dll, where I can't actually see the code and know
what it is doing. Here is the line the debugger did give me though:
5F404FCF mov eax,dword ptr [ecx]
Can anyone tell me what this is trying to do? I have been stuck on this problem
for a while and haven't been able to track it down. The call stack was also fairly useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
Thanks,
Adam
pandcc3@comwerx.net
http://members.xoom.com/Q3KillStats
|
|
|
|
|
Hello.
Q: How should I package our newly developed app-framework/architecture (a set of base-classes and a database-access-COM-class-generator) in order to get the average newbie to use the framework instead of yet another homebrew?
The problem now is that the framework is great, but it is tedious and error prone to set up VC++ to use the framework for a new app; i.e.
* create 2 new ATL/COM-projects
* feed the generator a DSN
* add a dozen shared .cpp/.h-files
* paste a number of generated .idl-snippets into the project's .idl file
* generate a few "dummy" ATL Objects using the existing ATL Object Wizard
* replace the dummy files with the "real" files,
* #import a few libraries in stdafx.h in the correct order * also some basic project settings needs to be done once and for all (C++ exception handling on)
* etc etc etc.
Ideally I guess it would be something like the "ATL/COM AppWizard" that sets everything up the correct way (in 5 seconds instead of 2 hours of following a 50+ step guide on paper).
Anyone tried writing such an add-in? Any other suggestions how to make this accessible?
thanks!
/Martin
|
|
|
|
|
Hello.
Q: How should I package our newly developed app-framework/architecture (a set of base-classes and a database-access-COM-class-generator) in order to get the average newbie to use the framework instead of yet another homebrew?
The problem now is that the framework is great, but it is tedious and error prone to set up VC++ to use the framework for a new app; i.e.
* create 2 new ATL/COM-projects
* feed the generator a DSN
* add a dozen shared .cpp/.h-files
* paste a number of generated .idl-snippets into the project's .idl file
* generate a few "dummy" ATL Objects using the existing ATL Object Wizard
* replace the dummy files with the "real" files,
* #import a few libraries in stdafx.h in the correct order * also some basic project settings needs to be done once and for all (C++ exception handling on)
* etc etc etc.
Ideally I guess it would be something like the "ATL/COM AppWizard" that sets everything up the correct way (in 5 seconds instead of 2 hours of following a 50+ step guide on paper).
Anyone tried writing such an add-in? Any other suggestions how to make this accessible?
thanks!
/Martin
|
|
|
|
|
Hi,
I have a vector object that has some elements in it and I want to remove an item completly from
the vector. Here is what I mean,
vector<int> inV;
for (i=0; i<10; i++)
inV.push_back(i);
I would like to call a function that will remove one of the items and leave me with 9 elements in
the vector. I tried using remove(...), but that doesn't do what I want. If I use remove, I have to
copy the valid elements from one vector to another and I don't really want to do that each time
I have to delete an element. If this is possible please let me know.
Thank in advance
|
|
|
|
|
what about using the std::vector::erase() function to delete a single element or the std::vector::clear() function to remove 'em all?
|
|
|
|
|
Hi Uwe,
I think I can use erase() to delete a single element. I know there had to be an easier way, thanks allot.
|
|
|
|
|
Hi,
I have a vector object that has some elements in it and I want to remove an item completly from
the vector. Here is what I mean,
vector<int> inV;
for (i=0; i<10; i++)
inV.push_back(i);
I would like to call a function that will remove one of the items and leave me with 9 elements in
the vector. I tried using remove(...), but that doesn't do what I want. If I use remove, I have to
copy the valid elements from one vector to another and I don't really want to do that just each time
I have to delete an element. If this is possible please let me know.
Thank in advance
|
|
|
|
|
I have seen Richedit controls with background images on them.
I would like to do this as well. I can do this with a regual CEdit control by catching the WM_CTLCOLOR message to set the DC mode to TRANSPARENT before the control begins
drawing itself - however the RichEdit control doesn send this message. Does anyone have any suggestions at all?
|
|
|
|
|
I have been trying to access a file right after it has been created at run-time. The file is created in an
Initializing Dialog then the name of the file is sent to another dialog. The second dialog can't find the
file (using CFileFind) on the first call. If I cancel the second Dialog, keep the application running and call
the first Dialog again the application finds the file. Can anyone tell me why this is?
Is there a way to find the file the first time through? Any help would be greatly appreciated.
|
|
|
|
|
Maybe you must flush or even close the file handle so that the file is actually written and not somewhere in the write-cache?
|
|
|
|
|
thanx for the help. Unfortunately, I tried to do both on the same file handle and it still doesn't work.
I had used CStdioFile to create the file and changed it to CFile thinking it might make a difference and
still nothing. Any other suggestions?
|
|
|
|
|
hi!!
i'm currently making a sound player (ok, let's just say it's a wave player), and i've implemented a spectrum analyser for the visualisation. BUT :
a. why my analyser went off first before i hear the actual sound being played?
b. how can i fix that problem? (winamp and other sound players are able to synch the vis and the output)
i'm using the Win32 wave API functions btw.
thanks!!!
|
|
|
|
|
How do I close a program that I have launched using ShellExecute()
I get an HINSTANCE back
can I use this object to close the program
?
Thanx in advance
Alfadhly
|
|
|
|
|
If you really start an EXE, use <a href="http://msdn.microsoft.com/library/psdk/winbase/prothred_9dpv.htm">::CreateProcess()</a> .
You can then e.g. wait for the program to finish and surely there is a way of getting the window-handle somehow to ::SendMessage() or ::PostMessage() a shutdown-request (WM_CLOSE or something like that).
|
|
|
|
|
Try with this code:
(then you may post a WM_QUIT message to that window)
// start an application given its full path
// and gets the main window, which is initially hidden
// NULL if some errors occurred or
// main window could not be determined
HWND StartApp(LPCTSTR path);
#define TIMEOUT 20*1000
struct ProcessWindow
{
DWORD processID;
DWORD threadID;
HWND hwnd;
};
static BOOL CALLBACK EnumWindowsProc(
HWND hwnd, // handle to the window
ProcessWindow *lParam // application-defined value
)
{
DWORD processID = NULL;
DWORD threadID = GetWindowThreadProcessId(hwnd, &processID);
if (processID == lParam->processID && threadID == lParam->threadID)
{
lParam->hwnd = hwnd;
return FALSE; // stop enum
}
return TRUE;
}
HWND StartApp(LPCTSTR path)
{
STARTUPINFO si;
ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
si.wShowWindow = SW_HIDE;
PROCESS_INFORMATION pi;
TCHAR buf[MAX_PATH];
lstrcpyn(buf, path, MAX_PATH);
if (!CreateProcess(NULL, buf, NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE |
NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi))
return NULL;
if(WaitForInputIdle(pi.hProcess, TIMEOUT) != 0)
return NULL;
// get the main window
ProcessWindow pw;
pw.hwnd = NULL;
pw.processID = pi.dwProcessId;
pw.threadID = pi.dwThreadId;
if (EnumWindows((WNDENUMPROC)EnumWindowsProc, (LPARAM)(LPVOID)&pw))
return NULL;
return pw.hwnd;
}
|
|
|
|
|
use FindWindow() to obtain a handle to the window that you just launched. For instance, I have a program that opens a text file called help in Notepad:
HWND foundWindow;
foundWindow = FindWindow(NULL, "Help - Notepad");
//FindWindow returns a handle for your window,
//if it is found.
PostMessage(foundWindow, WM_DESTROY, NULL, NULL);
//now send the window that we just found a destroy message
there you go.
|
|
|
|
|
How can I change function "On Top" for a dialog from meny or a button.
|
|
|
|
|
To make the dialog always-on-top:
SetWindowPos ( hwndDialog, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
To make it no longer always-on-top, change HWND_TOPMOST to HWND_NOTOPMOST.
|
|
|
|
|
How do i get my cformviews to be centered in the CMainFrame ???
I've tried to put a routine in PreCreateWindow but that didn't work ???
If anyone has any suggestion please let me know
Thanx in advance
|
|
|
|
|
You should use a layout manager (see the Dialogs section here at codeproject) to move the controls when the view is resized.
It is also possible to resize some of the controls with the view.
|
|
|
|
|
In OnInitalUpdate just call CenterWindow();
|
|
|
|
|
>In OnInitialUpdate just call CenterWindow();
That might just work... for an MDI child window, not a SDI view!!
Yours,
Brian Hart
|
|
|
|
|
Hi folks,
I am writting a program that Encrypts/Decrypts files (using CFile). It works fine when I do Text files, but when I do an .exe (Decrypting), it puts a different char?? could this have to do with the way I'm reading in the File (mode)?
I have tried using it in Binary Mode and still the same!
NOTE: All of the characters (placement) are correct, its just that in the .exe there is NOT all of the little rectangular chars...its empty (visually) space (see below).
===========================================================
MZÿÿ¸@躴 Í!¸LÍ!This program cannot be run in DOS mode.
===========================================================
Here is some code:
// Open the file to be read
if( cfEnFile.Open( LPCTSTR(csFileName), CFile::modeReadWrite | CFile::typeBinary, &e ) ) {
// Get the length of the file
DWORD dwSize = cfEnFile.GetLength();
cfEnFile.SeekToBegin();
// fill the buffer with the information from file
UINT nBytesRead = cfEnFile.Read( szBufRead, (UINT)dwSize); //(UINT) dwSize );
...
...
...
for (int n=0; n<(int)nBytesRead; n++) {
CString csEnByte = szBufRead[n];
m_AESCrypt.TransformString(csRegUPPRead, csEnByte);
csBufBytes += csEnByte;
}
sprintf(szBufWrite, "%s", csBufBytes);
cfEnFile.SeekToBegin();
// Write the buffer to the file
cfEnFile.Write( szBufWrite, (UINT)dwSize);
}
Is there anyone who can help!!!!!
Thanks in advance!
Dan
|
|
|
|