|
HI,
I want to drag n drop the file
that is i drag the audio file , when i place it on my application window area , my application starts playing it.
how i detect that file is now draged and on my application area , and how can get its path et to plat it,
any sample or help
thanx
Regards.
|
|
|
|
|
zahid_ash wrote:
how i detect that file is now draged and on my application area...
You need to handle the WM_DROPFILES message, after you've registered the application as a dropped-files recipient using DragAcceptFiles() .
zahid_ash wrote:
...and how can get its path et to plat it
Try DragQueryFile() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thanx ...
but its giving some problm here.
can u send me some sample .
thanx again
Regards.
|
|
|
|
|
zahid_ash wrote:
but its giving some problm here.
And those problems would be what?
zahid_ash wrote:
can u send me some sample .
Try searching here at CP, and also on MSDN.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I am presently working on a multithreaded VC++ application which consists of 3 threads each accessing the same database.
Would it be more efficient to use 3 different connection objects or just a single connection object in this case?
Looking forward to your reply..
Thanks,
Mahadevan
|
|
|
|
|
It all depends on whether you are bringing up the connection and closing it down on each thread when you need to use the database. Bring up connections it fairly time consuming.
I would tend only to have one database connection and serialise the database access between the threads. This database connection would tend to be instanciated when the application initialises and destroyed on application exit.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Well,
In all the threads, the database connection is opened and closed only once and the threads are alive as long as the application is alive.
In this case, will my application work faster than an application which has only a single database connection object?
I am asking this because in order to serialize a single database connection between the multiple threads would require mutex (correct me if I am wrong) which may degrade the performance?
Do you foresee any problem (esp. performance degradation) in case I use multiple connection objects?
Regds,
Maha
|
|
|
|
|
Depending on the type of database connection object used there can be deadlock problems.
In the past I have used multiple threads with ADO each having its own database connection. In which I experienced deadlock problems within the ADO code (which is not under my control). I switched the system to a single connection and serialised access to get over this.
Saying that, this may not be a problem any longer. Just bear it in mind when you are developing.
To answer your question, theoretically it will be more efficient for each thread to have its own connection.
Hope that helps with your descision.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi.
Prehaps it would make more sense to have a 'manager' from whom you request access, so that if you require a fourth or more thread(s) then the scaling issue is not a problem.
James.
|
|
|
|
|
Yes, that is basically what I have with the serialised access.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Thanks for your help.
I still have a small query, What do you generally prefer for connecting to Database, I use the CDatabase object to connect with the SQL server and I am just not able to avoid the deadlocks in both cases, that is single connection object or multiple connection objects.
I seem to be getting this problem when a thread is executing a query and the SQL server goes down.
Any suggestions?
Thanks a lot,
Mahadevan.
|
|
|
|
|
Hi everyone, especialy those nice gents who actualy answer the questions!
( Ladies? )
I know that you can #define fileName "myFile.txt" a string in the globals area, and when you need to you can stream.open(fileName) so you wont have to write the file name every time you open a stream.
My question is this can the same logic be used to define the actual stream for example #define ifstream inFileStream so that I wont have to declare the streams inside functions that need to use them. So that the only line relating to a stream in the function would be inFileStream.open(fileName) . This should also remove the need to pass the streams to functions since I will be able to open and close them any where any time.
Thanks in advance!
|
|
|
|
|
No. #define causes simple text subsititution before actual compilation. ifstream.open("myFile.txt") isn't valid C++ syntax.
|
|
|
|
|
Hi everybody!
I wan to post some datas to asp page.
How can i do this?Can u give examples?
Please help me!
Thanks...
|
|
|
|
|
|
this is not the place 2 post this. u shud have done it in asp.net column.
btw what xactly u need, r u a beginr, u just need some data 2 be posted to the asp page on the server? if so <form> - </form> in html will do.
otherwise if u need some data to be posted to an asp page on the server thru a non-explorer client app.. then use the XMLHTTP class provided with msxml.dll. Load ur data into an xml dom, call the open method of xmlhttp by passing the url of the asp page, and finally call the send method of xmlhttp by passing the dom object which loaded with ur data to be posted.
rgds...mil10.
|
|
|
|
|
I have an application that is written vc++.It displays system informations and i want to post this information to asp page, server.
How can i do this?
Thanks...
|
|
|
|
|
ok, then its better u go 4 XMLHTTP. go thru some sample prgms fo xmlhttp methods Open and Send .
rgds..mil10
|
|
|
|
|
Hi,
From what I understand you want to send data to an asp page through the query string from a C++ application, right?
If that is the case then use the class CInternetSession. You will find the OpenURL() method of this class useful in sending the data to the asp page through the query string.
Regards,
Mahadevan.
|
|
|
|
|
how does the schedule task in windows work?
|
|
|
|
|
|
what is the signal that goes to all the applications on log off and how do i handle it? whenever the system logs off, all the application gets killed. is there a way so as not to kill the application
|
|
|
|
|
chk out WM_QUERYENDSESSION and WM_ENDSESSION
rgds...mil10
|
|
|
|
|
As soon as I add this line to the resource file:
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "res\Wcpm.manifest"
as recommended by an MSDN article in order to get XP visual styles, the CEditView in the application starts showing rubbish characters whenever a text file is opened and displayed in it.
All dialog controls and whatnot change to the XP visual style just fine, just this crazy CEditView behaviour also starts happening.
I suspect its something to do with the fact that CEditView directly manipulates the hosted edit control's buffer and doesn't go through SetWindowText or ReplaceSel or any of those functions to display text.
Mighty annoying. Anyone come across this before?
|
|
|
|
|
Hi, I will like to open a *.jpg file using iexplore.exe in my program. I tried to do this using
CreateProcess("...\\IEXPLORE.exe", "pic.jpg", .....) but it doesn't open the pic.jpg but displays the default homepage instead. Any suggestion on how I can get it done properly? Thanks.
|
|
|
|