|
Hi,
I need to delete files that are in use.
I can´t restart my computer or neither exit programs that are using them. Any suggestions? Need to work on NT/2000 server.
/Ola Carlsson
|
|
|
|
|
|
SHFileOperation, I think it can do that ...
Max.
|
|
|
|
|
That reminds me of a question:
How can one determine the process(es) by which
the file is in use? It's be nice to have a little
utility that reports who has what files open.
|
|
|
|
|
Scott H. Settlemier wrote:
How can one determine the process(es) by which
the file is in use?
http://www.sysinternals.com/[^]
Has just such a utility
|
|
|
|
|
Dear all,
I need to use INetCfg COM interface.
so I import it's dll in my project
#import <netcfgx.dll>
but got the following error:
/////////////////
fatal error C1083: Cannot open type library file: 'netcfgx.dll': Error loading type library/DLL.
////////////////////
I can find this netcfgx.dll under the WINNT/system32/
Need Help!
Laura
|
|
|
|
|
Try with #import "C:\\WINNT\\system32\\netcfgx.dll" .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
still doen't work
any other idea?
|
|
|
|
|
Here are some other examples. Not sure what you need exactly.
#import "EventSrc\Debug\EventSrc.dll" no_namespace named_guids
#import "..\Bin\SystemCPU.dll" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\MSO97.DLL" raw_interfaces_only
#import "..\DemoCallback\debug\DemoCallback.dll" named_guids raw_interfaces_only
#import "..\Server\ES.tlb" no_namespace, named_guids, raw_interfaces_only, raw_native_types
#import "c:\Program Files\Common Files\System\ADO\msado15.dll" no_namespace rename("EOF", "EndOfFile")
Todd Smith
|
|
|
|
|
It is not the attributes but the dll itself cannot be opened.
( I tried differenct attributes, still doesn't work)
|
|
|
|
|
If i write this:
char *szFileNameOnly[999];
will all the char pointers be initialized to zero or do i have to do that myself?
Thanks
|
|
|
|
|
you will have to do that yourself. C/C++ doesn't initialize anything for you (unless it has a constructor, or if you're in debug mode using MSVC's compiler).
-c
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
Gosh, you typed faster than me
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
|
Come on, add to my frustation
PS: Excellent strings tutorial.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You have to do it yourself.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You should always initialize variables when declaring them.
Max.
|
|
|
|
|
C++ doesn't automatically do it for you, but it does have easy ways for you to do it. This statement will cause all the pointers to be initialized to zero:
char *szFileNameOnly[999] = {0};
Chris Richardson
|
|
|
|
|
Thanks for you advice. Can this also be done when the variable has already been declared? If so, how? Cause I'm getting an error when trying to do it.
|
|
|
|
|
If you want to zero all the pointers after the variable has been declared, you can use memset:
memset( szFileNameOnly, 0, sizeof( szFileNameOnly ) );
Chris Richardson
|
|
|
|
|
I have a COM DLL built with VC++6 and it has dialog resources using activex controls such as MsFlexGrid and CTreeCtrl etc.
I have two main applications(AppSimple and AppWithLotOfDlgResources) that can use this dll.
When I use AppSimple to call this Dll, it works fine both in Debug and Release modes.
The problem is when I use AppWithLotOfDlgResources application as the calling program, I am getting "Unsupported operation" only in RELEASE build.
Q. Is there some kind of a conflict in resources between the DLL and the AppWithLotOfDlgResources ?
Please help
Thanks
|
|
|
|
|
When I do stuff like:
POSITION pos = pDoc->GetFirstViewPosition();
while (pos!=NULL)
{
CView* pView = pDoc->GetNextView(pos);
I dont have the second view created or instantiated. Yet the code still works. Is this weird? Does the doc automatically know which views it has even if I dont do:
pChild = (CMDIChildWnd*) pTemplate->CreateNewFrame(pDoc, NULL );
if( pChild == NULL ) return FALSE;
pChild->MDIActivate();
pTemplate->InitialUpdateFrame( pChild, pDoc);
on it? (I do the createframe when I switch views). Am I creating the view here? I've used the first snippet even when the second snippet has not been executed..and it works
Appreciate your help,
ns
|
|
|
|
|
here's my OPENFILENAME struct:
char szFileNames[(MAX_PATH+1)*1000+1];
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = ghWnd;
ofn.hInstance = ghInstance;
ofn.lpstrFilter = "All Files (*.*)\0*.*\0";;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = NULL;
ofn.nFilterIndex = 1;
ofn.lpstrFile = szFileNames;
ofn.nMaxFile = (MAX_PATH+1)*1000+1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = NULL;
ofn.lpstrInitialDir = "C:\\";
ofn.lpstrTitle = "Open File(s)";
ofn.Flags = OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_ALLOWMULTISELECT | OFN_EXPLORER | OFN_NODEREFERENCELINKS | OFN_NONETWORKBUTTON;
ofn.nFileOffset = NULL;
ofn.nFileExtension = NULL;
ofn.lpstrDefExt = "*.*";
ofn.lCustData = NULL;
ofn.lpfnHook = NULL;
ofn.lpTemplateName = NULL;
ghWnd is a valid handle to my main window and ghInstance is also a valid handle to my apps memory block
When i run the GetOpenFileName function it returns false, and a call to GetLastError returns "invalid parameter", what am i doing wrong?
Thanks
|
|
|
|
|
Hi,
I am using VC++ 7.0 and am trying to load an icon, which I have as one of my resources, into my button. The button is created dynamically.
Here is the code that I have:
button->Create("SMS", WS_CHILD | WS_VISIBLE | BS_FLAT | BS_ICON,
CRect(0,0,0,0), &m_wndStatusBar, IDC_BUTTON_STATUS_BAR);
button->SetIcon(::LoadIcon(NULL, MAKEINTRESOURCE(IDI_ICON1) ) );
This does not seem to work. I know it worked in VC++ 6.0.
Can anyone help me out here?
Thanking you in anticipation
Rui
|
|
|
|