|
Here is a simple question I have had a hard time finding an answer for. I have a program which reads and writes MS Jet DB (.mdb) files. I want to make sure that the files are not in use by another process, and the the program has exclusive access to the file. Is there a function that I can use to determine if the file is open or not? Or should I use the CDaoDatabase functions to see if it is use? I assume I should test the file to see if it is open. I know CFile will return an error, but is there a way to test if the file is open before it is opened? Thanks for any help!
|
|
|
|
|
John Clump wrote:
Is there a function that I can use to determine if the file is open or not?
I'm sure there is a better way to do this, however you could check for a file with the same name as the database, but with a file extension of ".ldb ". This is file that contains record locking information. It appears when your Access application is open and is deleted when Access is closed. Again I think there is probably a better way to do this, but it is another option.
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
Hi..
I have notices in my application that dialogs are not rendering (being painted immediatly) after creation..
I am creating my dialog, then i manually show the window (via showwindow) but all I get is a taskbar window icon but nothing on the desktop..
can anybody tell me how to forcibly show the dialog or is there something I can wait for (a signal of sometype). ??
Cheers
Chris
|
|
|
|
|
You can force a repaint by doing:
myDialog.Invalidate();
myDialog.UpdateWindow();
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I have an ATL dll in VC7 which I want to pool. Options for this are no longer in the list of options for a new project, and although I've gone multi-threaded, the option is still greyed out. Can anyone provide any suggestions ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I want to perform the Find Target(shortcut operation) on a File/Link, but I can't seem to find any API informaiton regading it use.
Could someone please shed some light on it.
I can find the parent folder etc, BUT I want explorer to naviagte to the File and Select it, just like the Properties->Find Target does.
Thanks
|
|
|
|
|
This is for Visual C++.NET..
Suppose I have two Strings.
String1 = C://files
String2 = data.txt
I want to concatenate the two strings while inserting a character between them, to get a new string:
C://file/data.txt
Here the character is an extra "/".
Once this is done, I would like to convert the new string to a char[20].
Does anyone know how to perform this task?
I would be very grateful..
Thanks
KBL
|
|
|
|
|
If you're using MC++, that's probably a better place to ask, but String s3 = s1 + @"\" + s2; should do the trick. Convert to char[20], I dunno. I refuse to use MC++.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
how would you do it in unmanaged c++. i find that sometimes you can use the same functions..
|
|
|
|
|
In standard C++ you would use the std::string or CString class.
string s3 = s1 + "\\" + s2;
char c[20];
::strcpy(&c[0], s3.c_str());
Something like that. c_str() returns a const char *, if you want a char array declared on the stack, you'd need to use strcpy or memcpy.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
CString String1 = "C://files";
CString String2 = "data.txt";
CString Result = String1 + "/" + String2;
char final_result[20];
if (Result.GetLength() < (sizeof(final_result) - 1)) {
strcpy(final_result,Result);
}
else {
}
Software Zen: delete this;
|
|
|
|
|
please inform me how if possible.
Hastaluego
|
|
|
|
|
One solution is LVFINDINFO structure and FindItem().
Kuphryn
|
|
|
|
|
i am have a project to finish but facing difficulty like follows:
i am makes a sound recording program but buffer problems for making more that 30 seconds of recording.
help me please in how doing run time buffer increase and increment.
muchas gracias
Hastaluego
|
|
|
|
|
hi everybody,
i have a question regarding to event handler.. is it ok to bind multple menu command to a same function? i made a new menu for popup/context menu and some of the menu command is going to have the same functionaliy of the mainframe menu command. i was thinking of sharing the functions among the menu commands.
e.g.
on_command(id_a, onmyclick);
on_command(id_b, onmyclick);
thx in advance, have a nice weekend.
|
|
|
|
|
Yes, that will work fine.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Even better: Let the two menuitems share the same id. Then you don't have two WM_COMMAND mappings.
--
This space for rent.
|
|
|
|
|
Hi,
In one of my programs, I am using DDE in order to run my program as the default program for some type of files. In my CWinApp class I added BOOL OnDDECommand(LPTSTR lpszCommand).
When I double click on the file, everthing works fine if another instance of the program is not running. Double clicking runs the program and calls OnDDECommand. After that, if I do not close the program and double click on other files, everthing works fine again. The problem occurs when I run the program individually. After that, if I double click on a file, OnDDECommand method is never executed. Instead of that, my program gets the focus and the following error message comes out:
Windows cannot find 'my_file_name'.
Make sure that you have typed the name correctly and then try again.
To search for a file, click the start button, and then click Search.
This message is show by Windows Explorer. Not by my program. I dont know what the problem is. If no instance of the application is running, everthing works fine. Also, if i start the application by double clicking on an associated file evething works fine again. This happens only when I run the program without any files given as parameter and then double click on a file.
I am looking forward to hearing for your suggestions. Please advise...
Thanks for any helps in advance.
Kind regards
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
i found a flag that lets me work with numbers in hex:
std::cout.unsetf(std::ios::dec);
std::cout.setf(std::ios::hex);
int x = 45;
cout<
|
|
|
|
|
setf and unsetf are members of std::ios_base and work on all streams.
--Mike--
Friday's GoogleFight results: Britney Spears 2,190,000 - Erica Weichers 23
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Is there any tool for displaying the #include file hierarch? Something like Understand C++, but more stable. I'm going to write such tool this weekend, if there isn't any.
Thanks.
|
|
|
|
|
Doxygen will do something like that although it's probably not what you want.
I wrote a little app years ago to generate makefile depenedencies that you could probably hack to do what you want. Email if you want a copy.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
I encounter a warning, when i debug a programe.
The warning message is "User breakpoint called from code at 0x77f97704".I donot know the reason.
When this warning message appears, VC shows a screen of assembly code to me.Please tell me the reason to cause this warning .
I love sea
|
|
|
|
|
Is VC stopped at a line that says "int 3"?
You've probably hit an assertion somewhere i.e. done something wrong. Bring up the call stack (ALT-7) and have a look at what was going on at the time. If you press F11 a few times, you might be able to switch back to your original source code as well.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Yes you are right. But i donot know what the assembly codes mean.Have you ever encourted this problem?How can i solve this problem.
I love sea
|
|
|
|