|
you can do this a few ways.
You can check to see if either a file exists in A) a user directory, B) within the executable itself, or C) within the registry. If the file doesn't exist, then create it.
By doing this you can tell whether or not the program has been run before, because the next time you check for the file, it will be there (unless the user has removed it) but this is unlikely if you create the file within the executable.
|
|
|
|
|
Can show any example of this.
Thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Your Post.[^]
Looks like you've already found your answer
|
|
|
|
|
You can use Registry values for it. The installer can write approbiate HKLM values. And the run state makes more sense per user -> HKCU.
Greetings from Germany
|
|
|
|
|
"_$h@nky_" wrote: i want if my application is run on any computer firstime than it shows an message and create a user,after this it works normally.
So wouldn't the presence of said user indicate whether your application has been ran or not?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi Experts,
How can I select the tree item on right click of mouse?
|
|
|
|
|
i want to delete all strings(items) in combobox list
how is that can possible
|
|
|
|
|
"Clear()" use this method to delete all the items in a combo bax
|
|
|
|
|
it is not working
it does not delete deletes all item of combo box
i am using is this way
CComboBox *b=(CComboBox*)GetDlgItem(IDC_PATIENT);
b->Clear();
|
|
|
|
|
The best option i can give is iterate to nuuber of items and remove() individual item.
|
|
|
|
|
ResetContent()
CComboBox *b=(CComboBox*)GetDlgItem(IDC_PATIENT);
b->ResetContent();
|
|
|
|
|
That method clears the current selection, if any, in the edit control of the combo box. How does that help the OP?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The same way pipes solve the inter-thread communication problem
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I want to trim a wstring, like "Two words" as "Twowords". How it is possible.
Thanks.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
You have to go through every character in a string and find the space alpha numeric and remove from the
string.
So u need one temp string;
char* pData = Two Roes;
char* tmpData;
while(!pData++) // while string reach to last
{
if(pData != NULL)
tmpData = pData;
}
return pData = tmpData;
|
|
|
|
|
Actually I used isspace() to find all spaces in a wstring. But in that case I have to go through a loop, for each letter of the string. I'm try to avoid it and see any solution on trim.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Trimming usually implies removing from the ends, not the middle.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Ya, that's true. I'm looking that it's possible to trim middle spaces.
And also, I have a similar question. How can I trim a standard string in C++ for the end spaces.
Like this.
"One " trim to "One"
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: How can I trim a standard string in C++ for the end spaces.
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i want to know the method to work with internet explorer event .i.e when user change url address in address bar then some functionality of my application do the work accordingly in application.If any one have idea about the method for capturing the internet explorer6,7,8 then pls. share your idea.
Thanks.
|
|
|
|
|
How do I add the popup button like MapEditor of Company of Heroes.
Like as below:
http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/wb1.JPG
http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/wb2.JPG
|
|
|
|
|
The error I'm getting:
1>c:\users\john\documents\visual studio 2008\projects\torch\torch\main.cpp(18) : error C2065: 'lpBuffer' : undeclared identifier
I've seen plenty of examples where ReadConsoleInput is setup to read only 1 INPUT_RECORD and then return, but I'm trying to set it up so that if multiple events occur at once, so they will be placed into a vector array instead. The trouble is that everything stops once ReadConsoleInput starts and I have no easy way of referencing the variable to be stored. Here is my code:
#include "includeall.h"
using namespace std;
int main(int argc, char **argv)
{
HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD NumRead;
BOOL eventloop = FALSE;
vector<INPUT_RECORD>InputRecs;
printf("Welcome to Bloodhound 1.0a (torch).\n");
printf("Press the ESC key at any time to exit.\n");
do
{
X| if(ReadConsoleInput(hIn, InputRecs.push_back(lpBuffer), (DWORD)InputRecs.capacity(), &NumRead) != 0)
{
}
else
{
printf("Unable to read from console error number (%d)", GetLastError());
printf(".\n");
eventloop = FALSE;
}
InputRecs.clear();
}while(eventloop == TRUE);
return 0;
}
Ideas?
|
|
|
|
|
CoffeeAddict19 wrote: Ideas?
Yes. You need to declare lpBuffer .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Im writing a program that is going to store A LOT! of parameters in a temporary ODBC database when running. My question is whenever I start the program or load a new document I need to completely delete the entire database to have a clean slate. Is there an easy way to do this, or do I need to just write a function to go delete everything through row by row. Im still new to MFC and the recordset class and have had problems deleting.
Thanks everyone has really helped me learn a lot on here.
|
|
|
|
|
Cozmo23 wrote: Is there an easy way to do this...
You mean easier than deleting the database file(s)?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|