|
You are programming for DOS. What is that?? Just kidding. I have not worked with a complier that would produce DOS code in the last 7 years... The stuff about _getch() that Xander80 said should work in dos.
John
|
|
|
|
|
I am maintaining a service that uses ReadDirectoryChangesW() calls to monitor a set of directories. When a file is dropped (or pasted or copied) into the monitored directory the service detects the new file and processes the new file.
I want to make sure the file is "all there" before taking any action on the file. Currently the service does a "_stat" call to get the file size and then tries an "_sopen" to make sure it is accessible. If either call fails it performs a set of retries.
Occasionally this setup fails. For example, a set of three files are being pasted into the monitored folder and the service fails reading the first file. When I check the folder...none of the files are there!!! Not sure, but somehow the Explorer copy/paste operation is being halted by the file tests. Any ideas? Is there a better way to see if the pasted file exists and is available?
PS: The copy/paste is being done between a local drive and a mounted network drive.
Jack
|
|
|
|
|
1. I use GetFileAttributes() to determine if a file 'exists'.
2. There are 'known' issues with _sopen and network drivers. Especially caching problems. I think you should use a Win32 API instead for checking for the ability to open the file. Look at CreateFile and the flag OPEN_EXISTING.
C++/MFC/InstallShield since 1993
|
|
|
|
|
Blake,
Thanks for the reply! Do you think that the symptoms I am seeing could have to do with the 'known' issues? Any idea where to get more info on those issues? (any docs out there? what criteria might I search the web with?)
I will give the CreateFile a try. Any suggestions on what flags to use? Should I loop with a set of retries in case the file is still being transferred?
Thanks again!
|
|
|
|
|
Hello, how can I allow a CRichEditCtrl to copy/paste "normal text" e.g. from a CEdit-Control?
|
|
|
|
|
If you just want to add such a popup menu showing cut, copy, paste etc., see this article: http://www.codeproject.com/richedit/popupdemo.asp[^]. This way you can make your own context menu.
To programatically copy/paste something into the rich edit control, see functions CRichEditCtrl::Copy and CRichEditCtrl::Paste .
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hello ,
Iam developing a Secure browser .The secure browser needs to capture the events in an HTML Page and execute a DLL function.One way is to capture it in HTML page thru on-click handlers and call the DLL function from the HTML event handler( thru Java script).But this is not required .
What i need is to capture HTML page button clicks by the vc++ app which launches the HTML page .Iam using internet explorer's functions to display the HTML page .
|
|
|
|
|
Hello,
I'm sorry if I've already posted this message. I'm having some issues with posting. I'm developing an app on Windows 2000 using Visual .Net. It works fine on Win 2000, but I bring the app over to a PC running XP and it tells me I'm missing DLL's!!! Just as a test, I wrote a simple hello world program, and I still get the same error. I've tried the app on severl different PC's running XP and get the same error. What's going on? Is it an operating issue? Or is there something wrong with my .Net settings??? Thanks. Please reply to ttran7700@yahoo.com
|
|
|
|
|
ttran7700 wrote:
it tells me I'm missing DLL's!!!
Which ones?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
It says it is missing msvcr70d.dll and msvcp70.dll. I've tried copying them and placing them into the systems folder on the XP, but it still can't seem to find them. Doesn't 70 refer to .Net 2002 and 7.1 refer to .Net 2003? Thanks for the help.
|
|
|
|
|
msvcr70d is obviously a debug library. I wonder if he tried to build a release.
Sincerely yours, Ilya Kalujny.
|
|
|
|
|
Do you have the compiler installed on all these XP machines?? The complier installs many DLLs that are not system DLLs.
John
|
|
|
|
|
It says it is missing msvcr70d.dll and msvcp70.dll. I've tried copying them and placing them into the systems folder on the XP, but it still can't seem to find them. Doesn't 70 refer to .Net 2002 and 7.1 refer to .Net 2003? Thanks for the help.
|
|
|
|
|
msvcr70d.dll is a debug library, and is part of the .NET install.
Try building the program as a non-debug version.
OR install .net on the other machine.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
|
That's the funny thing. I tried installing Visual .Net on the XP machine and get the same error. Is there such a thing as msvcr71d.dll? I mean Visual Studio (the latest) is 6.0, Visual .Net is 7.0. Is there a Visual .Net version 7.1. Thank you for the help.
|
|
|
|
|
We've already tried installing the Visual .Net on the XP machine. It did nothing for me. It suggests that I re-install .NET I don't know why should even need .Net to run the app. I don't expect to need Visual Studio to run Word on my PC. This is simply too strange. Thanks for all the help.
|
|
|
|
|
For support of tracking CWnd window I use the following sequence.
At the first display on a window.
1. I store a window's rect where will be located CWnd window to a bitmap .
2. I draw CWnd window.
By tracking
1. I restore the bitmap on the same place, where I stored it
2. I store a new window's rect to a bitmap.
3. I draw a new window.
To hide a window
1. I restore the bitmap on the same place, where I stored it
At such construction I see blinking by moving of a window though I do all restores and displays on memory context (CreateCompatibleDC ).
In what the reason and whether is a easy way to tracking?
If I track a window with MoveWindow() function then blinking is not present. But in this case I cannot support myself drawing at moving a CWnd window (for example simultaneously with moving to apply fade-in effect).
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hello,
I want to write an application in Visual C++ that can control an existing windows application, send keystrokes of any kind to an application. Control it as if you were sitting at your keyboard and hitting a hotkey. simulate mouse movement and left, right or middle mouse button clicks. By setting the cursor position to the location of an application's button and clicking the left mouse button - both with a single remote control button - it is even possible to control stubborn apps which do not support messages or hotkeys properly
Can anybody point me in the right direction.
Thanks
|
|
|
|
|
leary wrote:
send keystrokes of any kind
VOID keybd_event(
BYTE bVk,
BYTE bScan,
DWORD dwFlags,
DWORD dwExtraInfo
); or (on NT)
UINT SendInput(
UINT nInputs,
LPINPUT pInputs,
int cbSize
);
leary wrote:
left, right or middle mouse button clicks
VOID mouse_event(
DWORD dwFlags,
DWORD dx,
DWORD dy,
DWORD dwData,
DWORD dwExtraInfo
); or (on NT)
UINT SendInput(
UINT nInputs,
LPINPUT pInputs,
int cbSize
);
leary wrote:
setting the cursor position
BOOL SetCursorPos(
int X,
int Y
);
Hope that helps
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Thanks,
hopefully this will get me up and running.
|
|
|
|
|
Hello!
I am working with views in sizeable dockin control bars (example http://www.codeproject.com/docking/dockview.asp)
but this is not really my problem.
What i need is to dynamically change the size of the underlying View-Class (CFormView) - In this example, the Size of the View is defined by the size of the Resource.
I tried to do this with the MoveWindow()-Funktion - but this cannot work, since this operates on the displayed window.
I need to create Controls dynamically and resize the view - so all controls can be displayed. The size of the displayed window should stay the same - only the scrollbar-ranges should chang as a reaction to the new size.
a million thanks if anybody can help me.
|
|
|
|
|
Hello Again!
I have now found a way to accomplish this. Maybe there are other ways, but I am very new to the MFC Framework (in fact, this project is my first work with MFC and the MDI)
I have changed the members CScrollView - Data Members
"m_totalLog" and "m_totalDev" with my new SIZE-Struct and Called the
OnSize() method of CScrollView to reflect the changes.
Now I can position new Elements on my view dynamically.
Anyway - maybe someone knows a better way, or find this information useful.
greetings from Austria
Martin
|
|
|
|
|
I have a SDI application with the view class derived from CRichEditView. The following code behaves different on one of of our machines:
long posError=0;
FINDTEXTEX text;
text.lpstrText="Error (";
text.chrg.cpMin=0;
text.chrg.cpMax=-1;
posError=GetView()->GetRichEditCtrl().FindText(FR_MATCHCASE|FR_WHOLEWORD, &text);
if(posError!=-1)
{
DoSomething...
}
On most machines it works fine and finds the lines containing "Error(" but on one machine it only works when I don't use the FR_WHOLEWORD flag in the FindText function. I never came across this problem ever before and can't imagine any reason for that. I'm "at the end with my latin" as we say in german. Does anybody have an idea ???
MS
|
|
|
|
|
Hi
I'm programming a plugin for an application, and I want to subclass the WindowProc of the main window to receive its messages and then forward them to the main window.
this is what I currently do:
WNDPROC pOrigProc = (WNDPROC)SetWindowLong(wndMainForm, GWL_WNDPROC, (LONG)HookWndProc);
This works, the WNDPROC will be redirected to my WindowProc:
LRESULT CALLBACK HookWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_MOVE:
MessageBox(NULL, "WM_MOVING", "", MB_OK);
return 0;
break;
case WM_SYSCOMMAND:
if(wParam == SC_MINIMIZE)
return 0;
break;
default:
break;
}
return CallWindowProc(pOrigProc, hwnd, uMsg, wParam, lParam);
}
For some reason, neither the message box appears, nor will the main window be prohibited to me minimized, although I don't redirect the WM_SYSCOMMAND-message (return 0). But the windowproc itself gets called. So what's wrong here?
regards
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|