|
hi,
I think you need to synchronize your access.Give more detail so that I may help you.
joey_tribbiani
|
|
|
|
|
thank you for your concern.
Let's suppose that two customers visited my shop.
They look around my shop and purchase goods they need.
each of them goes for accounts , one to left and the other to right.
each of the two accounters processes his transaction ; updates mileage of the customer,
updates the left of each item, records details of sales, and so on.
in this situation, one host, client , could access the same database file to which server accesses at the same time.
that's all. please, help me.
i'm not apt at english.
|
|
|
|
|
You need to use transactions to ensure the integrity of the database. If you are using MFC database classes, see CDatabase::BeginTrans(), CDatabase::CommitTrans() and CDatabase::Rollback(). Also, check that the relationships between the tables are correctly (and completely) defined in Access.
|
|
|
|
|
I want to find the sourcecode of a ActiveX control from VC and MFC.
and the control with print interface.
Thanks.
Where can I get it?
|
|
|
|
|
How to set options in-order to create the application with minimum size ?
|
|
|
|
|
Go to
"Project | Options" in the VC++ menu
Go to the "C/C++" tab
Under "Optimizations", select "Minimize Size"
-- Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Hallo everyone,
I am a student and have to make a little program in Visual C++ that launches an “event” on a certain date and time.
A good example are the programs who save birthdays and launches them on a predefined date and hour or the programs who launches a certain program on a certain date and time. A sort of schedular.
Is there someone who has the source code for such a program, so I have a little example.
I would be very gratefull !
Tom Crauwels
You can reach me at :
Danny.crauwels@pandora.be
|
|
|
|
|
Use GetSystemTime to know the time, use OnTimer to check at a regular interval and use ShellExecute to run your other program.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I have searched and searched, but I cannot find anything about implimenting jscript or vbscript into C++.
|
|
|
|
|
Did not exactly understand the question.
Do you just want to call VBScript or JScript code from external files to be run for VC++ code or
Do you want to pass parameters and get return values?
-- Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Why not use a server-side scriptlet? This will enable your JavaScript or
VBScript to the accessed exactly like a COM object
Search for "Server Scriptlets" in MSDN.
There is an article by Dino Esposito that deals with it.
-- Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Hi all,
The service I'm writing (i.e., a console app) needs to load resources from its exe file- is this possible? How do I get the HINSTANCE of the module?
Cheers,
NickB
|
|
|
|
|
Use the line:
HINSTANCE hInstance = ::GetModuleHandle(NULL);
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Use the line:
HINSTANCE hInstance = ::GetModuleHandle(NULL);
modified 29-Aug-18 21:01pm.
|
|
|
|
|
thanks,
looks like I should have found that one
nb
|
|
|
|
|
I need to have a loop of code that will be executed for between 1/20 of a second and 1/4 of a second (I'm not sure of the exact time yet)....thus I need to be able to time miliseconds....any ideas?
|
|
|
|
|
Use the GetLocalTime before and after the loop
The difference in the times will give you the difference in milliseconds.
Another way that I use to increase the accuracy is to run the same exact loop 1000 times in a loop. So the time taken can be calculated to the accuracy of microseconds.
I do not know, whether this is the answer that you are looking for, but I hope this helps you.
-- Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
timeGetTime returns a time in milliseconds.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
while (condition)
{
//your code
Delay(time_in_mili);
}
|
|
|
|
|
I'm writing some data to a CStdioFile in a loop, and my program gets through the loop but gives me an error when I close the dialog, saying "hard disk full while writing to file". The file is blank.
I know the hard disk is not ACTUALLY full, so is this caused by a memory leak somewhere in my code?
A possible cause would be a loop where I read from a file:
CPerson *p;
while (...)
{
CString name = (read a name from a file)
p = new Person(name);
//should this next line do the job?
delete (p);
}
I'm not a memory freeing guru, so I'm definitely causing some trouble here
How can I get this file written?
thanks,
Jake
|
|
|
|
|
The delete line is definately what you need to free the memory before calling new again, otherwise you'll leak memory for sure. As an aside, it probably dosn't matter directly in this case, but it is *always* a good idea to set pointers you've called delete on to NULL.
Jonathon
|
|
|
|
|
The wrong function is getting called. I believe it goes like this:
class foo {
public:
inline foo() {
bar();
}
virtual bar();
};
class fooplus : public foo {
public:
inline fooplus() : foo() {};
virtual bar();
}
The problem is that when I instantiate fooplus, foo::bar gets called instead of fooplus::bar.
I believe that if you said
fooplus fooinst;
fooinst.bar();
then it would call foo::bar and then fooplus::bar.
I'm trying to use more of the power of C++, but stuff like this is making me want to just use it like C with member functions like I used to.
|
|
|
|
|
I'm working around it by putting everything except the call to the overridden function in a new member function (Init). This way it works, but both constructors have the same code.
foo() {
init(); //foo::init()
bar(); //foo::bar()
}
fooplus() {
init(); //foo::init();
bar(); //fooplus::bar();
}
|
|
|
|
|
You should never call virtual functions within a ctor, the result is undefined.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Is the alternative to say:
pMyThing = new Thing();
pMyThing->Init();
all the time? That would suck.
|
|
|
|