|
Have you looked at MoveFileEx(..., MOVEFILE_DELAY_UNTIL_REBOOT) ? There's also the VerFindFile() /VerInstallFile() pair.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi
I tried ShellExecute as suhredayan told me. This works if i use it to open my required webpage. But it is not working for any file operation such as open, edit, print. Please tell me why this is happening. I am working in LAN environment and that file is also on a network drive. Can this situation effect function of ShellExecute.
We Believe in Excellence
|
|
|
|
|
Show us the code snippet that does not work.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
I have a DLL project that I am debugging that is called from an application that I dont have the project for.
I can set breakpoints and debug the dll when it is called, and all that is working fine.
However, what I would like to be able to do is have Visual Studio automatically break whenever code execution enters the dll, no matter what function is called.
Is this possible? This way I can learn quicker what functions are called in the DLL and when. (I didn't write the source code to the application or the DLL and they are large projects.)
Thank you.
|
|
|
|
|
Does anyone remember what option to pass into the MSDEV.exe so that when you build in the IDE it outputs the build time? I can't remember what it is, but I know that it exists because I used to have it working, Googling hasn't been fruitful so far.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
For msdev.exe, you can type /? at a command prompt for help. For cl.exe, you can type /help at a command prompt for help.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yeah that was the first thing I tried, unfortunately I believe this argument is not documented.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
I added a post build step to do this:
date /t
time /t
|
|
|
|
|
I was trying to do this really simply program where I had to compute the net pay for an employee. The user should be asked for the gross pay. Then next, I had to calculate the federal tax as 25% of the gross pay, calculate the netpay, and output the calculations. Below I have what I did, I tried to run it, but it wouldn't, what did I do wrong? If someone has time, just let me know how I can improve it.
//Ch3Payroll.cpp- calculates and displays the net pay
//Created/revised by Jonathan Atkins on February 7, 2004
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main ()
{
//declare variables
double wageRate = 0.0;
double numberofHours = 0.0;
double grossPay = 0.0;
double federalTax = 0.0;
double netPay = 0.0
//enter input item
cout << "Enter wage rate: ";
cin >> wageRate;
cout << "Enter number of hours: ";
cin >> numberofHours;
cout << "Enter federal tax: ";
cin >> federalTax;
//calculate gross pay, federal tax, and net pay
grossPay = wageRate * numberofHours;
federalTax = grossPay * .25
netPay = grossPay - federalTax
//display output item
cout << "Gross pay: " << grossPay << endl;
cout << "Net pay: " << netPay << endl;
return 0;
} //end of main function
Jonathan
|
|
|
|
|
You are missing semicolons after the following lines
federalTax = grossPay * .25
netPay = grossPay - federalTax
|
|
|
|
|
Thank you so much, I don't know how I made such a dumb error.
Jonathan
|
|
|
|
|
hey guys, i'm pretty new to C++ and have a program i'm trying to write. i basically have the .h file done except for the private data members. the project instructions are below as well as what i have of the .h file. i'm sure you guys probably think this is easy but if anyone can do it so atleast i have something to refer to i'd aprecitae it. thanks
Your job is to implement and test this ADT using an array allocated with the new operator in the constructors and de-allocated with the delete [] operator in the destructor. You will find that three data members will be sufficient for the job. At a minimum, you must test each function with enough different arguments to show it works.
You are allowed to define additional helper functions, member functions or otherwise
//---------------------------------------------------------------------------
#ifndef MyStringH
#define MyStringH
//---------------------------------------------------------------------------
typedef char CharType; // Allow for other character types
class String
{
public:
// Constructors and Destructor
String( int capacity = 50 ); // Make empty String with given capacity
String( const String & str ); // Copy str
String( const CharType * str, int capacity = 50 ); // Make str a String
~String();
// Queries
unsigned Length() const { return count_; }
bool IsEmpty() const { return (count_ == 0); }
bool IsFull() const { return count_ == capacity_; }
int IndexOf( const String & str );
String SubString( unsigned start, unsigned count ) const; // Copy out
const CharType * c_str() const;
// Modifiers
CharType & operator[]( int index ) { return string_[index]; } // Unsafe
bool Delete( unsigned start, unsigned count );
bool Insert( unsigned pos, const String & str );
private:
I NEED THE PRIVATE DATA MEMBERS FOR HERE
};
//---------------------------------------------------------------------------
#endif
thanks again
|
|
|
|
|
Will Try to help you out.
Luckyhuss
|
|
|
|
|
homework ?!
do it your self !!!
we are here to help, no to do your job...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You are allowed to define additional helper functions, member functions or otherwise ;);P
|
|
|
|
|
I'm using _spawnl to launch an external application. This works very well. But when I call _spawnl from within a thread created with AfxBeginThread, the program crashes.
What's the catch here?
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
Use CreateProcess() or ShellExecute() in Win32.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
can you paste the line which uses _spawnl(), over here.
suhredayan There is no spoon.
|
|
|
|
|
Currently I have a dialog based application that closes automatically if the user hits the "return" key. How do i disable this?
|
|
|
|
|
|
If I disable the OnOK and OnCancel, how can I close the app when a user clicks on the "x" from the system menu or selects the File Ext command?
|
|
|
|
|
JKallen wrote:
If I disable the OnOK and OnCancel, how can I close the app when a user clicks on the "x" from the system menu or selects the File Ext command?
http://blog.voidnish.com/index.php?p=31[^]
|
|
|
|
|
Hey all,
I have been trying to get this to work for a solid week now and I cannot seem to do it. I've used CSpreadsheet from here, but it doesn't work right, so I decided to do my own CDatabase attempt at it in order to debug.
I am doing
strConnection.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s","Microsoft Excel Driver (*.xls)", "c:\\test.xls", "c:\\test.xls");
then...
myDB.OpenEx(strConnection,CDatabase::noOdbcDialog);
sqlString.Format("SELECT * FROM [Sheet1$]");
while (!recset.IsEOF()) {
recset.GetFieldValue(6,sValue);
MessageBox(sValue);
recset.MoveNext();
}
What is happening is that it is returning all of the values, except straight number/currency fields in that row. (If I designate the row as "Text" and put 1000 in there, it will not show it in the msgbox (its blank). If I put D1000 (a letter in there), it shows D1000 in the msgbox.)
The CSpreadsheet class that is posted on this website does the same thing. For some reason the Microsoft Excel Driver / SQL statement is not getting number values and I cannot for the life of me figure out why. I've been reading for 3 hours straight and am so burnt out and would appreciate it if someone could shed some light on this
THX!
|
|
|
|
|
This code snippet worked for me:
CString strConnection,
strSQL,
strTemp;
CDatabase myDB;
CRecordset recset(&myDB);
CDBVariant sValue;
strConnection.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s",
"Microsoft Excel Driver (*.xls)",
"c:\\Book1.xls",
"c:\\Book1.xls");
myDB.OpenEx(strConnection,CDatabase::noOdbcDialog);
strSQL.Format("SELECT * FROM [Sheet1$]");
recset.Open(CRecordset::forwardOnly, strSQL, CRecordset::readOnly);
while (! recset.IsEOF())
{
recset.GetFieldValue((short) 0, sValue);
strTemp.Format("%f", sValue.m_dblVal);
AfxMessageBox(strTemp);
recset.MoveNext();
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a pull-down list that opens up each child window using the CMultiDocTemplate::OpenDocumentFile() function. Some windows become hidden when another is active so I'd like to bring the window to the top when the user selects it from the pull-down list. Here's some of the code I have:
void Fruits::OnSelchange()
{
switch (m_fruits.GetCurSel())
{
case 0 : //apple
if (!pAppleTemplate)
{
pAppleTemplatee = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMPSDoc),
RUNTIME_CLASS(CMDIChildWnd),
RUNTIME_CLASS(CApple));
pAppleTemplate->OpenDocumentFile(NULL);
}
else //if already open, make active
<-----code to activate window----->
break;
case 1 :
if (!pBananaTemplate)
{
pBananaTemplate= new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMPSDoc),
RUNTIME_CLASS(CMDIChildWnd),
RUNTIME_CLASS(CBanana));
pBananaTemplate->OpenDocumentFile(NULL);
}
else
<----code to activate window---->
break;
}
Any help would be much appreciated. Thanks!
|
|
|
|