|
Cheers guys, i appreciate it alot
til
|
|
|
|
|
I am using MFC, how would I go about finding and displaying all of the CD/DVD drives of the users computer? I have been looking around for articles, and have not found anything yet. Any help is appreciated.
-Dev578
|
|
|
|
|
Take a look at _getdrives() and GetDriveType() in MSDN.
There is also an example.
|
|
|
|
|
mmica wrote:
Take a look at _getdrives()...
This does not sound like a valid function. Are you sure it exists?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Yeah it does, many microsoft C api/functions starts with _ for some compatiblity issue.
Interviewer (me) : "Did you install Linux all my yourself?"
Candidate : "Yes i installed Linux all my yourself."
|
|
|
|
|
Have you seen the Enumdisk1 sample (article Q264203) on MSDN? It uses the Setup class GUID_DEVCLASS_DISKDRIVE GUID (4D36E967-E325-11CE-BFC1-08002BE10318 I think) to enumerate all the disk devices that are installed in the system.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
I have an application that currethly supports a socket connection but I want to add a Dialog to support setting up a Dial Up connection. What APIs can I use to do that ?
Thanks
|
|
|
|
|
Check out RasCreatePhonebookEntry() and the other RAS functions.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You could use the WinInet API by importing them into your project [DllImport("wininet.dll")]. Interfaces like InternetGetConnectedState and InternetAutodial would probably be helpful - check the WinInet docs for details.
Cheers,
Lee.
Lee H Fuller
lee@fullerdata.com
|
|
|
|
|
Dundas Software has a free dialup MFC class which can be downloaded from here.
Ivor S. Sargoytchev
Dundas Software
|
|
|
|
|
Hi,
I have a weird problem in DCOM. Everything works fine until the network goes down. If after a short period of network failure, when the network connection is restored, and I do CoCreateInstanceEx again, that works ok too, however, now I can't get a QueryInterface to succeed to get an interface pointer. It fails with some RPC error in the HRESULT. This behavior is intermittant.
Pl. help.
Thanks,
nct_11
|
|
|
|
|
Is it possible/easy to convert MFC Doc / View App to a COM / DCOM server? What I want to do is to have an external application query my running MFC application for the status of several internal operations using COM.
John
|
|
|
|
|
Not easy thing to do, plus the mfc application may not be employing the best techniques for COM/DCOM application to work efficiently
Interviewer (me) : "Did you install Linux all my yourself?"
Candidate : "Yes i installed Linux all my yourself."
|
|
|
|
|
It may be easier to expose the data from your existing app via a pipe or socket, and then write a COM component that knows how to query that pipe/socket.
onwards and upwards...
|
|
|
|
|
I was thinking of that but it does not seem like a simple operation and it will require a lot of work to implement.
John
|
|
|
|
|
why use dcom?
just expose an interface and use a standard network protocol
?
"there is no spoon" biz stuff about me
|
|
|
|
|
Because to get the result I need to execute code on the application address space and return objects containing the result. This sounds very much what com does...
John
|
|
|
|
|
can u add code to the exiting app?
make it pipe data out in some form or another?
"there is no spoon" biz stuff about me
|
|
|
|
|
Yes I can however I believed their was some trick that I could use to make my app a com server than add com objects that would return the info. If this is impossible or too difficult it really is not worth doing because it is not all that important to have this feature. The purpose of this information was to aid in debugging a complex multithreading application. I believe if I went the sockets route I am going to have to add a thousand lines of code to accomplish this and that was not what I was looking for.
John
|
|
|
|
|
oh shame
i think com / dcom are on the way out in the bigger scheme of things anyways so it might not have been the best way if the app has to live into the future
and really
it isnt that hard to add the sockets stuff
there are a billion classes out there that make it a complete snap
"there is no spoon" biz stuff about me
|
|
|
|
|
l a u r e n wrote:
it isnt that hard to add the sockets stuff
I'm laughing because the program already has two different socket communication methods (named pipe + CSocket based) but neither would be easy to do what I need in the curent form. Know anything about SOAP?
I'll take some time to think this one over before I go writing any code..
John
|
|
|
|
|
hehe
soap ... simple object access protocol ... a fancy name for using http to talk to remote things
i just do it the way a web browser does it
"there is no spoon" biz stuff about me
|
|
|
|
|
I hate to sound simplistic, but would using OutputDebugString() satisfy your needs? Or maybe you might want to look at Rob Manderson's Logging service.
onwards and upwards...
|
|
|
|
|
I do already have a logging system (similar to Robs but not mfc). You may have sloved my problem. I could send a user message to the program from another app and have it spill the result in the log. Thanks.
[EDIT]
Now when I think of it the socket options do not seem very difficult. There was one other detail that was influencing my desire to have a COM server. I currently have several property sheets in a popup dialog in the main application (easter egg) that display most of this info. I was thinking that I could move the property sheet to the new application and use com/dcom to do the RPC / communications for me.
[/EDIT]
John
|
|
|
|