|
hi all!!
i have a small problem. i have designed an application which uses MS-ACCESS to log data. now, my application can be started only by administrator. when i log in as any other user other than the administrator my application will not start. but if i had started it as administrator and then logged in as any other user, it should run. The application no doubtedly runs but the the logging does not happen. i think this happens because, the databse gets closed when i log off as administrator. is there any way that i log off but the database does not close. or any other solution that u ppl can suggest me.
|
|
|
|
|
are you sure, your app is running after logout??
is it a normal windows app? I'm sure, all user-apps are killed on logof.
|
|
|
|
|
my application is interfaced to a driver that i have written. the application is destroyed no doubt. but the driver is not until shut down. so when i log in i re-create the user-land windows application. will event log work in my case instead of database?
|
|
|
|
|
I wrote a service, and this service has some connections to a access-databse and a ms-sql server database... and it works quite well.
so... theoreticly.. your approach should work
|
|
|
|
|
Hello,
Which is better?
ADO by Importing ADODLL and _ConnectionPtr and...
or
DAO
using CDaoDatabase and...
Best Wishes.
Thanks.
|
|
|
|
|
ADO. Better yet, use raw OLEDB.
|
|
|
|
|
Ok, in most of the Open/Save dialogs i see professional programs using it has 5 buttons on the left side (History, Desktop, My Documents, My Computer, and My Networking places)
i am already familiar with how to use the CFileDialog class, but i cant get those buttons to show up, so is just becuase i havn't found the right parameter to add, or does MFC just not offer a template class for that?
|
|
|
|
|
I believe all you have to do is #define _WIN32_WINNT 0x0500 in your stdafx.h file. Just be aware that your app will not work on Win9x or NT4 if you do.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
I believe all you have to do is #define _WIN32_WINNT 0x0500 in your stdafx.h file.
This won't work because the MFC libraries and DLLs have the old size of the OPENFILENAME structure (76 bytes vs. 88 bytes) compiled in.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
You cannot use CFileDialog for this. You must use GetOpenFileName() to get the "Places" bar. Just remember to omit the OFN_ENABLEHOOK flag. Its presence will cause the "Places" bar to not show up.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Does anyone know how to redirect the dial button message in Outlook, so that it will call a custom dialer other than the 'standard' dialer.
Happy programming!!
|
|
|
|
|
Seems you want to introduce a functionality of your own to an existing event handler of a button right ? If i am right you have to write COM based plug ins for Outlook . I did it long back . But a perfect example is available here at CP itself if i remember well. you may search in PlugIn section ..
cheers
regds
dharani babu s
|
|
|
|
|
Hi
I want to write a console based simple application. Which on executing gives the name of all printers that are currently connected to network.
The function to do that is EnumPrinter and it's prototype is as :
BOOL EnumPrinters(
DWORD Flags, // printer object types
LPTSTR Name, // name of printer object
DWORD Level, // information level
LPBYTE pPrinterEnum, // printer information buffer
DWORD cbBuf, // size of printer information buffer
LPDWORD pcbNeeded, // bytes received or required
LPDWORD pcReturned // number of printers enumerated
);
Can any one plz give me exact example of how to do this ?
Thank you
Mahesh
|
|
|
|
|
I dont think an Example is needed here. Just go through MSDN and see what all these parameters are doing. You will get to see the sample values of these parameters as well. However, if you are getting error in a specific argument, then tell us.
And if you are confused how to call an API from VC, its simple . Just call it as a normal function.
Think Negatively, It makes you creative
|
|
|
|
|
What about:
DWORD dwSize = 0,
dwCount;
LPPRINTER_INFO_1 lpPrinterInfo1 = NULL;
EnumPrinters(PRINTER_ENUM_NETWORK, NULL, 1, (LPBYTE) lpPrinterInfo1, dwSize, &dwSize, &dwCount);
lpPrinterInfo1 = new PRINTER_INFO_1[dwSize];
EnumPrinters(PRINTER_ENUM_NETWORK, NULL, 1, (LPBYTE) lpPrinterInfo1, dwSize, &dwSize, &dwCount);
for (DWORD dwIndex = 0; dwIndex < dwCount; dwIndex++)
TRACE("]%s[\n", lpPrinterInfo1[dwIndex].pName);
delete [] lpPrinterInfo1;
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi all,
I want to call a CDAODatabase class from my Regular MFC DLL, I have followed the instruction of Microsoft MSDN. But the following code incorrect run.
Can you help me on it ?
Thanks a lot for your reply.
Tuan
PS : This is my code
extern "C" BOOL PASCAL EXPORT VehicleChange()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CDaoDatabase* connData;
try{
connData = new CDaoDatabase ;
if(connData->IsOpen()) {
AfxMessageBox("The connection has been openned");
}else{
CString strConnect= "ODBC;DSN=FieldTrip;UID=;PWD=;";
connData->Open(_T(""), TRUE,FALSE, strConnect);
}
strSql = "update VehicleInformation set cAacity=11";
connData->Execute(strSql,dbSQLPassThrough);
} catch(CException *e){
connData->Close();
delete connData;
AfxDaoTerm();
return false;
}
AfxMessageBox("success");
connData->Close();
delete connData;
AfxDaoTerm();
return true;
}
|
|
|
|
|
Hello Friends,
What is the advantage of having virtual Destructors?
Bye take care
Neelesh K J Jain.
|
|
|
|
|
We ask this on our face to face interview.
What does a virtual function do? It allows the proper method to be invoked from an related class pointer.
When does a destructor get called? It gets called when the object is destroyed.
Thus what does a virtual destructor do? It allows for the proper destruction of an object given a related pointer.
class A
{
public:
virtual ~A {}
};
class B : public A
{
public:
B ()
{
m_p = new char [50];
}
virtual ~B ()
{
delete m_p;
}
char *m_p;
}
void main ()
{
A *p = new B;
delete p;
}
If the destructor wasn't virtual (A and B), then the code would leak m_p because only A's destructor would be called. When they are virtual, the proper destructor is invoked.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim,
I was going to mention the same thing. I have given a lot of interviews and this question is a most probable one.
Think Negatively, It makes you creative
|
|
|
|
|
for example, you have different objects derived from the same base class, you want to add instances of each of them in a list ( STL ), and your list is of the base class type; when deleting object on the list, you can delete them and the virtual destructor of each derived classes will be called.
( or something to that effect )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I have two questions. First off, is there some control or typical method for displaying hypertext in a visual c++ dialog based program. IE I want blue text with a url behind it that pops up the web browser when the user clicks on it.
Second, is there a way to call a method that does the click without the user having to click on the text. IE If they select a menu item labelled "visit online instructions", what would be the code to call the web browser and automatically link to www.someinstructions.com?
Thank you!
-----------------
http://www.zachcalvert.com
|
|
|
|
|
|
I want to know whether my program can obtain the message that system time is changed
|
|
|
|
|
Yes is can.
*cough*
WM_TIMECHANGE
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|