|
You're right. But I think the app is a SDI one ;)
To be more accurate, I think the boolean should be attached to the document class, set to TRUE when OnOpenDocument succeeds, and set to FALSE on OnCloseDocument.
Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed - Dwight D. Eisenhower
|
|
|
|
|
yeah, it is SDI...
and you're right, attaching the boolean variable to the Doc class would probably be best...
Thanks for all the help!!
|
|
|
|
|
Thanks for the help. One more question, I'd like the Setup option to appear greyed out when it is disabled. Is there something similar to:
pCmdUI->Enable(m_bFileOpen);
that will do this? I thought that by disabling it, it would automatically grey it out as well, but i was wrong.
|
|
|
|
|
i want to add an edit to my database dialog using CDaoRecordset edit and CDaoRecordset update, what variables i need to declare and how to code it? (mi really poor at programming)
|
|
|
|
|
|
This is puzzling me. With the MFC code, I get : cant connect, but the socket () code connects fine (both to same address of my secondary machine). So since I want to use the MFC GetFile() functionality and dont know the equiv using the socket() method, I am stuck. What should i look at? BTW the MFC code works fine with the microsoft ftp address, so I know the codes okay. But if it were something weird about my 2nd machines IP address, then the socket() code should not connect either! But it does!
Here is the one that cant connect:
m_pFtpConnection = InternetSession.GetFtpConnection ("130.109.184.xxx" );
and this one works:
dstsockaddr.sin_addr.s_addr = inet_addr("130.109.184.xxx");
dstsockaddr.sin_port = htons(PORT);
dstsockaddr.sin_family = AF_INET;
dstsocket = socket(AF_INET, SOCK_STREAM, 0);
if (dstsocket == -1)
perror("socket creation failure");
status = connect(dstsocket, (struct sockaddr*) &dstsockaddr, sizeof(dstsockaddr));
Thanks,
ns
|
|
|
|
|
Are you connecting to the FTP port ??
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Yikes! I didnt think about that. The IP address I got just by doing ipconfig on my machine. The socket() code has a PORT 2000, but my MFC code has no port specified. Hmmm... so what I need to do here is get a file from a remote machine whose IP address is given to me. I saw GetFile() and jumped on it, is it that maybe the ftp.microsoft.com IP add works because its an FTP IP address and mine is just a regular IP address? Confused!
Thanks,
ns
I am now looking into GetHTTPConnection................????
|
|
|
|
|
So you're running an FTP server on port 2000 then?
If that's the case you can use the address:port notation
eg: "192.9.200.1:2000"
The FTP connection is trying to use the default target port of 21. If your FTP server is on a different port, then your client needs to know that!
Steve S
|
|
|
|
|
I doubt whether you have an FTP server running on your target machine. GetFTPConnection connected to microsoft.com only b'coz they have an FTP server running in that machine.
So first check it out as to whether you have an FTP server on the target machine.
If not see whether you have an HTTP server running there, and the files you want to download are accessible through HTTP( The folders where the files reside need to be published for doing this). To check this, just give the URL on IE as "http://ipadress"( HTTP server listens on port 80 - default ). If the port number is not 80, give "http://ipadress:8000"( if port no is 8000 )
If you dont have HTTP server, give an exact description of the scenario, may be I can help you in designing the application.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi gurus,
I've created a simple class for serial communication.
For a long time everything works fine within all my applications
if I use a real COM-Port.
But know I get problems with virtual COM-ports which are
comming up with some USB/RS232 Converter and bluetooth
dongles.
All manufacturer of this devices says I can use virtual COM-ports
in the same way I'm using the real existing COM-Port.
But unfortunately this seems not to be right.
If I use an USB bluetooth dongle on virtual COM-Port
my app hangs on WriteFile().
WriteFile() never returns.
BTW, all other functions I need before using WrieFile works without an error:
CreateFile()
SetCommMask()
SetupComm()
GetCommState()
SetCommState()
I've tried all day long to find a solution for my problem.
Please help me.
Bye
Joerg
|
|
|
|
|
Your virtual comm port driver may be bugy. A virtual serial port driver that I use is from http://www.eltima.com[^]. It has a 14 day trial period. See your software works using it.
|
|
|
|
|
Guys,
I've created a property sheet and insert two pages in it. By default the tabs appear on the top left corner. I like to place tabs at the bottom or on the sides. How can i do this
|
|
|
|
|
You would have to do this 'by hand', using the tab-control. MSDN has a few examples you can find by searching for CTabControl .
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I am able to connect to a machine using the foll code. Once it is connected , how do I grab some files from that machine and bring them onto my machine? I was not able to go the GetFTPCOnnection MFC route which has GetFile
( since I have the IP address, not the site and was unable to get the name from IP successfully in that the name came back as "NameOfmyMAchine" with no specifics (used gethostbyaddr) and therefore couldnt connect via CIntnetSession code)
. But the socket() approach works and I need to know how to get the files..........
Thanks,
ns
|
|
|
|
|
Doesn't passing the string version of the IP address eg "10.0.0.10" work?
Steve S
|
|
|
|
|
Wish it did! With
m_pFtpConnection = InternetSession.GetFtpConnection ("130.109.184.xxx" );
I get back a null pointer, and this is a valid ipp addres (my secondary machine). However if I put in 'ftp.microsoft.com' it does go there and gets me a ->GetFile() happily..........
Help!!
Thanks,
ns.
|
|
|
|
|
If you are connecting to the FTP server, then what you need to develop is an FTP client. An FTP client has to adhere to the RFC 959. In short, your application will instruct the FTP server to connect and download the required files for you. Its an ardous job. Think before you leap!!!
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
I have a CDialog derived class MyDialog. In its OnInitDialog() function, I create 10 controls with their create function (keeping the pointers as members). They are showing well.
Now, when I close the dialog, what do I have to do. Do I need to destroy the controls? Deattach them? Delete their pointers? And where do I have to do all this?
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
You probably need to override OnPostNCDestroy and there call delete for each of your 10 pointers... that's it!
|
|
|
|
|
I meant override PostNCDestroy...
|
|
|
|
|
1. The window side of the controls will be destroyed for you, so you don't need to do anything like Destroy or Detach, but you will need to delete the MFC objects you created.
2. The best place is probably in PostNcDestroy for the dialog.
Steve S
|
|
|
|
|
hi guys,
I using Microsoft DateTimePicker Control of CDTPicker Class in VC++. i got invalid property value on statement
m_dtdate.SetValue(var);
my code is
CDTPicker m_dtdate;
COleDateTime CurTime;
CurTime = COleDateTime::GetCurrentTime();
VARIANT var;
DATE ddate;
ddate = CurTime;
var.date = ddate;
m_dttime.SetValue(var);
Thanks in advance
|
|
|
|
|
Try this
VARIANT var;
DATE ddate;
ddate = CurTime;
var.vt = VT_DATE; //
var.date = ddate;
m_dttime.SetValue(var);
This should work!!!
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
it works correctly. thanks for reply.
|
|
|
|