|
Hi,
How can I detect an application instance..whether its already running or not?
I am running an application now I want that if that application is running then if I double click that application icon then it should popup the currently running application instance in place of opening a new instance.
Is it possible to detect application instance in VC6?
Thanks in advance
Prateeti
|
|
|
|
|
|
any one try to dev. firewall ?
i need any info about how to write firewall applicatioin
|
|
|
|
|
|
Suppose we execute a SQL query that returns various fields. Now in order to get value of certain field we use following methods:
vtField = pRecordset->Fields->GetItem("Name")->Value;
OR
vtField = pRecordset->GetCollect("Name");
But there are certain queries that do not return any field but a single value e.g
select count(userid) from mytable
Suppose i execute this query and its result is in RecordSet object. Now how can i retrieve this value as this is a single value and is not represented by any field ????
|
|
|
|
|
Try
select count(userid) as count from mytable
vtField = pRecordset->GetCollect("count");
Todd Smith
|
|
|
|
|
How can I do decimal precision in an edit control? For example, .002 or 2E3 or 2E-3. I just can't find a way to get the decimal precision I would like and Setprecision(4) should give me 4 places past the decimal but it doesn't work(I would like for every thing to be in engeering mode.) Help!
David
|
|
|
|
|
You will have to manage the data yourself, Win32 does not provide any extra processing for numbers and things like that.
If you simply want the data to be displayed in a particular format you can wait for the edit control to lose focus then reformat the data yourself from the parent control.
However if you want to limit the characters that the user can type in and the format of their text you will have to do something a little more complicated. I would suggest subclassing the edit control to limit these characters.
Before you do that though I would search through this site and the internet, someone else has probably already created a control like this that you could use.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
So, I figured out what I was doing with the GDI resources and everything works fine in 2000, NT, XP, and 98 SE. The only problem is, I'm getting the GDI resources running out when I run my app on straight up windows 98. Does anyone know what I need to get to be able to update the Straight Up version of 98 to have the GDI fix or whatever in it without having to purchase the SE? I don't want to tell my customers that they have to buy an upgrade to their OS just to use my app.
|
|
|
|
|
Are you sure your GDI objects are not selected into any DC when you're deleting them?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Restoring is key...
<br />
CPaintDC dc(this);<br />
CPen *pOldPen;<br />
CPen pPen;<br />
<br />
CPen pPen(PS_SOLID, 1, RGB(0, 0, 255));<br />
<br />
pOldPen = (CPen *) dc.SelectObject(&pPen);<br />
<br />
dc.SelectObject(pOldPen);<br />
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
What's the callback function?
When we need the callback function?
|
|
|
|
|
duen wrote:
When we need the callback function?
Usually in response to a homework question.
Todd Smith
|
|
|
|
|
Usually a callback function is to do the same task over and over again but passing it different variables to get different results each time. Like enumerating which fonts are on the users computer.
But callback can be used in more ways then just this.
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
Hello all,
How do you create a date class that has the following date output formats--
DDD YYYY
MM/DD/YY
January 1, 2000
Thanks for the help,
Philll
|
|
|
|
|
copy CDate
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
|
CDate has all those output formats.
maybe i misunderstood the question... ?
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
Sorry. I need help creating the DATE class itself.
|
|
|
|
|
I have some undetermined number of values a field can take on. I need to gather these in an STL container, after which I have to check and see if a new value thats being added (to a database) already exists in the container. If it does, then I have to inform the user its not unique, and not add it to the db. (I'm not adding the new value to the STL container, but to a database, whose current values I've gathered in my container).
The value is a CString. Should I choose vector, or set or list (not a map for sure). I'll be checking to see if a CString exists in the container, not by index but by its name.
Suggestions?
Thanks,
ns
|
|
|
|
|
A vector is good if your array isnt changing size a lot. A list is good if your array changes size a lot. A list also costs you a tad bit more memory than a vector for the extra pointer.
If you want to do fast string searches then you need a hash. The map container is a hash. There are also some non-standard hash containers you can get. The boost library should have a few hash containers http://www.boost.org[^].
Todd Smith
|
|
|
|
|
I would choose a set.
A set will only allow one instance of the type that specify to be inserted. Use the insert member function of the set to insert the CString in the set.
The insert function returns a pair<set<CString>, bool> object to indicate if the function succeeded or not. THe iterator will contain the iter of the object that was inserted, and the bool will indicate if the insertion actually occured.
If the insertion occured then true will be returned, otherwise if the item already existed the bool will be false.
The standard implementation of a set is with a Red-Balck tree, which is a balnaced binary search tree. So you will get n log(n) lookup times. If you would rather use a hash implementation you can switch to the SGI or Boost implementations which both have hash implementations. Hash implementations have faster lookups than trees, however they require more space as well.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
kilowatt wrote:
So you will get n log(n) lookup times
Isn't that just log(n) for lookup?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Tomasz Sowinski wrote:
Isn't that just log(n) for lookup?
Your right, I confused the lookup time with the amount of time it takes to sort the entire binary tree.
Thanks
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanks for the ideas. I am implementing this this morning so I'm glad for some direction with your responses.
ns
|
|
|
|