|
Hi Mike,
thanks for the hint. I have already tried this, but this tool only lists the open handles on the local machine.
Best regards,
Oliver
|
|
|
|
|
this tool only lists the open handles on the local machine.
OK. How about "EnTeHandle" at either CodeGuru or this page?
|
|
|
|
|
This is an interesting site you're pointing me. But it still won't solve the problem, because the processes locking the DLL are not running on the local machine. They're running on other machines connected to the network.
EnTeHandle works somehow like this: MyMachine->AnyHandles->MyFiles. But I am looking for something like this: MyFile->AnyHanldeToItLocatedOnAnyMachine->NameOfTheseMachines.
Best regards,
Oliver
|
|
|
|
|
Ahhh, NOW I get you (and feel like a complete idiot for misunderstanding you so completely - I obviously believed you wanted to program a solution based on the forum).
The solution is simpler than I anticipated!
Have a look at Server Manager (remote connections or whatever it's called - MS changes names for this for every new OS release). It can tell what files are opened by what other remotely connected machines (assuming you're using the MS SMB server here). You can't say what user uses it, but you can both see what machine has it locked, and "kick" that machine so you can replace the DLL.
At least this was available in everything up to and including NT4. In NT5 I think it's in Computer Management under Shared Folders/Open Files.
But if you want to do this using programming you're basickally f***ed. The SMB server is undocumented.
Sorry for my/the confusion.
/Mike
|
|
|
|
|
You could have your program run its own copy of the file on the clients machine. Then have your program automatically check for new version when running and copy the the new DLL's over when available.
Todd Smith
|
|
|
|
|
CRect rect;
int x;
int l;
int y;
BSTR string = NULL;
pPopupMenu.CreatePopupMenu();
GetWindowRect(&rect);
x = rect.right < 0 ? 0 : rect.right;
l = rect.left < 0 ? 0: rect.left;
if ((x-l) > 700)
x = (l+x) / 2;
y = rect.bottom;
CMenu pPopupMenu;
pPopupMenu.CreatePopupMenu();
iStatus = pPopupMenu.AppendMenu(MF_STRING, WM_USER, L"Option1");
iStatus = pPopupMenu.AppendMenu(MF_STRING, WM_USER, L"Option2");
iStatus = pPopupMenu.AppendMenu(MF_STRING, WM_USER, L"Option3");
iStatus = pPopupMenu.AppendMenu(MF_STRING, WM_USER, L"Option4");
iStatus = pPopupMenu.AppendMenu(MF_STRING, WM_USER, L"Option5");
iStatus = pPopupMenu.AppendMenu(MF_STRING, WM_USER, L"Option6");
iStatus = pPopupMenu.TrackPopupMenu(TPM_RIGHTALIGN | TPM_LEFTBUTTON,
x, y, m_hWnd);
iStatus = pPopupMenu.GetMenuString(1, string, MF_BYPOSITION);
Can someone tell me how to get the the position the cursor is on? I need to get which option was chosen.
Forever ignorant,
Lilian
|
|
|
|
|
You don't really need too keep track of the mouse pointer location. Add a command handler for WM_COMMAND and the selection will be sent there. Of course you'll have to set different IDs to AppendMenu(MF_STRING, WM_OPTION1, "O1") . These IDs will be sent in the WPARAM (?) to your command handler.
|
|
|
|
|
The value of iStatus will be the ID of the selected item, or 0 if he mehu was aborted
so
if (iStatus != 0)
iStatus = pPopupMenu.GetMenuString(iStatus, string, MF_BYCOMMAND);
Should do the trick
You also need to add each item to the menu with a unique ID
iStatus = pPopupMenu.AppendMenu(MF_STRING, WM_USER, L"Option1");
iStatus = pPopupMenu.AppendMenu(MF_STRING, WM_USER+1, L"Option2");
Roger Allen
Sonork 100.10016
yet to be identified being from the planet Paltinmoriumbanfrettybooter
|
|
|
|
|
Thanks for the help, y'all. I got something working using the message handler.
|
|
|
|
|
Does anybody know how to create custom form sizes under Win9x. Under NT based versions of windows you can use the function Win32 API function AddForm().
Also does anybody know the correct way to retrieve the handle to a printer that you pass to AddForm(). At the moment I enumerate the available printers and then open the first one retrieved. This works but it seems like a bit of a bodge. Alternatively you can use AddPrinter() to get a handle but you need to know the name of an installed printer driver eg. Generic / Text Only will only work if already installed on the machine.
Thanks in advance for any help you can give.
Steve.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Hi guys:
We are using COleDataSource for drag&drop between two CTreeView. That's ok.
Problem is multiple selection of items. How can we do this?
Thanx 4 all.
|
|
|
|
|
I'm currently writing a very simple HTML colour highlighting Rich Edit control extension (inheriting from CRichEditCtrl).
The control works perfectly in a debug build, behaving exactly as designed. However, in a release build no colourising takes place.
As a background the following code is used to get a particular line of text from the control to parse it:
CString strLineText;
int nRead = GetLine(nLineIndex, strLineText.GetBuffer(1024));
strLineText.ReleaseBuffer(nRead);
The line index is specified a sa parameter to the function. In the debug build this works fine. But in the release build, for some reason, GetLine returns 0 and strLineText is empty This means that the rest of the code has no text to work on and so nothing is colourised.
In case you were wondering, yes the text is actually there, it's just that GetLine isn't supplying it.
The text has been added using a CString member variable i.e.:
m_strHtml = _T("Some really long html file that runs over several lines");
UpdateData(FALSE);
m_ctrlRichEdit.ParseAllLines();
I have also tried using ReplaceSel , SetWindowText , and I've even tried using the clipboard. All approaches have the same effect.
Any thoughts?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
That is a funny one.
Is your GetLine method overridden? If so, check for obvious things like the method not being wrapped in #ifdef _DEBUG statements. Otherwise, try stepping into the statement (F11) to see exactly whats going on.
Failing that, I dunno, try using EM_GETLINE ??
Dylan Kenneally
London,UK
|
|
|
|
|
I haven't overridden GetLine . The only things it handles are ENM_CHANGE (registered using SetEventMask in PresubclassWindow and OnCreate ) and WM_CHAR .
Whilst trying to debug the problem I added several OutputDebugString calls in the OnChange handler. Bizarely enough if I output the window text in this call, the colourising succeeds becuase GetLine returns the correct text. I tried outputing smaller amounts of text thinking it may be timing related and found that it wouldn't work with anything less than half of the control text.
Even more bizarrely, following on from the timing thoughts, using Sleep or SetTimer to reparse the text after a specified time interval didn't work either. Even waiting for as long as 5 seconds.
It's really weird
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
I did a colorized java editor using a CRichEditCtrl a while back. It is of course just a dirty ol' hack , but if you want to have a look at it I can mail it to you.
|
|
|
|
|
You probably won't want to hear this... but I would advise you not to use the rich edit control for something complex like this (if it's part of a serious product that is).
We based our software product around this control and live to reget it.
It is quite buggy and as it is a part of the OS you don't have total control for distributing it with you App.
|
|
|
|
|
Hi all,
running my application under debug sometimes I receive this message "User Breakpoint called from code at 0x77f9f9df". When I run the application without debug the message is "...unknown software exception (0x0000003) in application at 0x77f9f9df".
The same error occurs when I press F12 running my application under debug.
My environment is Win2000.
Anyone know what it means, there is a solution?! Helpme please!
thanks and sorry for my poor english.
|
|
|
|
|
A 'user breakpoint' is an exception of your application. Probably, your exception should be an inconsistent pointer reference.
Debug your application, and concentrate your attention to your pointer values.
Regards,
---------------------
Pere Llibre
Software Engeneering
|
|
|
|
|
If I try to debug my application the error doesn't occurs!
|
|
|
|
|
XAlien wrote:
If I try to debug my application the error doesn't occurs!
That's the mystery of software development
Regards
Thomas
Finally with Sonork id: 100.10453 Thömmi
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
Hi all,
From an exe called "whatever.exe" I call loadlibrary like this
HMODULE h_mod = LoadLibrary("mttool32.dll")
I receive a NULL value in h_mod. This is strange because whatever.exe resides in the same location as mttool32.dll and according to the docs LoadLibrary should search in the working/current directory.
I works fine calling it with an absolute path but I don't want to restrain my users to a specific location.
Any ideas why this is?
/Tommy
|
|
|
|
|
are you running your app from the dev environment (in debug or release mode) ? if you are the directory isnt what you think it is
just a thought
---
"all's fair in love and war but in love there's no geneva convention"
|
|
|
|
|
Hi Lauren,
In what way is the directory not what I think...? I tried to use LoadLibrary("mttool32.dll") both in Dubeg and Release mode and none of them works. But in both Debug and Release mode it works when supplying an absolute path... how come the directory is interpreted correctly just because the path is absolute?
I really need the relative path to function properly since people can install my software where ever they like... and having a hard coded path in my app is not a good thing... Well, good is mild; disaster I would call it.
/Tommy
|
|
|
|
|
Try pasting your DLL to the parent directory of both the Debug and the Release dirs.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi Tommy,
The working directory will not always be the directory where the exe exists. When you run it from Visual Studio, the working directory will be the parent directory of the debug/release directories.
Use GetModuleFileName to get the path of your exe, remove the filename, add your dll name and voila, everything is fine again
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|