|
|
hi all
i build an application in vc++ MFC
i add a button on dialog box and write upload
now i want that when i click on this button i get
a list of drives in the system to upload a file
can i get help regarding this
thanks alot
hi
|
|
|
|
|
paras_s12 wrote: a list of drives in the system to upload a file
Did you see CFileDialog?
SHBrowseForFolder - Displays a dialog box enabling the user to select a Shell folder.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
paras_s12 wrote: ...get a list of drives in the system...
Use GetLogicalDriveStrings() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I want only one instance of my application to run at a time.
So i have creted a CSemaphore object with a name "app" in the global area.
And in the Initinstance of the app class i am checking whether it is locked or not. if not locked, locking it and continue otherwise, return false.
Its working fine. What i want to know is how can the CSemaphore object exists between the two different applications even when the application is closed?
Thanks in advance for the reply.
KIRAN PINJARLA
|
|
|
|
|
The Semaphore is actually like a system-wide flag - it's handled by the OS. Once you create (and lock) the named semaphore from one instance of your application, Windows will not let you do that in the second instance ...
|
|
|
|
|
|
for single instance my preference is alwways mutex due to memory overhead and other thing!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
i have to download a file from a url. while sending request system hangs at BOOL bSend = ::HttpSendRequest(m_hHttpFile, NULL, 0, NULL, 0); whats wrong with this.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Are you using MFC?
The class CHttpFile provides the functionality to request and read files on an HTTP server.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
yes i am using mfc.
m_hHttpFile = HttpOpenRequest(m_hHttpConnection, NULL, m_sObject, NULL, NULL, ppszAcceptTypes, INTERNET_FLAG_RELOAD |
INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_CACHE_WRITE , NULL);
if (m_hHttpFile == NULL)
{
return DLFAILED;
}
BOOL bSend = ::HttpSendRequest(m_hHttpFile, NULL, 0, NULL, 0);
thi is the code.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
See Here[^].
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
deeps_cute wrote: i have to download a file from a url.
How about URLDownloadToFile() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I have a dialog based application in VC 6.0 MFC. I want to port in to VC++ 2005 with few additions.
Additons are:
1- I need to add a window form to this MFC App, which will be the main form from where all other forms will be loaded on button click.
2- Add ADO.Net support to MFC Project.
How can this be done?.
Thanks in Advance.
Z.A
|
|
|
|
|
zubair_ahmed wrote:
1- I need to add a window form to this MFC App, which will be the main form from where all other forms will be loaded on button click.
OK, so you need to change the main form. I'd say it's probably easier to do this in VC6
zubair_ahmed wrote: 2- Add ADO.Net support to MFC Project.
OK, so you need to add C++/CLI support to your app. Then you can use .NET classes where-ever you like.
The other issue is, VC6 is a bad C++ compiler, unless you've written very good code, expect to make changes before it compiles.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Should this be taken as solution ?
Z.A
|
|
|
|
|
hi everybody,
i need to implement excel and its functionality in C#.NET form and display excel existing data in the C# Form and also use the functionality of excel in Form how to do
Prathap
|
|
|
|
|
This is the C++ forum.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I would like some advice on which STL container is best given the following requirements
* I need to store in memory a collection of unsigned ints
* Only one thread will touch the collection
* Speed is critical for add/find/remove
* I need to add to this collection, usually I will be adding a continuous range (eg 10, 11, 12, 13, 14)
* I need to find out if a specific value is in the collection
* I need to remove specific values
* I would like to minimise memory usage by allocating storage for the most common size of this collection at startup, have the collection expand itself if nessasary (without moving existing items) but never shrink itself
Is there an STL container that can meet all of these or do I need to make my own?
|
|
|
|
|
Will you be adding elements just to the end, at the start and end or at any location?
Will you be removing elements just at the end, at the start and end or at any location?
Do you need to preserve the insertion order?
Do you need to be able to iterate over the collection in numerical order?
Are multiple copies of the same value allowed?
Steve
|
|
|
|
|
Stephen Hewitt wrote: Will you be adding elements just too the end, at the start and end or at any location?
Elements will always be unsigned int's. Every element I add will be greater than all the elements already in the collection. If the collection has {1, 7, 8} I could add 9 or 45 etc but never 6. Im not interested in their location in the collection but Im guessing a sorted collection will give me faster lookup
Stephen Hewitt wrote: Will you be removing elements just at the end, at the start and end or at any location?
Any location
Stephen Hewitt wrote: Do you need to preserve the insertion order?
Nope
Stephen Hewitt wrote: Do you need to be able to iterate over the collection in numerical order?
Nope
Stephen Hewitt wrote: Are multiple copies of the same value allowed?
Nope
|
|
|
|
|
The easiest choice would seem to be a std::set :
- Search time is at most O(log2(N)). Use the set 's member functions to do the searching and not those from <algorithm>.
- The collection itself will enforce uniqueness.
- Insertion/deletion at any point is fast and not related to the number of elements in the container.
Steve
|
|
|
|
|
Stephen Hewitt wrote: The easiest choice would seem to be a std::set:
- Search time is at most O(log2(N)). Use the set's member functions to do the searching and not those from <algorithm>.
- The collection itself will enforce uniqueness.
- Insertion/deletion at any point is fast and not related to the number of elements in the container.
Thanks mate
|
|
|
|