|
I'm looking for a way to find matching regions in a file - much like the LCS (diff) algorithm, but optimized for moved data. For example in the two strings below:
"milk and coffee"
"coffee and milk"
LCS will only find a small matching region, " and ", while the strings themself have larger matching regions. Currently I'm using a "sliding windows" approach (similar to rsync) to do this, but it gets a bit slow for large files.
Any suggestions or references would be welcome - I'm looking for both heuristics and algorithms. Im also looking for traditional diff heuristics...
/Thanks
moliate
The corners of my eyes catch hasty, bloodless motion -
a mouse?
Well, certainly a peripheral of some kind.
Neil Gaiman - Cold Colours
|
|
|
|
|
Hi everyone!
I have a really silly one. Every time I close my application it ends incorrect.
In Release mode everything looks fine (some machines are showing an error, but currently not - even with the same version that did before!), but the closing is still incorrect. This means I can set an AfxMessageBox after the DoModal call in the main file for the dialog, and you will only hear the beep of the box, but the app is already gone and the box is not shown.
Unfortunally Debug mode brings no further information either!
You hear the error sound from Visual Studio debugger, but no stop or message from the debugger itself. So I can still not find out what exactly happens there! (Only the debug information about the last running thread exiting correctly with code 0, and that the program ending with code 3)
My project is already too big to give some code snippets, because it includes additional threads, "sticked" dialogs, toolbars, etc... And since I did not realize the problem early enough I could not just easily tell you what thing was included last, or how long (or already from the begin on?) the bug exists.
So finally the question: Can I set up the VS Debugger to stop in any case, even if the error is caused in some control or dll? I'd just like to know where I could start searching or what part of my app creates this problem.
Or is there some different solution to find the problem? Some free debugger? What is a typical error so the debugger brings nothing up? Any help wanted!
Thanks in advance,
Roland
|
|
|
|
|
Roland E. wrote:
This means I can set an AfxMessageBox after the DoModal call in the main file for the dialog, and you will only hear the beep of the box, but the app is already gone and the box is not shown.
This is a very common problem. The solution can be found here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Wooowdy, I love you!
You have been a real big help, it worked immediately and then I found a small bug in this never finalized end.
Again, thanks a lot!!! I wonder why I never heared about this strange behaviour...
Roland
|
|
|
|
|
hello,
I am trying to make a hookless kwylogger but I am having a
little trouble:
I am trying to use these api calls to be able to get
keyboard data from other processes:
//Attach
AttachThreadInput( MyThreadID, TargetThreadID, true);
//Detach
AttachThreadInput( MyThreadID, TargetThreadID, false);
All I do is set a timer that looks for the forground window,
get's its process ID and attach my process to it's input
queue. Then I just poll for keystrokes using
GetKeyboardState.But here I have a problem:
You see, If I was in a hook dll I would do this:
BYTE ks[256];
GetKeyboardState(ks);
scan=0;
ToAscii(wParam,scan,ks,&w,0);
but then again I'm not
so where do I get the wParam from?
Or how do I know exactely wich key has been pressed?
Don't tell me you have to try out all the possible VK codes
cause that is lame. Is there another, smarter way to do
this?
|
|
|
|
|
Have you considered using a non-exclusive DirectInput device with DirectX?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
no I haven't cause I don't know how
what's wrong with the method I wrote above?
|
|
|
|
|
As you said, you'd need to attach keyboard input to every thread you come across, and poll it with a timer, and then check all various keys whether they are pressed or not. You wanted a smarter way, so I gave you one.
Setting up DirectInput will take you about 30 minutes, it's really that easy
Take a look at this tutorial:
http://www.gamedev.net/reference/articles/article1309.asp
modified 12-Sep-18 21:01pm.
|
|
|
|
|
This is me also but I didn't bother signing on cause my net is running really poorly.
Ok, but I woun't have to carry any directx dlls and stuff with me will I ?
I mean what if some man doesn't have directx installed on his comp what then?
|
|
|
|
|
You don't need to carry any DLLs with you - every computer using Windows 98 or later has the nessesary DirectX DLLs already "on board".
Check this site:
http://www.computerhope.com/directx.htm
I'd suggest you using the DirectX 5/6 headers - there hasn't changed much in DirectInput up to Version 9, so you should be safe using the DX5/6 headers
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I cannot get the code sample "VCTerm" in VC++ 5.0, found at: DEVSTUDIO > vc > samples > mfc > general > vcterm, to work on any other computer that has not had VC++ 5.0 installed. I do not have a great deal of programming experience, but I found that the problem occurs in mainframe.cpp. The problem piece of code that fails is listed below, and the call to the section of code in commctrl.h is also listed. Any help would be appreciated.
John
mainframe.cpp
{
.
.
// Create the MSCOMM32 OLE Control.
if (!m_commctrl.Create(NULL,0,CRect(0,0,0,0),this,ID_COMMCTRL))
{
TRACE0("Failed to create OLE Communications Control\n");
return -1; // fail to create
}
.
.
}
commctrl.h
{
.
.
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0x648a5600, 0x2c6e, 0x101b, { 0x82, 0xb6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }
BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey); }
.
.
}
|
|
|
|
|
|
..Get a program to run when Windows start
Valie
|
|
|
|
|
1) put a shortcut to your file into the autostart folder
2) create a key unter the "Run" key in the registry, see this link for more information
3) write a service
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Reccamended methods
HKLM\...\Run
HKLM\...\RunOnce
HKLM\...\RunServices
HKLM\...\RunServicesOnce
HKCU\...\Run
HKCU\...\RunOnce
Other methods
add a line in autoexec.bat
add a value to the key "load" or "run" in win.ini
set the shell to "Explorer.exe path/to/your/exe" // a bit on teh dangerous side for less advanced users
add a line to tmpdelis.bat
set it as a scheduled task
|
|
|
|
|
you forgot the start folder in the start menu
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi all:
I have a titleless dialog(without a caption bar for some reason) which has the WS_EX_APPWINDOW style.
When I clicked the minimize button, this dialog does positioned at the
sys taskbar. But what makes it not so good is it doesn't have caption
when It appears in the sys taskbar.
How can I get a caption at the sys taskbar(still does't
have caption bar) when It minimized or maximized?
Furthermore, When I click the dialog at the sys taskbar consecutively,
It seems not responding well, it only get minimized. Which should be
get maximized and minimized correspondingly.
|
|
|
|
|
Try calling SetWindowText() on your dialog. The argument passed to this method should appear as the title when the dialog is minimized.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi all:
I used the DrawText() to output several lines of text within a rect, but with the font I created
VERIFY(m_Font.CreateFont(<br />
12,
0,
0,
0,
FW_NORMAL,
FALSE,
FALSE,
0,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
PROOF_QUALITY ,
DEFAULT_PITCH|FF_SWISS,
_T("Arial")));
the text appears two crowded vertically, I know with a internal leading, the text can be looked good. But the question is how to add a internal leading?
|
|
|
|
|
Hi, I 'm trying to link my application with a dynamic library but I have some problems. I use VS .NET 2003. I 've downloaded a third party dll library and what I do is to include the required .h files and place the dll file in my project's directory. However I get a linking error that the function I 'm calling is an unresolved symbol. Do I need to do sth more? For example for .lib files I had to add the dependencies in my project's properties. Do I need anything like that with dlls?
Thanks and happy new year,
Themis
|
|
|
|
|
try using #import
or better
use LoadLibrary and GetProcAddress
to get function pointers
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Hi.
I want to write a server client program that will work like telnet
but i don't now how to redirect the result of the the WIN32 API function system to the client socket...
do i need to redirect only the stdout ?
if so how do i redirect it so each client heve it one stdout ?
|
|
|
|
|
Perhaps these articles may help:/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
sorry , i am new person with visual c++.
my question is how to run/load file .exe using visual c++?
for example if i have file "features.exe" ..then i make a button (MFCapp wizard dialog based)..i want when i click this button then fle features.exe will be run/loaded
thanx
|
|
|
|
|
|